Skip to content
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

syntax: properly configure syntax regions #92

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

l-zeuch
Copy link
Owner

@l-zeuch l-zeuch commented Oct 31, 2024

Please describe the changes this pull request does and why it should be merged:

Specifically the yagStr region exhibits some odd behaviour (even more so in
conjunction with jo3-l/yag-template-lsp) in which a newline-terminated
double-quoted string extends its match region to EOF, when it should be EOL.

Fix this problem by setting the keepend attribute on yagExpr, which
disallows contained regions to go past their respective end pattern. This
fixes the funky behaviour of yagStr, whilst having its respective tests still
pass-

As a side-effect, we have to set yagNestedBrace to extend, such that the
second nested pair }} is highlighted as an error as well. For similar reasons,
we must do the same for yagRawStr, as it could theoretically contain legally
nested braces within the raw string, as exhibited by one of the test cases.
Without these secondary changes, tests are failing.

Signed-off-by: Luca Zeuch [email protected]

Terms

Specifically the `yagStr` region exhibits some odd behaviour (even more so in
conjunction with jo3-l/yag-template-lsp) in which a newline-terminated
double-quoted string extends its match region to EOF, when it should be EOL.

Fix this problem by setting the `keepend` attribute on `yagExpr`, which
disallows contained regions to go past their respective `end` pattern. This
fixes the funky behaviour of `yagStr`, whilst having its respective tests still
pass-

As a side-effect, we have to set `yagNestedBrace` to `extend`, such that the
second nested pair `}}` is highlighted as an error as well. For similar reasons,
we must do the same for `yagRawStr`, as it could theoretically contain legally
nested braces within the raw string, as exhibited by one of the test cases.
Without these secondary changes, tests are failing.

Signed-off-by: Luca Zeuch <[email protected]>
@l-zeuch l-zeuch requested a review from LRitzdorf as a code owner October 31, 2024 13:02
@l-zeuch l-zeuch merged commit 898f482 into master Oct 31, 2024
29 checks passed
@l-zeuch l-zeuch deleted the fix/syntax/string-regions branch October 31, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant