fix @rust functions
This commit is contained in:
parent
85fee81d74
commit
99b2e4c19a
4 changed files with 2074 additions and 2023 deletions
|
@ -29,8 +29,9 @@ module.exports = grammar({
|
|||
function_definition: $ => choice($.func, $.block),
|
||||
func: $ => seq(
|
||||
'func', $._spacing,
|
||||
$.identifier, $._spacing, choice(seq('@', $.identifier, '!{', $._spacing, repeat(choice(/./, $._spacing)), $._spacing, '}'), $.block),
|
||||
$.identifier, $._spacing, choice(seq('@', $.identifier, '!', $.blocky), $.block),
|
||||
),
|
||||
blocky: $ => seq('{', repeat(choice($.blocky, /./)), '}'),
|
||||
block: $ => seq(
|
||||
'{', $._spacing, repeat(seq(/[^ \n\r\t|]+/, $._spacing)), '|',
|
||||
repeat($._statement),
|
||||
|
|
|
@ -150,35 +150,11 @@
|
|||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "!{"
|
||||
"value": "!"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_spacing"
|
||||
},
|
||||
{
|
||||
"type": "REPEAT",
|
||||
"content": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "PATTERN",
|
||||
"value": "."
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_spacing"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_spacing"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "}"
|
||||
"name": "blocky"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -190,6 +166,35 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"blocky": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "{"
|
||||
},
|
||||
{
|
||||
"type": "REPEAT",
|
||||
"content": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "blocky"
|
||||
},
|
||||
{
|
||||
"type": "PATTERN",
|
||||
"value": "."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"block": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
|
|
|
@ -133,6 +133,21 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "blocky",
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": true,
|
||||
"required": false,
|
||||
"types": [
|
||||
{
|
||||
"type": "blocky",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "call",
|
||||
"named": true,
|
||||
|
@ -313,6 +328,10 @@
|
|||
"type": "block",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "blocky",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "identifier",
|
||||
"named": true
|
||||
|
@ -614,7 +633,7 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"type": "!{",
|
||||
"type": "!",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
|
|
4016
src/parser.c
4016
src/parser.c
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue