Skip to content

fix: Updates to UDL Grammar and Python Package - #60

Merged
hkimura-intersys merged 5 commits into
intersystems:mainfrom
hkimura-intersys:v1.9.21-updates
Sep 30, 2026
Merged

hkimura-intersys merged 5 commits into
intersystems:mainfrom
hkimura-intersys:v1.9.21-updates

Conversation

@hkimura-intersys

Copy link
Copy Markdown
Member

This PR includes many updates to the UDL grammar that were done to define class members consistently. For examples, before some class members had their keywords outer node hidden, while others didn't. Now, none are hidden. The following were changed:

Breaking Grammar Changes

_method_keywords -> method_keywords
_expression_method_keywords-> expression_method_keywords
_external_method_keywords ->external_method_keywords
_call_method_keywords -> call_method_keywords
_query_keywords ->query_keywords
_trigger_keywords / _external_trigger_keywords -> trigger_keywords / external_trigger_keywords
_xdata_keywords -> xdata_keywords
method_keyword_external_language -> keyword_external_language
_index_property_value / _index_type-> index_property_value / index_type
column_name (in indices) |property_name

The highlights.scm and injections.scm queries in udl, objectscript and the
bindings are updated to match.

Other Grammar Changes

  • ##safeexpression: now parsed like ##expression and aliased to
    keyword_pound_expression (expr/grammar.js).
  • Language = basic: accepted as an external method/trigger language.
  • Relationship keywords: relationships now accept any property keyword as
    well as Cardinality, Inverse and OnDelete. This replaces the hard-coded
    required|readonly|InitialExpression list.
  • Index (ELEMENTS) / (KEYS): no longer wrapped in token().

Scanner fix: embedded SQL mistaken for XML

lex_fenced_text in common/scanner.h used to skip leading alphanumerics along
with whitespace before checking for <. So in something like

&sql(DELETE FROM Alert WHERE AlertTime < :Time)

it reached the <, treated the body as XML, and produced a bad parse. Now only
whitespace is skipped before the < check. A corpus test for this case was added
in core/test/corpus/embedded-sql.txt.

Injections

I added new injection queries to match java, javascript, and sql.

  • XData default (XML) injection comes last, and only applies when the XData
    header has no MimeType =.
  • New XData MIME types: text/javascript → javascript, application/sql → sql,
    text/x-java-source → java.

Packaging

  • Version bumped to 1.10.0 in package.json, pyproject.toml, Cargo.toml,
    CMakeLists.txt, tree-sitter.json and common.mak.
  • Added @PYDuquesnoy fix: The Python core extra now requires tree-sitter>=0.25, since the parsers are
    generated at ABI 15. A binding test checks this.

@hkimura-intersys
hkimura-intersys merged commit 421197a into intersystems:main Sep 30, 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.

1 participant