Skip to content

fix(udl): accept SqlSchemaName as a class keyword - #65

Open
isc-tdyar wants to merge 2 commits into
intersystems:mainfrom
isc-tdyar:fix/udl-class-keyword-sqlschemaname
Open

isc-tdyar wants to merge 2 commits into
intersystems:mainfrom
isc-tdyar:fix/udl-class-keyword-sqlschemaname

Conversation

@isc-tdyar

Copy link
Copy Markdown
Member

SqlSchemaName is a class keyword in IRIS, but _class_sql_name_keyword only accepts SqlRowIdName and SqlTableName. A class that sets it fails to parse:

Class Demo.A [ SqlSchemaName = Demo_Sql ]
{
}

On v2.0.0 this gives an ERROR node on the first line, alone or in a list such as [ Abstract, SqlSchemaName = Demo_Sql ]. The SqlTableName and SqlRowIdName forms parse fine.

This adds SqlSchemaName to the same rule, so it takes the same values and produces the same query_name node as its two neighbours.

  • Four corpus cases in udl and objectscript: simple, with an underscore, inside a keyword list, and mixed case.
  • tree-sitter test passes in all five grammars.
  • Generated files come from tree-sitter-cli 0.27.2. Regenerating udl and objectscript with it before this change reproduces the committed files exactly.
  • The commit is signed.

SqlSchemaName is a class keyword in IRIS, but _class_sql_name_keyword only
listed SqlRowIdName and SqlTableName, so a class that set it produced an
ERROR node on its first line.

Add it to the same rule so it takes the same values and yields the same
query_name node as its two neighbours. Four corpus cases in udl and
objectscript: simple, underscore, inside a keyword list, mixed case.

Generated files come from tree-sitter-cli 0.27.2, which reproduces the
committed files exactly before this change.
@hkimura-intersys

Copy link
Copy Markdown
Member

thanks! @isc-tdyar this PR looks good to merge, but the version just needs to be bumped so the change can be published. Could you bump the version to 2.0.1 and then rebuild the grammars? It just needs to be updated in these spots:
image
and all grammars should be rebuilt since the version is getting bumped.

Bump the version in CMakeLists.txt, the Cargo manifests, common.mak, package.json, package-lock.json, pyproject.toml and tree-sitter.json, and regenerate all five grammars.
@isc-tdyar

Copy link
Copy Markdown
Member Author

Thanks, Hannah. I bumped the version to 2.0.1 in CMakeLists.txt, the three Cargo.toml files, common/common.mak, package.json, pyproject.toml and tree-sitter.json, plus package-lock.json to match package.json, and rebuilt all five grammars (cc2265e). The only change in each parser.c is .patch_version. tree-sitter test passes in all five and the PR's checks are green. If I missed a spot, tell me and I'll add it.

This branch has not been deployed

No deployments
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