fix @rust functions

This commit is contained in:
Daniella / Tove 2023-08-04 22:29:48 +02:00
parent 99c1442712
commit 18162ee5cb
Signed by: TudbuT
GPG key ID: 7D63D5634B7C417F
4 changed files with 2105 additions and 1887 deletions

View file

@ -29,10 +29,10 @@ module.exports = grammar({
function_definition: $ => choice($.func, $.block),
func: $ => seq(
'func', $._spacing,
$.identifier, $._spacing, choice(seq('@', $.identifier, '{', $._spacing, repeat(/./), $._spacing, '}'), $.block),
$.identifier, $._spacing, choice(seq('@', $.identifier, '{', $._spacing, repeat(choice(/./, $._spacing)), $._spacing, '}'), $.block),
),
block: $ => seq(
'{', $._spacing, repeat(seq(/[^ \n\r\t|]+/, $._spacing), '|'),
'{', $._spacing, repeat(seq(/[^ \n\r\t|]+/, $._spacing)), '|',
repeat($._statement),
'}',
),

View file

@ -135,8 +135,58 @@
"name": "_spacing"
},
{
"type": "SYMBOL",
"name": "block"
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "@"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "STRING",
"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": "}"
}
]
},
{
"type": "SYMBOL",
"name": "block"
}
]
}
]
},

View file

@ -637,6 +637,10 @@
"type": "=",
"named": false
},
{
"type": "@",
"named": false
},
{
"type": "[",
"named": false

File diff suppressed because it is too large Load diff