mirror of
https://github.com/elladunbar/tree-sitter-zanscript.git
synced 2025-11-05 15:19:55 -06:00
Fix builtin function name highlighting
This commit is contained in:
parent
073ab245c7
commit
1a002fb23b
5 changed files with 2243 additions and 5369 deletions
29
grammar.js
29
grammar.js
|
|
@ -8,6 +8,8 @@ module.exports = grammar({
|
|||
/\s/
|
||||
],
|
||||
|
||||
word: $ => $.identifier,
|
||||
|
||||
rules: {
|
||||
translation_unit: $ => repeat($._top_level_item),
|
||||
|
||||
|
|
@ -128,10 +130,10 @@ module.exports = grammar({
|
|||
$.function,
|
||||
$.assignment,
|
||||
$.comment,
|
||||
),
|
||||
),
|
||||
|
||||
function: $ => seq(
|
||||
$.identifier,
|
||||
field("name", $.identifier),
|
||||
'(',
|
||||
optional(
|
||||
repeat(
|
||||
|
|
@ -146,7 +148,7 @@ module.exports = grammar({
|
|||
),
|
||||
')',
|
||||
),
|
||||
|
||||
|
||||
_argument: $ => choice(
|
||||
$.identifier,
|
||||
$.number,
|
||||
|
|
@ -181,7 +183,7 @@ module.exports = grammar({
|
|||
'#',
|
||||
/.*/,
|
||||
),
|
||||
|
||||
|
||||
variable: $ => /@[a-zA-Z0-9_]+/,
|
||||
|
||||
match: $ => /[a-zA-Z0-9_.]+/,
|
||||
|
|
@ -191,5 +193,24 @@ module.exports = grammar({
|
|||
number: $ => /\d+(\.\d+)?/,
|
||||
|
||||
string: $ => /['"].*['"]/,
|
||||
|
||||
//builtin: $ => choice(
|
||||
// "AUTOREFERENCE",
|
||||
// "FEEDER",
|
||||
// "LIGHTS",
|
||||
// "LOAD",
|
||||
// "LOG",
|
||||
// "LOGAPPEND",
|
||||
// "LOGCREATE",
|
||||
// "LOGDATA",
|
||||
// "LOGFIELD",
|
||||
// "LOGRUN",
|
||||
// "PANLIGHT",
|
||||
// "PICTURE",
|
||||
// "SET",
|
||||
// "SETCOLOUR",
|
||||
// "SETLIGHT",
|
||||
//
|
||||
//)
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue