question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow multi-line lookahead in modes

See original GitHub issue

Since patch 846d043e9fd88afd98f8615b5df117de72242206 , the considerations that made lookahead past the current line problematic have largely been made irrelevant.

See discussion here

A mode would still have to declare its maxmimum lookahead, so that the parser frontier can be backed up appropriately when the document is edited. And it does muddle up the StringStream API a bit more (i.e. the various pieces of code that run parsers, such as runMode, need to somehow expose the whole document to the stream), but it’s probably worth it.

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Reactions:3
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
marijnhcommented, Jun 22, 2017

This was finally implemented in 5.27.0 (via the StringStream.lookahead method)

1reaction
superloucommented, Mar 9, 2015

Also interested in limited look-ahead, particularly for Fountain.io markup. I’ve been able to mostly implement highlighting by updating state with blank lines, but I think the canonical syntax definitions rely on look-ahead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Regex Match multiple lines in between positive lookbehind ...
Regex Match multiple lines in between positive lookbehind and positive lookahead · Just strip the newlines from your match, what is the problem?...
Read more >
Multiline mode of anchors ^ $, flag "m"
The multiline mode is enabled by the flag m . It only affects the behavior of ^ and $ .
Read more >
Lookahead and Lookbehind Tutorial—Tips &Tricks - RexEgg
This allows us to remove one lookahead and to simplify the pattern to ... For instance, by matching (?m)^ (the beginning of a...
Read more >
Regex Tutorial - Turning Modes On and Off for Only Part of ...
Normally, matching modes are specified outside the regular expression. In a programming language, you pass them as a flag to the regex constructor...
Read more >
Options for regular expression | Microsoft Learn
Learn how to use regular expression options in .NET, such as case-insensitive matching, multiline mode, and right-to-left mode.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found