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',
|
||||||
'Action',
|
'Action',
|
||||||
),
|
),
|
||||||
$.identifier,
|
field('name', $.identifier),
|
||||||
$.block,
|
$.block,
|
||||||
choice(
|
choice(
|
||||||
'COMPLETE',
|
'COMPLETE',
|
||||||
|
|
@ -133,7 +133,7 @@ module.exports = grammar({
|
||||||
),
|
),
|
||||||
|
|
||||||
function: $ => seq(
|
function: $ => seq(
|
||||||
field("name", $.identifier),
|
field('name', $.identifier),
|
||||||
'(',
|
'(',
|
||||||
optional(
|
optional(
|
||||||
repeat(
|
repeat(
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,8 @@
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
(variable) @variable
|
(variable) @variable
|
||||||
(match) @constant.macro
|
(match) @constant.macro
|
||||||
(identifier) @constant.macro
|
(identifier) @constant
|
||||||
(number) @number
|
(number) @number
|
||||||
(string) @string
|
(string) @string
|
||||||
(function name: (identifier) @function)
|
(function name: (identifier) @function.call)
|
||||||
|
(action name: (identifier) @function)
|
||||||
|
|
|
||||||
8
src/grammar.json
generated
8
src/grammar.json
generated
|
|
@ -129,8 +129,12 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "FIELD",
|
||||||
"name": "identifier"
|
"name": "name",
|
||||||
|
"content": {
|
||||||
|
"type": "SYMBOL",
|
||||||
|
"name": "identifier"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
|
|
|
||||||
19
src/node-types.json
generated
19
src/node-types.json
generated
|
|
@ -2,18 +2,25 @@
|
||||||
{
|
{
|
||||||
"type": "action",
|
"type": "action",
|
||||||
"named": true,
|
"named": true,
|
||||||
"fields": {},
|
"fields": {
|
||||||
|
"name": {
|
||||||
|
"multiple": false,
|
||||||
|
"required": true,
|
||||||
|
"types": [
|
||||||
|
{
|
||||||
|
"type": "identifier",
|
||||||
|
"named": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"children": {
|
"children": {
|
||||||
"multiple": true,
|
"multiple": false,
|
||||||
"required": true,
|
"required": true,
|
||||||
"types": [
|
"types": [
|
||||||
{
|
{
|
||||||
"type": "block",
|
"type": "block",
|
||||||
"named": true
|
"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 EXTERNAL_TOKEN_COUNT 0
|
||||||
#define FIELD_COUNT 1
|
#define FIELD_COUNT 1
|
||||||
#define MAX_ALIAS_SEQUENCE_LENGTH 6
|
#define MAX_ALIAS_SEQUENCE_LENGTH 6
|
||||||
#define PRODUCTION_ID_COUNT 2
|
#define PRODUCTION_ID_COUNT 3
|
||||||
|
|
||||||
enum ts_symbol_identifiers {
|
enum ts_symbol_identifiers {
|
||||||
sym_identifier = 1,
|
sym_identifier = 1,
|
||||||
|
|
@ -513,11 +513,14 @@ static const char * const ts_field_names[] = {
|
||||||
|
|
||||||
static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = {
|
static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = {
|
||||||
[1] = {.index = 0, .length = 1},
|
[1] = {.index = 0, .length = 1},
|
||||||
|
[2] = {.index = 1, .length = 1},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const TSFieldMapEntry ts_field_map_entries[] = {
|
static const TSFieldMapEntry ts_field_map_entries[] = {
|
||||||
[0] =
|
[0] =
|
||||||
{field_name, 0},
|
{field_name, 0},
|
||||||
|
[1] =
|
||||||
|
{field_name, 1},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = {
|
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),
|
[114] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_loop, 4, 0, 0),
|
||||||
[116] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_branch, 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),
|
[118] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_branch, 4, 0, 0),
|
||||||
[120] = {.entry = {.count = 1, .reusable = false}}, 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, 0),
|
[122] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_action, 4, 0, 2),
|
||||||
[124] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function, 3, 0, 1),
|
[124] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function, 3, 0, 1),
|
||||||
[126] = {.entry = {.count = 1, .reusable = true}}, 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),
|
[128] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assignment, 3, 0, 0),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue