Skip to content

Commit

Permalink
Allow backslashes between tokens
Browse files Browse the repository at this point in the history
Fixes #14
  • Loading branch information
maxbrunsfeld committed Aug 6, 2018
1 parent 0e17236 commit da2ba9c
Show file tree
Hide file tree
Showing 5 changed files with 69,231 additions and 56,039 deletions.
10 changes: 10 additions & 0 deletions corpus/programs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,13 @@ f=g \
(word))
(command_name (word))
(word)))

=============================
Escaped whitespace
============================

echo 1 \ 2 \ 3

---

(program (command (command_name (word)) (word) (word) (word)))
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = grammar({

extras: $ => [
$.comment,
token(choice(/\s/, '\\\n')),
/\\?\s/,
],

word: $ => $.word,
Expand Down
2 changes: 0 additions & 2 deletions script/known-failures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ examples/bash-it/completion/available/packer.completion.bash
examples/bash-it/completion/available/vault.completion.bash
examples/bash-it/completion/available/docker.completion.bash
examples/bash-it/completion/available/tmux.completion.bash
examples/bash-it/completion/available/virsh.completion.bash
examples/bash-it/completion/available/apm.completion.bash
examples/bash-it/completion/available/git_flow.completion.bash
examples/bash-it/lib/preexec.bash
Expand All @@ -38,4 +37,3 @@ examples/bash-it/themes/nwinkler_random_colors/nwinkler_random_colors.theme.bash
examples/bash-it/themes/mbriggs/mbriggs.theme.bash
examples/bash-it/themes/kitsune/kitsune.theme.bash
examples/bash-it/themes/doubletime/doubletime.theme.bash
examples/bash-it/themes/duru/duru.theme.bash
16 changes: 2 additions & 14 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -2133,20 +2133,8 @@
"name": "comment"
},
{
"type": "TOKEN",
"content": {
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "\\s"
},
{
"type": "STRING",
"value": "\\\n"
}
]
}
"type": "PATTERN",
"value": "\\\\?\\s"
}
],
"conflicts": [],
Expand Down
Loading

0 comments on commit da2ba9c

Please sign in to comment.