fix @rust functions
This commit is contained in:
parent
99c1442712
commit
18162ee5cb
4 changed files with 2105 additions and 1887 deletions
|
@ -29,10 +29,10 @@ 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(/./), $._spacing, '}'), $.block),
|
$.identifier, $._spacing, choice(seq('@', $.identifier, '{', $._spacing, repeat(choice(/./, $._spacing)), $._spacing, '}'), $.block),
|
||||||
),
|
),
|
||||||
block: $ => seq(
|
block: $ => seq(
|
||||||
'{', $._spacing, repeat(seq(/[^ \n\r\t|]+/, $._spacing), '|'),
|
'{', $._spacing, repeat(seq(/[^ \n\r\t|]+/, $._spacing)), '|',
|
||||||
repeat($._statement),
|
repeat($._statement),
|
||||||
'}',
|
'}',
|
||||||
),
|
),
|
||||||
|
|
|
@ -135,8 +135,58 @@
|
||||||
"name": "_spacing"
|
"name": "_spacing"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "CHOICE",
|
||||||
"name": "block"
|
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
@ -637,6 +637,10 @@
|
||||||
"type": "=",
|
"type": "=",
|
||||||
"named": false
|
"named": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "@",
|
||||||
|
"named": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "[",
|
"type": "[",
|
||||||
"named": false
|
"named": false
|
||||||
|
|
3930
src/parser.c
3930
src/parser.c
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue