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), function_definition: $ => choice($.func, $.block),
func: $ => seq( func: $ => seq(
'func', $._spacing, '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( block: $ => seq(
'{', $._spacing, repeat(seq(/[^ \n\r\t|]+/, $._spacing)), '|', '{', $._spacing, repeat(seq(/[^ \n\r\t|]+/, $._spacing)), '|',
repeat($._statement), repeat($._statement),

View file

@ -150,35 +150,11 @@
}, },
{ {
"type": "STRING", "type": "STRING",
"value": "!{" "value": "!"
}, },
{ {
"type": "SYMBOL", "type": "SYMBOL",
"name": "_spacing" "name": "blocky"
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "."
},
{
"type": "SYMBOL",
"name": "_spacing"
}
]
}
},
{
"type": "SYMBOL",
"name": "_spacing"
},
{
"type": "STRING",
"value": "}"
} }
] ]
}, },
@ -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": { "block": {
"type": "SEQ", "type": "SEQ",
"members": [ "members": [

View file

@ -133,6 +133,21 @@
] ]
} }
}, },
{
"type": "blocky",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "blocky",
"named": true
}
]
}
},
{ {
"type": "call", "type": "call",
"named": true, "named": true,
@ -313,6 +328,10 @@
"type": "block", "type": "block",
"named": true "named": true
}, },
{
"type": "blocky",
"named": true
},
{ {
"type": "identifier", "type": "identifier",
"named": true "named": true
@ -614,7 +633,7 @@
} }
}, },
{ {
"type": "!{", "type": "!",
"named": false "named": false
}, },
{ {

File diff suppressed because it is too large Load diff