mirror of
https://github.com/elladunbar/tree-sitter-zanscript.git
synced 2025-11-05 23:29:54 -06:00
Update builtin function highlighting
This commit is contained in:
parent
c699ee5fb4
commit
eec8ac1dab
5 changed files with 30 additions and 15 deletions
|
|
@ -54,7 +54,7 @@ module.exports = grammar({
|
|||
'action',
|
||||
'Action',
|
||||
),
|
||||
$.identifier,
|
||||
field('name', $.identifier),
|
||||
$.block,
|
||||
choice(
|
||||
'COMPLETE',
|
||||
|
|
@ -133,7 +133,7 @@ module.exports = grammar({
|
|||
),
|
||||
|
||||
function: $ => seq(
|
||||
field("name", $.identifier),
|
||||
field('name', $.identifier),
|
||||
'(',
|
||||
optional(
|
||||
repeat(
|
||||
|
|
|
|||
|
|
@ -62,7 +62,8 @@
|
|||
(comment) @comment
|
||||
(variable) @variable
|
||||
(match) @constant.macro
|
||||
(identifier) @constant.macro
|
||||
(identifier) @constant
|
||||
(number) @number
|
||||
(string) @string
|
||||
(function name: (identifier) @function)
|
||||
(function name: (identifier) @function.call)
|
||||
(action name: (identifier) @function)
|
||||
|
|
|
|||
4
src/grammar.json
generated
4
src/grammar.json
generated
|
|
@ -129,8 +129,12 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "name",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
|
|
|
|||
19
src/node-types.json
generated
19
src/node-types.json
generated
|
|
@ -2,18 +2,25 @@
|
|||
{
|
||||
"type": "action",
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"fields": {
|
||||
"name": {
|
||||
"multiple": false,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "identifier",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"children": {
|
||||
"multiple": true,
|
||||
"multiple": false,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "block",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "identifier",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
9
src/parser.c
generated
9
src/parser.c
generated
|
|
@ -13,7 +13,7 @@
|
|||
#define EXTERNAL_TOKEN_COUNT 0
|
||||
#define FIELD_COUNT 1
|
||||
#define MAX_ALIAS_SEQUENCE_LENGTH 6
|
||||
#define PRODUCTION_ID_COUNT 2
|
||||
#define PRODUCTION_ID_COUNT 3
|
||||
|
||||
enum ts_symbol_identifiers {
|
||||
sym_identifier = 1,
|
||||
|
|
@ -513,11 +513,14 @@ static const char * const ts_field_names[] = {
|
|||
|
||||
static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = {
|
||||
[1] = {.index = 0, .length = 1},
|
||||
[2] = {.index = 1, .length = 1},
|
||||
};
|
||||
|
||||
static const TSFieldMapEntry ts_field_map_entries[] = {
|
||||
[0] =
|
||||
{field_name, 0},
|
||||
[1] =
|
||||
{field_name, 1},
|
||||
};
|
||||
|
||||
static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = {
|
||||
|
|
@ -2961,8 +2964,8 @@ static const TSParseActionEntry ts_parse_actions[] = {
|
|||
[114] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_loop, 4, 0, 0),
|
||||
[116] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_branch, 4, 0, 0),
|
||||
[118] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_branch, 4, 0, 0),
|
||||
[120] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_action, 4, 0, 0),
|
||||
[122] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_action, 4, 0, 0),
|
||||
[120] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_action, 4, 0, 2),
|
||||
[122] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_action, 4, 0, 2),
|
||||
[124] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function, 3, 0, 1),
|
||||
[126] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function, 3, 0, 1),
|
||||
[128] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assignment, 3, 0, 0),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue