Skip to content

fix(core, expr grammars): fix reported bugs#44

Draft
hkimura-intersys wants to merge 3 commits into
intersystems:mainfrom
hkimura-intersys:v1.9.0-fix
Draft

fix(core, expr grammars): fix reported bugs#44
hkimura-intersys wants to merge 3 commits into
intersystems:mainfrom
hkimura-intersys:v1.9.0-fix

Conversation

@hkimura-intersys

@hkimura-intersys hkimura-intersys commented Jun 4, 2026

Copy link
Copy Markdown
Member

Overview

This PR fixes 4 bugs that were found by Keith @isc-kcressma

Fixes Explained

Instance variable s%

s stands for stands for shadow modified bit for the property, and is valid, so this is now allowed in instance variables.

gvn namespace

fixed gvn to allow namespace to be arbitary expression(s). This makes it so valid namespaces such as Set x = ^|"^^" _ $zu(12)|globalname are parsed correctly.

Relative dot expressions

Removed the requirement for .. in relative functions to be immediate, as the only actual requirement is that the name comes immediately after the dots. This makes it so things like

Return $CASE(x,
        ..#MyParameter:"Hello",
        5:"Goodbye"
    )

are correctly parsed now.

Locktypes

In core grammar, allowed relative dot expressions to be locktypes, so valid statements like Lock +x#..MyFunction() worked as expected.

Scanner Fix

Even once the relative dot expressions was fixed, something like
image

failed to parse from the objectscript_routine parser. The issue was since the newline of the multiline expression started with .., the scanner registered it as bol_extra incorrectly. This is now fixed such that if it isn't looking for a specific token, the scanner won't eat those dots incorrectly. This test was added to the core and objectscript_routine test corpus.

Highlighting Changes

Updated highlighting in udl such that method keyword is grouped with other class fields and class keyword is unique.

Testing

First, all test cases pass here. (see workflow).
Additionally, I tested this on all .rtn and .mac files from //projects/sql/databases/sys/rtn/routine/ and //projects/sql/databases/sys/rtn/sql/. This tests are not included in this repo, as they are not open source. But, this was done as part of my local testing.

I also added test cases for each of these scenarios, all now passing.

In expr grammar, fixed gvn to allow namespace to be arbitary expression(s). Additionally, allowed s in instance variable, as that stands for shadow modified bit for the property.
Also, removed the requirement for .. in relative functions to be immediate, as the only
actual requirement is that the name comes immediately after the dots. This makes it
so things like Return $CASE(x,
        ..#MyParameter:"Hello",
        5:"Goodbye"
    )

are correctly parsed now.

In core grammar, allowed relative dot functions to be locktypes, so valid statements like
Lock +x#..MyFunction() worked as expected.

Updated highlighting in udl such that method keyword is grouped with other class fields and class keyword is unique.
@hkimura-intersys hkimura-intersys self-assigned this Jun 4, 2026
the scanner was incorrectly eating the . as bol_extra if it was
the first thing in a newline of a multiline expression. So,  Return $CASE(x,
        ..#MyParameter:"Hello",
        5:"Goodbye"
    )
was failing. This is now fixed
@hkimura-intersys hkimura-intersys marked this pull request as draft June 5, 2026 19:14
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