Fix .- command parsing

This commit is contained in:
Riccardo Schirone 2021-09-07 10:28:26 +02:00 committed by Anton Kochkov
parent 4762bd1289
commit 9c650deef1
4 changed files with 9138 additions and 8989 deletions

View file

@ -378,3 +378,14 @@ rz-find -S واسع bins/pe/testapp-msvc64.exe
(arg (arg_identifier))
(arg (arg_identifier))
(arg (arg_identifier)))))
===============
.- with no args
===============
.-
---
(statements
(arged_stmt (cmd_identifier)))

View file

@ -262,7 +262,10 @@ module.exports = grammar({
1,
choice(
seq(field("command", alias(".", $.cmd_identifier)), field("args", $._simple_stmt)),
seq(field("command", alias(/\.[\.:\-*]+/, $.cmd_identifier)), /[ ]+/, field("args", optional($.args))),
seq(
field("command", alias(/\.[\.:\-*]+/, $.cmd_identifier)),
optional(seq(/[ ]+/, field("args", optional($.args))))
),
seq(field("command", alias(/\.[ ]+/, $.cmd_identifier)), field("args", optional($.args))),
seq(field("command", alias(".(", $.cmd_identifier)), field("args", $.macro_call_content)),
seq(field("command", alias($._interpret_search_identifier, $.cmd_identifier)), field("args", $.args)),

View file

@ -1807,24 +1807,37 @@
}
},
{
"type": "PATTERN",
"value": "[ ]+"
},
{
"type": "FIELD",
"name": "args",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "args"
},
{
"type": "BLANK"
}
]
}
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "PATTERN",
"value": "[ ]+"
},
{
"type": "FIELD",
"name": "args",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "args"
},
{
"type": "BLANK"
}
]
}
}
]
},
{
"type": "BLANK"
}
]
}
]
},

File diff suppressed because it is too large Load diff