-
Notifications
You must be signed in to change notification settings - Fork 144
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
with_prototype syntax test failures #101
Comments
Interesting, thanks for figuring this out. Not applying |
trishume
added a commit
that referenced
this issue
Sep 5, 2017
2 tasks
trishume
added a commit
that referenced
this issue
Sep 5, 2017
Improve with_prototype to better match Sublime. Fixes #101
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've finally had chance to investigate #59 a little bit, and found something interesting.
Let's say we have a file
testdata/Packages/ASP/HTML-ASP2.sublime-syntax
with the following contents (it's basically a cut down version of the full HTML-ASP syntax, that doesn't reference ASP itself and can serve as a(n almost minimal) complete verifiable example):and the following corresponding syntax test (
testdata/Packages/ASP/syntax_test_asp2.asp2
):and execute
syntest
withRUST_BACKTRACE=1 cargo run --example syntest testdata/Packages/ASP/syntax_test_asp2.asp2 testdata/Packages/
The output is:
but in ST, if we look at the scopes, we see the
![image](https://user-images.githubusercontent.com/11882719/30061114-ca078aac-924e-11e7-8d20-64ff4cd8a35d.png)
<%
which had a failure in syntect has no special scopes applied to it.so we can conclude that the
with_prototype
is being applied in syntect to thebegin_embedded_asp
context, but isn't in ST. I suspect there is a general rule that thewith_prototype
shouldn't apply to nested contexts pushed by matches made in itself, if that makes sense.i.e. estimated rough sequence of events:
html
context is pushed onto the stack, with theasp_punctuation_begin
context in thewith_prototype
<%
match pattern from that context is hit, and it pushes a new anonymous context - this context should no longer have theasp_punctuation_begin
with_prototype
applied to itbegin_embedded_asp
context replaces the anonymous context at the top of the stackwith_prototype
, the<%
afterexample
gets matched unexpectedly/incorrectly and scoped.The text was updated successfully, but these errors were encountered: