-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Identify newline separated segments #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few additional comments
rascal-textmate-core/src/main/rascal/lang/rascal/grammar/analyze/Symbols.rsc
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a lot better indeed 👍 also the textmate regexes look more like you would expect them too.
rascal-textmate-core/src/main/rascal/lang/rascal/grammar/analyze/Symbols.rsc
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the quick review, @DavyLandman, 🙂
This PR adds improved support for segment-based "gobbling up" tokens in begin/end patterns. To motivate, suppose we have the following grammar:
For instance,
"asdf"
and"foo\"bar"
should be fully highlighted, but"foo"bar"
should not be.Before this PR, the following TextMate rule is generated (simplified):
That is, roughly, for each symbol
s
inChar
, a nested pattern is included to gobble up content betweenbegin
andend
that matches individuallys
. However, gobbling up individual symbols is too fine-grained. For instance, with this rule,"foo\"bar"
will not be fully highlighted: only"foo\"
will be highlighted (because the\
is not considered in combination with the second"
).Instead of gobbling up individual symbols, the tokenizer should gobble up segments of symbols that belong together. That is what this PR adds.
After this PR, the following TextMate rule is generated (simplified):