fix @rust functions

This commit is contained in:
Daniella / Tove 2023-08-04 22:33:39 +02:00
parent 85fee81d74
commit 99b2e4c19a
Signed by: TudbuT
GPG key ID: 7D63D5634B7C417F
4 changed files with 2074 additions and 2023 deletions

View file

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

View file

@ -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": [

View file

@ -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
},
{

File diff suppressed because it is too large Load diff