fix: point to objectscript_udl grammar

This commit is contained in:
Hannah 2026-03-10 11:20:30 -04:00
parent 16f3f98e45
commit 174a0f39e3
No known key found for this signature in database
GPG key ID: 0C1C205F4C354DE1
7 changed files with 129 additions and 95 deletions

View file

@ -195,7 +195,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka
[nu](https://github.com/nushell/tree-sitter-nu) | unstable | `HFIJ ` | @abhisheksingh0x558 [nu](https://github.com/nushell/tree-sitter-nu) | unstable | `HFIJ ` | @abhisheksingh0x558
[objc](https://github.com/tree-sitter-grammars/tree-sitter-objc) | unstable | `HFIJL` | @amaanq [objc](https://github.com/tree-sitter-grammars/tree-sitter-objc) | unstable | `HFIJL` | @amaanq
[objdump](https://github.com/ColinKennedy/tree-sitter-objdump) | unstable | `H  J ` | @ColinKennedy [objdump](https://github.com/ColinKennedy/tree-sitter-objdump) | unstable | `H  J ` | @ColinKennedy
[objectscript](https://github.com/intersystems/tree-sitter-objectscript) | unstable | `H IJ ` | @davem-intersys, @hkimura-intersys [objectscript_udl](https://github.com/intersystems/tree-sitter-objectscript) | unstable | `H IJ ` | @davem-intersys, @hkimura-intersys
[ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) | unstable | `HFIJL` | @undu [ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) | unstable | `HFIJL` | @undu
[ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) | unstable | `HFIJL` | @undu [ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) | unstable | `HFIJL` | @undu
[ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) | unstable | `H  J ` | @undu [ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) | unstable | `H  J ` | @undu

View file

@ -1498,7 +1498,7 @@ return {
maintainers = { '@ColinKennedy' }, maintainers = { '@ColinKennedy' },
tier = 2, tier = 2,
}, },
objectscript = { objectscript_udl = {
install_info = { install_info = {
location = 'udl', location = 'udl',
revision = 'e03cd14c61bda43a135b23352f7fb695c2e9567f', revision = 'e03cd14c61bda43a135b23352f7fb695c2e9567f',
@ -1506,7 +1506,7 @@ return {
}, },
maintainers = { '@davem-intersys', '@hkimura-intersys' }, maintainers = { '@davem-intersys', '@hkimura-intersys' },
tier = 2, tier = 2,
} },
ocaml = { ocaml = {
install_info = { install_info = {
location = 'grammars/ocaml', location = 'grammars/ocaml',

View file

@ -32,6 +32,7 @@ local filetypes = {
make = { 'automake' }, make = { 'automake' },
markdown = { 'pandoc' }, markdown = { 'pandoc' },
muttrc = { 'neomuttrc' }, muttrc = { 'neomuttrc' },
objectscript_udl = { 'objectscript' },
ocaml_interface = { 'ocamlinterface' }, ocaml_interface = { 'ocamlinterface' },
perl = { 'pl' }, perl = { 'pl' },
poe_filter = { 'poefilter' }, poe_filter = { 'poefilter' },

View file

@ -1,2 +0,0 @@
("{" @indents.begin)
("}" @indents.end)

View file

@ -1,29 +1,47 @@
(pattern_expression) @string.regex (pattern_expression) @string.regexp
(numeric_literal) @number (numeric_literal) @number
(string_literal) @string (string_literal) @string
(keyword_pound_pound_class) @keyword (keyword_pound_pound_class) @keyword
(keyword_pound_pound_super) @keyword (keyword_pound_pound_super) @keyword
(system_defined_variable) @variable.special
(system_defined_function) @variable.special (system_defined_variable) @variable.builtin
(sql_field_modifier) @variable.special
(system_defined_function) @variable.builtin
(sql_field_modifier) @variable.builtin
(property_name) @property (property_name) @property
(method_name) @function (method_name) @function
(parameter_name) @property (parameter_name) @property
(class_name) @type (class_name) @type
(macro) @constant (macro) @constant
(routine_ref) @variable (routine_ref) @variable
(sql_field_identifier) @variable (sql_field_identifier) @variable
(lvn) @variable (lvn) @variable
(gvn) @variable (gvn) @variable
(ssvn) @variable (ssvn) @variable
(instance_variable) @variable (instance_variable) @variable
(objectscript_identifier) @variable (objectscript_identifier) @variable
(method_arg) @variable.parameter (method_arg) @variable.parameter
; I didn't include '(' or ')' in this, because they are often grouped
; as part of a sequence that gets turned into a single token, so they ; I didn't include '(' or ')' in this, because they are often grouped
; as part of a sequence that gets turned into a single token, so they
; don't get matched, and one ends up getting colored differently than the other. ; don't get matched, and one ends up getting colored differently than the other.
[ [
"_" "_"
@ -47,8 +65,6 @@
"#" "#"
"|" "|"
"||" "||"
"/"
"/"
"$$" "$$"
"--" "--"
";" ";"
@ -56,7 +72,7 @@
"#;" "#;"
"##;" "##;"
"$" "$"
] @punctuation ] @punctuation.delimiter
[ [
"'&" "'&"
@ -85,26 +101,39 @@
] @operator ] @operator
(json_string_literal) @string (json_string_literal) @string
(json_boolean_literal) @boolean (json_boolean_literal) @boolean
(json_number_literal) @number (json_number_literal) @number
(json_null_literal) @string (json_null_literal) @string
(bracket) @punctuation.bracket (bracket) @punctuation.bracket
(locktype) @variable (locktype) @variable
(macro_arg) @variable (macro_arg) @variable
(macro_value) @constant.builtin (macro_value) @constant.builtin
keyword: (_) @keyword keyword: (_) @keyword
(embedded_js_special_case_complete) @punctuation.special (embedded_js_special_case_complete) @punctuation.special
(embedded_sql_marker) @punctuation.special (embedded_sql_marker) @punctuation.special
(embedded_sql_reverse_marker) @punctuation.special (embedded_sql_reverse_marker) @punctuation.special
(html_marker) @punctuation.special (html_marker) @punctuation.special
(html_marker_reversed) @punctuation.special (html_marker_reversed) @punctuation.special
(attribute) @attribute (attribute) @attribute
(open_keywords) @attribute (open_keywords) @attribute
(use_keywords) @attribute (use_keywords) @attribute
(close_parameter_option_value) @attribute (close_parameter_option_value) @attribute
; Cannot combine all of these into a supertype as for some reason, it messes up the scanner and doesn't match correctly. ; Cannot combine all of these into a supertype as for some reason, it messes up the scanner and doesn't match correctly.
@ -119,45 +148,57 @@ keyword: (_) @keyword
(tag) @tag (tag) @tag
; ------------------ UDL ------------------- ; ------------------ UDL -------------------
[ [
(method_keyword_codemode_expression) (method_keyword_codemode_expression)
(call_method_keyword) (call_method_keyword)
(method_keyword) (method_keyword)
(class_keywords) (class_keywords)
(query_keywords) (query_keywords)
(trigger_keyword) (trigger_keyword)
(method_keyword_language) (method_keyword_language)
(relationship_keyword) (relationship_keyword)
(foreignkey_keyword) (foreignkey_keyword)
(parameter_keyword) (parameter_keyword)
(projection_keyword) (projection_keyword)
(index_keyword) (index_keyword)
(index_keyword_extent) (index_keyword_extent)
(xdata_keyword) (xdata_keyword)
(xdata_keyword_mimetype) (xdata_keyword_mimetype)
(property_keyword) (property_keyword)
] @attribute ] @attribute
(documatic_line) @comment.doc (documatic_line) @comment.documentation
(query_name) @property (query_name) @property
(property_name) @property (property_name) @property
(relationship_name) @property (relationship_name) @property
(foreignkey_name) @property (foreignkey_name) @property
(parameter_name) @property (parameter_name) @property
(projection_name) @property (projection_name) @property
(index_name) @property (index_name) @property
(xdata_name) @property (xdata_name) @property
(storage_name) @property (storage_name) @property
(return_type) @type.builtin (return_type) @type.builtin
(typename) @type (typename) @type
(parameter_type) @type.builtin (parameter_type) @type.builtin
(index_type) @type.builtin (index_type) @type.builtin
(projection_type) @type.builtin (projection_type) @type.builtin
(property_type) @type.builtin (property_type) @type.builtin
(index_property_type) @type.builtin (index_property_type) @type.builtin
(identifier) @variable (identifier) @variable

View file

@ -0,0 +1,3 @@
"{" @indent.begin
"}" @indent.end

View file

@ -1,28 +1,23 @@
; Core grammar injections ; Core grammar injections
(embedded_html (embedded_html
(angled_bracket_fenced_text) @injection.content (angled_bracket_fenced_text) @injection.content
(#set! injection.language "html") (#set! injection.language "html"))
)
(embedded_sql (embedded_sql
(_ (_
(paren_fenced_text) @injection.content (paren_fenced_text) @injection.content)
) (#set! injection.language "sql"))
(#set! injection.language "sql")
)
(embedded_js (embedded_js
[ [
(angled_bracket_fenced_text) (angled_bracket_fenced_text)
(embedded_js_special_case) (embedded_js_special_case)
] @injection.content ] @injection.content
(#set! injection.language "javascript")) (#set! injection.language "javascript"))
(embedded_xml (embedded_xml
(angled_bracket_fenced_text) @injection.content (angled_bracket_fenced_text) @injection.content
(#set! injection.language "xml") (#set! injection.language "xml"))
)
([ ([
(line_comment_1) (line_comment_1)
@ -32,65 +27,57 @@
] @injection.content ] @injection.content
(#set! injection.language "comment")) (#set! injection.language "comment"))
; UDL grammar injections ; UDL grammar injections
;; Keywords, one of type language = "python", none of type codemode ; Keywords, one of type language = "python", none of type codemode
; External method body injection based on [ Language = ... ] ; External method body injection based on [ Language = ... ]
(method_definition (method_definition
(external_method_keywords (external_method_keywords
(method_keyword_language (method_keyword_language
(rhs) @lang)) (rhs) @_lang))
(external_method_body_content) @injection.content (external_method_body_content) @injection.content
(#set! injection.include-children) (#set! injection.include-children)
(#match? @lang "^[Pp][Yy][Tt][Hh][Oo][Nn]$") (#match? @_lang "^[Pp][Yy][Tt][Hh][Oo][Nn]$")
(#set! injection.language "python")) (#set! injection.language "python"))
(method_definition (method_definition
(external_method_keywords (external_method_keywords
(method_keyword_language (method_keyword_language
(rhs) @lang)) (rhs) @_lang))
(external_method_body_content) @injection.content (external_method_body_content) @injection.content
(#set! injection.include-children) (#set! injection.include-children)
(#match? @lang "^[Tt][Ss][Qq][Ll]$") (#match? @_lang "^[Tt][Ss][Qq][Ll]$")
(#set! injection.language "tsql")) (#set! injection.language "tsql"))
(method_definition (method_definition
(external_method_keywords (external_method_keywords
(method_keyword_language (method_keyword_language
(rhs) @lang)) (rhs) @_lang))
(external_method_body_content) @injection.content (external_method_body_content) @injection.content
(#set! injection.include-children) (#set! injection.include-children)
(#match? @lang "^[Ii][Ss][Pp][Ll]$") (#match? @_lang "^[Ii][Ss][Pp][Ll]$")
(#set! injection.language "ispl")) (#set! injection.language "ispl"))
; External trigger with python body
((trigger
;; External trigger with python body (external_trigger
( (trigger_keywords
(trigger (method_keyword_language
(external_trigger (rhs) @_lang))
(trigger_keywords (external_method_body_content) @injection.content))
(method_keyword_language
(rhs) @lang))
(external_method_body_content) @injection.content))
(#set! injection.include-children) (#set! injection.include-children)
(#match? @lang "^[Pp][Yy][Tt][Hh][Oo][Nn]$") (#match? @_lang "^[Pp][Yy][Tt][Hh][Oo][Nn]$")
(#set! injection.language "python") (#set! injection.language "python"))
)
;; External trigger with TSQL body ; External trigger with TSQL body
( ((trigger
(trigger (external_trigger
(external_trigger (trigger_keywords
(trigger_keywords (method_keyword_language
(method_keyword_language (rhs) @_lang))
(rhs) @lang)) (external_method_body_content) @injection.content))
(external_method_body_content) @injection.content))
(#set! injection.include-children) (#set! injection.include-children)
(#match? @lang "^[Tt][Ss][Qq][Ll]$") (#match? @_lang "^[Tt][Ss][Qq][Ll]$")
(#set! injection.language) (#set! injection.language "tsql"))
)
; A query must be of type %SQLQuery to have an SQL body, otherwise the body ; A query must be of type %SQLQuery to have an SQL body, otherwise the body
; is empty ; is empty
@ -102,75 +89,80 @@
(query_body (query_body
(query_body_content) @injection.content) (query_body_content) @injection.content)
(#set! injection.language "sql") (#set! injection.language "sql")
(#set! injection.include-children) (#set! injection.include-children))
)
; XDATA blocks: ; XDATA blocks:
; - xdata_any requires a keyword list that includes MimeType ; - xdata_any requires a keyword list that includes MimeType
; - xdata_xml allows an optional keyword list and defaults to XML ; - xdata_xml allows an optional keyword list and defaults to XML
; ---------------------------- ; ----------------------------
; XDATA injections (MimeType) ; XDATA injections (MimeType)
; ---------------------------- ; ----------------------------
; text/markdown ; text/markdown
(xdata (xdata
(xdata_any (xdata_any
(xdata_keywords (xdata_keywords
(xdata_keyword_mimetype (rhs) @mt)) (xdata_keyword_mimetype
(rhs) @_mt))
(external_method_body_content) @injection.content) (external_method_body_content) @injection.content)
(#set! injection.include-children) (#set! injection.include-children)
(#match? @mt "^\"?text/markdown\"?$") (#match? @_mt "^\"?text/markdown\"?$")
(#set! injection.language "markdown")) (#set! injection.language "markdown"))
; XML MimeTypes ; XML MimeTypes
(xdata (xdata
(xdata_any (xdata_any
(xdata_keywords (xdata_keywords
(xdata_keyword_mimetype (rhs) @mt)) (xdata_keyword_mimetype
(rhs) @_mt))
(external_method_body_content) @injection.content) (external_method_body_content) @injection.content)
(#set! injection.include-children) (#set! injection.include-children)
(#match? @mt "^\"?([Tt][Ee][Xx][Tt]|[Aa][Pp][Pp][Ll][Ii][Cc][Aa][Tt][Ii][Oo][Nn])/[Xx][Mm][Ll]\"?$") (#match? @_mt
"^\"?([Tt][Ee][Xx][Tt]|[Aa][Pp][Pp][Ll][Ii][Cc][Aa][Tt][Ii][Oo][Nn])/[Xx][Mm][Ll]\"?$")
(#set! injection.language "xml")) (#set! injection.language "xml"))
; text/html ; text/html
(xdata (xdata
(xdata_any (xdata_any
(xdata_keywords (xdata_keywords
(xdata_keyword_mimetype (rhs) @mt)) (xdata_keyword_mimetype
(rhs) @_mt))
(external_method_body_content) @injection.content) (external_method_body_content) @injection.content)
(#set! injection.include-children) (#set! injection.include-children)
(#match? @mt "^\"?text/html\"?$") (#match? @_mt "^\"?text/html\"?$")
(#set! injection.language "html")) (#set! injection.language "html"))
; application/json ; application/json
(xdata (xdata
(xdata_any (xdata_any
(xdata_keywords (xdata_keywords
(xdata_keyword_mimetype (rhs) @mt)) (xdata_keyword_mimetype
(rhs) @_mt))
(external_method_body_content) @injection.content) (external_method_body_content) @injection.content)
(#set! injection.include-children) (#set! injection.include-children)
(#match? @mt "^\"?application/json\"?$") (#match? @_mt "^\"?application/json\"?$")
(#set! injection.language "json")) (#set! injection.language "json"))
; text/yaml or application/yaml ; text/yaml or application/yaml
(xdata (xdata
(xdata_any (xdata_any
(xdata_keywords (xdata_keywords
(xdata_keyword_mimetype (rhs) @mt)) (xdata_keyword_mimetype
(rhs) @_mt))
(external_method_body_content) @injection.content) (external_method_body_content) @injection.content)
(#set! injection.include-children) (#set! injection.include-children)
(#match? @mt "^\"?([Tt][Ee][Xx][Tt]|[Aa][Pp][Pp][Ll][Ii][Cc][Aa][Tt][Ii][Oo][Nn])/[Yy][Aa][Mm][Ll]\"?$") (#match? @_mt
"^\"?([Tt][Ee][Xx][Tt]|[Aa][Pp][Pp][Ll][Ii][Cc][Aa][Tt][Ii][Oo][Nn])/[Yy][Aa][Mm][Ll]\"?$")
(#set! injection.language "yaml")) (#set! injection.language "yaml"))
; text/css ; text/css
(xdata (xdata
(xdata_any (xdata_any
(xdata_keywords (xdata_keywords
(xdata_keyword_mimetype (rhs) @mt)) (xdata_keyword_mimetype
(rhs) @_mt))
(external_method_body_content) @injection.content) (external_method_body_content) @injection.content)
(#set! injection.include-children) (#set! injection.include-children)
(#match? @mt "^\"?text/css\"?$") (#match? @_mt "^\"?text/css\"?$")
(#set! injection.language "css")) (#set! injection.language "css"))
; ----------------------------------------- ; -----------------------------------------
@ -183,7 +175,6 @@
(#set! injection.include-children) (#set! injection.include-children)
(#set! injection.language "xml")) (#set! injection.language "xml"))
; Storage definition is XML ; Storage definition is XML
(storage (storage
(storage_body (storage_body