I get an unexpected “skip” or “black hole” after match: $\n when followed by a match ''.
What changes do I need to make to the below syntax-def to this work? I know (?=\S) would overcome the problem, but I don’t want to use (?=\S) because I need to track whitespace in this grammar.
Here is my test.
Text to highlight:
A[\n]
B[\n]
Expected result:
A: format is testval1.Alpha_1
B: format is testval2.Alpha_2
Actual results:
A: format is testval1.Alpha_1
B: format is text.plain.Alpha_3; the problem is that the Alpha_2 match [B] doesn’t appear to be attempted, though the read-position should be exactly before the “B” upon the entry into Alpha_2.
Here is the syntax def:
main:
- include: Alpha_1
Alpha_1:
- match: '(A)'
scope: testval1.Alpha_1
- match: '($\n)'
scope: text.whitespace.Alpha_1
- match: ''
set: Alpha_2
Alpha_2:
- match: '(B)'
scope: testval2.Alpha_2
- match: ''
set: Alpha_3
Alpha_3:
- match: (.)
scope: text.plain.Alpha_3
