Add ':=' to 'operator'
This commit is contained in:
parent
82bbebeeb5
commit
0b17386cad
|
@ -193,7 +193,7 @@ module.exports = grammar({
|
|||
PREC.assign,
|
||||
seq(
|
||||
field("left", $._lvalue),
|
||||
":=",
|
||||
alias(":=", $.operator),
|
||||
field("right", $._expr),
|
||||
),
|
||||
),
|
||||
|
@ -223,7 +223,7 @@ module.exports = grammar({
|
|||
for_expression: ($) => seq(
|
||||
"for",
|
||||
field("index", $.identifier),
|
||||
":=",
|
||||
alias(":=", $.operator),
|
||||
field("start", $._expr),
|
||||
"to",
|
||||
field("end", $._expr),
|
||||
|
@ -325,7 +325,7 @@ module.exports = grammar({
|
|||
"var",
|
||||
field("name", $.identifier),
|
||||
optional(seq(":", field("type", $._type_identifier))),
|
||||
":=",
|
||||
alias(":=", $.operator),
|
||||
field("value", $._expr),
|
||||
),
|
||||
|
||||
|
|
|
@ -822,9 +822,14 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"type": "ALIAS",
|
||||
"content": {
|
||||
"type": "STRING",
|
||||
"value": ":="
|
||||
},
|
||||
"named": true,
|
||||
"value": "operator"
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "right",
|
||||
|
@ -939,9 +944,14 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"type": "ALIAS",
|
||||
"content": {
|
||||
"type": "STRING",
|
||||
"value": ":="
|
||||
},
|
||||
"named": true,
|
||||
"value": "operator"
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "start",
|
||||
|
@ -1469,9 +1479,14 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"type": "ALIAS",
|
||||
"content": {
|
||||
"type": "STRING",
|
||||
"value": ":="
|
||||
},
|
||||
"named": true,
|
||||
"value": "operator"
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "value",
|
||||
|
|
|
@ -389,6 +389,16 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"children": {
|
||||
"multiple": false,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "operator",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -811,6 +821,16 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"children": {
|
||||
"multiple": false,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "operator",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -2067,6 +2087,16 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"children": {
|
||||
"multiple": false,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "operator",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -2255,10 +2285,6 @@
|
|||
"type": ":",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": ":=",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": ";",
|
||||
"named": false
|
||||
|
|
|
@ -136,7 +136,7 @@ static const char * const ts_symbol_names[] = {
|
|||
[anon_sym_of] = "of",
|
||||
[anon_sym_LBRACE] = "{",
|
||||
[anon_sym_RBRACE] = "}",
|
||||
[anon_sym_COLON_EQ] = ":=",
|
||||
[anon_sym_COLON_EQ] = "operator",
|
||||
[anon_sym_if] = "if",
|
||||
[anon_sym_then] = "then",
|
||||
[anon_sym_else] = "else",
|
||||
|
@ -227,7 +227,7 @@ static const TSSymbol ts_symbol_map[] = {
|
|||
[anon_sym_of] = anon_sym_of,
|
||||
[anon_sym_LBRACE] = anon_sym_LBRACE,
|
||||
[anon_sym_RBRACE] = anon_sym_RBRACE,
|
||||
[anon_sym_COLON_EQ] = anon_sym_COLON_EQ,
|
||||
[anon_sym_COLON_EQ] = anon_sym_DASH,
|
||||
[anon_sym_if] = anon_sym_if,
|
||||
[anon_sym_then] = anon_sym_then,
|
||||
[anon_sym_else] = anon_sym_else,
|
||||
|
@ -407,7 +407,7 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
|
|||
},
|
||||
[anon_sym_COLON_EQ] = {
|
||||
.visible = true,
|
||||
.named = false,
|
||||
.named = true,
|
||||
},
|
||||
[anon_sym_if] = {
|
||||
.visible = true,
|
||||
|
|
|
@ -112,10 +112,12 @@ end
|
|||
(comment)
|
||||
(variable_declaration
|
||||
(identifier)
|
||||
(operator)
|
||||
(integer_literal))
|
||||
(comment)
|
||||
(variable_declaration
|
||||
(identifier)
|
||||
(operator)
|
||||
(integer_literal))
|
||||
(comment)
|
||||
(comment)
|
||||
|
|
|
@ -65,6 +65,7 @@ for i := 12 to nil do "42"
|
|||
(source_file
|
||||
(for_expression
|
||||
index: (identifier)
|
||||
(operator)
|
||||
start: (integer_literal)
|
||||
end: (nil_literal)
|
||||
body: (string_literal)))
|
||||
|
@ -134,6 +135,7 @@ for i := break to break do while break do break
|
|||
(source_file
|
||||
(for_expression
|
||||
(identifier)
|
||||
(operator)
|
||||
(break_expression)
|
||||
(break_expression)
|
||||
(while_expression
|
||||
|
|
|
@ -217,6 +217,7 @@ var a := 12
|
|||
(source_file
|
||||
(variable_declaration
|
||||
name: (identifier)
|
||||
(operator)
|
||||
value: (integer_literal)))
|
||||
|
||||
================================================================================
|
||||
|
@ -231,6 +232,7 @@ var a : int := 27
|
|||
(variable_declaration
|
||||
name: (identifier)
|
||||
type: (type_identifier)
|
||||
(operator)
|
||||
value: (integer_literal)))
|
||||
|
||||
================================================================================
|
||||
|
@ -245,9 +247,11 @@ var b := 27
|
|||
(source_file
|
||||
(variable_declaration
|
||||
name: (identifier)
|
||||
(operator)
|
||||
value: (integer_literal))
|
||||
(variable_declaration
|
||||
name: (identifier)
|
||||
(operator)
|
||||
value: (integer_literal)))
|
||||
|
||||
================================================================================
|
||||
|
|
|
@ -150,10 +150,12 @@ a := array[12] := record.field
|
|||
(source_file
|
||||
(assignment_expression
|
||||
left: (identifier)
|
||||
(operator)
|
||||
right: (assignment_expression
|
||||
left: (array_value
|
||||
array: (identifier)
|
||||
index: (integer_literal))
|
||||
(operator)
|
||||
right: (record_value
|
||||
record: (identifier)
|
||||
field: (field_identifier)))))
|
||||
|
|
Loading…
Reference in a new issue