Skip to content

fix(scanner): windows compiled header#36

Merged
davem-intersys merged 3 commits intointersystems:mainfrom
hkimura-intersys:scanner-fix
Apr 14, 2026
Merged

fix(scanner): windows compiled header#36
davem-intersys merged 3 commits intointersystems:mainfrom
hkimura-intersys:scanner-fix

Conversation

@hkimura-intersys
Copy link
Copy Markdown
Collaborator

@hkimura-intersys hkimura-intersys commented Apr 13, 2026

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:
image
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:
image

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

^MAC^Save for Source Control^^~Format=IRIS.S~^UTF8

But, it seems like on Windows, there is also some compiled headers that start with:

IRIS for Windows^INT^^~Format=IRIS.S~^RAW

The previous scanner logic would categorize IRIS as a tag, and lead to a bunch of errors, as shown below:
image

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

@hkimura-intersys hkimura-intersys self-assigned this Apr 13, 2026
@hkimura-intersys hkimura-intersys marked this pull request as draft April 13, 2026 23:51
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.
@hkimura-intersys hkimura-intersys marked this pull request as ready for review April 14, 2026 01:46
@davem-intersys
Copy link
Copy Markdown
Contributor

Ah, yes IRIS for Windows^INT^^~Format=IRIS.S~^RAW looks like the first ^ part is from $PIECE($ZV, " (") of the system that exported the file.

@davem-intersys davem-intersys merged commit 58450fe into intersystems:main Apr 14, 2026
11 checks passed
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.

2 participants