-
Notifications
You must be signed in to change notification settings - Fork 116
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
Grammar parser does not correctly recognize pug rule #82
Comments
As far as I can tell, this rule is working exactly as per its written. The rule as written, captures the The way I read the rules, there is no way this can match because nothing consumes the colon. If the rule at line 333 wouldn't match, then the syntax would loop around and cause the next part to rematch through the above rule ('tag_name') "begin": "\\G(?=(#[^\\{\\w-])|[^\\w.#])",
"end": "$",
"comment": "Line starting with characters incompatible with tag name/id/class is standalone text.", Oh Bingo! I have been looking for this exact case. After the begin rule of 'tag_name' the anchor is set at character position 2. This anchor position is not lost when the END rule matches, but the previous rule's anchor position was character 0 (start of string). I have hypothesized for a while that TextMate pushes the anchor position when they push rules, and pop it when they pop a rule. In this case, the \G from the rule at line 333 would not match because the original anchor position of 0 would have been restored, and not match the current character position of 2, and instead the rule at line 549, 'complete_tag' would, which would be what seems to be expected. Can someone confirm this with TextMate? (I don't have a Mac) I had previously mentioned this in #49, @infininight, any input? |
Now this isn't the only issue that was displayed in microsoft/vscode#65983, the other appears to be a different problem. In that case: p.
This is a very long and boring paragraph that spans multiple lines.
Suddenly there is a #[strong strongly worded phrase] that cannot be
#[em ignored]. The tag Trying to find this, I noticed that 2 rules at 1 point both have the same match text. a rule at 848, and the rule included at 852, which appears at 764 ( "begin": "",
"end": "(?=\\])", Its an empty begin rule! I hypothesize that TextMate allows these, VS Code TextMate does not, and it instead causes some issues, because at this point, I see 6 more rules in the debug, but 'inline_pug_text' should have been the last. (seen below as '- 1017') The lines below it are actually its 'patterns'. I have run in to this before when I have commented out a 'begin' block as well.
I think VS Code TextMate needs to support the empty but present 'begin' rule, and should also support a EDIT: It appears it does already allow non-existent 'end' rules, as I saw an 'undefined' for the end pattern while working on a syntax, I had forgotten the 'end'. |
Is anyone else still seeing the incorrect formatting? I'm on Version 1.34.0 (1.34.0) and this doesn't appear to be fixed for me |
Unfortunately the update to vscode-textmate was not absorbed by vscode until just a week ago, so at this moment it's in insiders only.
See microsoft/vscode#73497
…On May 30, 2019 3:32:52 AM GMT+09:00, Neil Soult ***@***.***> wrote:
Is anyone else still seeing the incorrect formatting? I'm on Version
1.34.0 (1.34.0) and this doesn't appear to be fixed for me
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#82 (comment)
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
|
Simple example:
Grammar is here: https://github.com/davidrios/pug-tmbundle
The
li
is correctly categorized asentity.name.tag.pug
.custom-link
is incorrectly categorized astext.pug
If you copy the same grammar into a different editor and use their text mate engine,custom-link
is correctly categorized asentity.name.tag.pug
.In the grammar, this is the rule that is not getting applied correctly:
Originally found in microsoft/vscode#65983
The text was updated successfully, but these errors were encountered: