fix(scanner): windows compiled header#36
Merged
davem-intersys merged 3 commits intointersystems:mainfrom Apr 14, 2026
Merged
Conversation
Before, the dots in the dotted statements were being consumed by the scanner. Additionally, only a single statement of each dotted statement was being parsed as part of the dotted statement. This led to incorrect highlighting, even though it doesn't actually produce any error nodes. This was fixed by making sure the scanner never consumes the dots, and by requiring at least one dot in the grammar. Additionally, the logic was updated to allow repeat1($.statement) with prec.right, so that all statements within the dotted statement (so statements on that line) were parsed as part of it.
Contributor
|
Ah, yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR (v1.7.7) updates when a column 1 word should be marked as a tag vs a compiled header. (see scanner update below). Additionally, the scanner/grammar was updated to fix how dotted statements were parsed. Before, there were two main issues. The scanner was consuming the dots, making precise highlighting difficult, and the dotted statement only allowed one statement, so it would end after that statement, even though it should be the entire line that the dot was a part of.
Dotted Statement Fix
This is an example of the issues that came with the previous logic for dotted statements:

As shown in the picture, in order to highlight those dots, you have to capture the entire dotted_statement node, which doesn't allow for precise coloring of the dots.
With the update, the dots are not eaten by the scanner, and they are now required by the grammar. Additionally, all statements of the dotted statement are included within it now, so all dotted statements are recognized as expected. With that change, you can precisely query just the dots:

Note: The pictures of the highlighting with these two examples was for the purpose of demonstrating the dotted statements fix, which is why no other queries were included. The regular highlighting doesn't look like this (it has many more captures).
Scanner Update
Previously, all compiled headers tested started with the format of
But, it seems like on Windows, there is also some compiled headers that start with:
The previous scanner logic would categorize IRIS as a tag, and lead to a bunch of errors, as shown below:

This PR now categorizes that as a compiled header, and parses as expected:
