-
Notifications
You must be signed in to change notification settings - Fork 142
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
syntect handles push & immediately pop non-consuming patterns differently to ST #127
Comments
I've made a PR to the Packages repo that fixes the C# syntax so that all syntax tests pass in syntect: sublimehq/Packages#1359 |
I think I also know how to fix this. I don't remember exactly, I'll have to look at the code, but syntect does something like detecting cycles, whereas it seems that Sublime just stops you from reversing direction without advancing. It should be simple to switch to the way Sublime does it. |
Looking into this. While reading the code and learning how it works, I've created #144 to make the main method a bit smaller and hopefully easier to understand. |
This fixes issue #127. There's now 575 fewer failing assertions when running syntest. The following test files no longer have any failing assertions: * syntax_test_bash.sh * syntax_test_c#.cs * syntax_test_C#7.cs * syntax_test_GeneralStructure.cs * syntax_test_Generics.cs * syntax_test_Operators.cs * syntax_test_Using.cs See the added comment before ParseState for more details.
Fix released in 2.0.1! |
In ST, the following syntax:
accompanied by the following test passes:
in syntect, it doesn't:
I believe this is due to how ST handles a match that:
In ST, it ignores the pop until at least one character has been consumed. Currently, syntect seems to push, then pop, then ignore the push again until at least one char has been consumed.
Related reading: sublimehq/sublime_text#1906 (comment)
This is the cause for most of the C# syntax test failures in syntect alluded to in #124 (comment) since sublimehq/Packages@e29d674#diff-9b5e53d4e14d87efc8f78017464d6b94.
The text was updated successfully, but these errors were encountered: