Allow ;; at end of line of case item
This commit is contained in:
parent
27b4b7835e
commit
c7484ad85f
@ -109,8 +109,7 @@ case "opt" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
b)
|
b)
|
||||||
echo b
|
echo b;;
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$Z" in
|
case "$Z" in
|
||||||
|
10
grammar.js
10
grammar.js
@ -133,16 +133,22 @@ module.exports = grammar({
|
|||||||
$._expression,
|
$._expression,
|
||||||
repeat(seq('|', $._expression)),
|
repeat(seq('|', $._expression)),
|
||||||
')',
|
')',
|
||||||
|
optional(seq(
|
||||||
repeat($._terminated_statement),
|
repeat($._terminated_statement),
|
||||||
';;'
|
optional($._statement)
|
||||||
|
)),
|
||||||
|
prec(1, ';;')
|
||||||
),
|
),
|
||||||
|
|
||||||
last_case_item: $ => seq(
|
last_case_item: $ => seq(
|
||||||
$._expression,
|
$._expression,
|
||||||
repeat(seq('|', $._expression)),
|
repeat(seq('|', $._expression)),
|
||||||
')',
|
')',
|
||||||
|
optional(seq(
|
||||||
repeat($._terminated_statement),
|
repeat($._terminated_statement),
|
||||||
optional(';;')
|
optional($._statement)
|
||||||
|
)),
|
||||||
|
optional(prec(1, ';;'))
|
||||||
),
|
),
|
||||||
|
|
||||||
function_definition: $ => seq(
|
function_definition: $ => seq(
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
examples/bash-it/plugins/available/git.plugin.bash
|
examples/bash-it/plugins/available/git.plugin.bash
|
||||||
examples/bash-it/plugins/available/fasd.plugin.bash
|
|
||||||
examples/bash-it/plugins/available/fzf.plugin.bash
|
examples/bash-it/plugins/available/fzf.plugin.bash
|
||||||
examples/bash-it/plugins/available/z.plugin.bash
|
|
||||||
examples/bash-it/plugins/available/extract.plugin.bash
|
examples/bash-it/plugins/available/extract.plugin.bash
|
||||||
examples/bash-it/plugins/available/less-pretty-cat.plugin.bash
|
examples/bash-it/plugins/available/less-pretty-cat.plugin.bash
|
||||||
examples/bash-it/plugins/available/z_autoenv.plugin.bash
|
examples/bash-it/plugins/available/z_autoenv.plugin.bash
|
||||||
@ -38,7 +36,6 @@ examples/bash-it/completion/available/projects.completion.bash
|
|||||||
examples/bash-it/completion/available/virsh.completion.bash
|
examples/bash-it/completion/available/virsh.completion.bash
|
||||||
examples/bash-it/completion/available/apm.completion.bash
|
examples/bash-it/completion/available/apm.completion.bash
|
||||||
examples/bash-it/completion/available/git_flow.completion.bash
|
examples/bash-it/completion/available/git_flow.completion.bash
|
||||||
examples/bash-it/lib/helpers.bash
|
|
||||||
examples/bash-it/lib/preexec.bash
|
examples/bash-it/lib/preexec.bash
|
||||||
examples/bash-it/lib/composure.bash
|
examples/bash-it/lib/composure.bash
|
||||||
examples/bash-it/lib/search.bash
|
examples/bash-it/lib/search.bash
|
||||||
@ -53,7 +50,6 @@ examples/bash-it/themes/dulcie/dulcie.theme.bash
|
|||||||
examples/bash-it/themes/colors.theme.bash
|
examples/bash-it/themes/colors.theme.bash
|
||||||
examples/bash-it/themes/rana/rana.theme.bash
|
examples/bash-it/themes/rana/rana.theme.bash
|
||||||
examples/bash-it/themes/morris/morris.theme.bash
|
examples/bash-it/themes/morris/morris.theme.bash
|
||||||
examples/bash-it/themes/atomic/atomic.theme.bash
|
|
||||||
examples/bash-it/themes/powerline/powerline.base.bash
|
examples/bash-it/themes/powerline/powerline.base.bash
|
||||||
examples/bash-it/themes/base.theme.bash
|
examples/bash-it/themes/base.theme.bash
|
||||||
examples/bash-it/themes/brainy/brainy.theme.bash
|
examples/bash-it/themes/brainy/brainy.theme.bash
|
||||||
|
@ -2,5 +2,4 @@
|
|||||||
|
|
||||||
tree-sitter parse $(find examples/bash-it -name '*.bash' -or -name '*.sh') -q -t \
|
tree-sitter parse $(find examples/bash-it -name '*.bash' -or -name '*.sh') -q -t \
|
||||||
| egrep 'ERROR|undefined' \
|
| egrep 'ERROR|undefined' \
|
||||||
| cut -d' ' -f1 \
|
| tee >(cut -d' ' -f1 > script/known-failures.txt)
|
||||||
> script/known-failures.txt
|
|
||||||
|
58
src/grammar.json
vendored
58
src/grammar.json
vendored
@ -347,6 +347,12 @@
|
|||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": ")"
|
"value": ")"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "CHOICE",
|
||||||
|
"members": [
|
||||||
|
{
|
||||||
|
"type": "SEQ",
|
||||||
|
"members": [
|
||||||
{
|
{
|
||||||
"type": "REPEAT",
|
"type": "REPEAT",
|
||||||
"content": {
|
"content": {
|
||||||
@ -355,9 +361,32 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"type": "CHOICE",
|
||||||
|
"members": [
|
||||||
|
{
|
||||||
|
"type": "SYMBOL",
|
||||||
|
"name": "_statement"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "BLANK"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "BLANK"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "PREC",
|
||||||
|
"value": 1,
|
||||||
|
"content": {
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": ";;"
|
"value": ";;"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"last_case_item": {
|
"last_case_item": {
|
||||||
@ -387,6 +416,12 @@
|
|||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": ")"
|
"value": ")"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "CHOICE",
|
||||||
|
"members": [
|
||||||
|
{
|
||||||
|
"type": "SEQ",
|
||||||
|
"members": [
|
||||||
{
|
{
|
||||||
"type": "REPEAT",
|
"type": "REPEAT",
|
||||||
"content": {
|
"content": {
|
||||||
@ -398,8 +433,31 @@
|
|||||||
"type": "CHOICE",
|
"type": "CHOICE",
|
||||||
"members": [
|
"members": [
|
||||||
{
|
{
|
||||||
|
"type": "SYMBOL",
|
||||||
|
"name": "_statement"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "BLANK"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "BLANK"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "CHOICE",
|
||||||
|
"members": [
|
||||||
|
{
|
||||||
|
"type": "PREC",
|
||||||
|
"value": 1,
|
||||||
|
"content": {
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": ";;"
|
"value": ";;"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "BLANK"
|
"type": "BLANK"
|
||||||
|
64195
src/parser.c
vendored
64195
src/parser.c
vendored
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user