Update builtin function highlighting

This commit is contained in:
Ella Dunbar 2025-10-18 16:58:19 -05:00
parent 1a002fb23b
commit ba71fbc84b
5 changed files with 30 additions and 15 deletions

View file

@ -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(

View file

@ -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
View file

@ -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
View file

@ -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
View file

@ -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),