Use immediate

This commit is contained in:
Camden Cheek 2021-05-10 21:04:55 -06:00
parent 732a4f0e4f
commit 550e4cf0a3
No known key found for this signature in database
GPG key ID: 595BFFE3A04E48B9
3 changed files with 2552 additions and 2573 deletions

View file

@ -196,7 +196,7 @@ module.exports = grammar({
), ),
expansion: $ => seq( expansion: $ => seq(
'$', token.immediate('$'),
choice( choice(
$.variable, $.variable,
seq('{', alias(/[^\}]+/, $.variable), '}'), seq('{', alias(/[^\}]+/, $.variable), '}'),
@ -304,8 +304,8 @@ module.exports = grammar({
), ),
shell_fragment: $ => repeat1(choice( shell_fragment: $ => repeat1(choice(
/[^\\\[\n#\s][^\\\[\n]*/, // non-escape or newline character /[^\\\[\n#\s][^\\\[\n]*/,
/\\[^\n]/, // non-line-continuation escape /\\[^\n]/,
)), )),
line_continuation: $ => '\\\n', line_continuation: $ => '\\\n',

View file

@ -811,8 +811,11 @@
"type": "SEQ", "type": "SEQ",
"members": [ "members": [
{ {
"type": "STRING", "type": "IMMEDIATE_TOKEN",
"value": "$" "content": {
"type": "STRING",
"value": "$"
}
}, },
{ {
"type": "CHOICE", "type": "CHOICE",

File diff suppressed because it is too large Load diff