Go to file
Max Brunsfeld 675a581839 Allow special characters in bare word arguments
I've moved tokenization of bare words into the external scanner. This
way we can keep the grammar simple, but support some fancy rules that
I've inferred from experimenting with bash:

- Only allow '}' inside of a bare word if '}' isn't a valid lookahead
token (i.e. we're not inside of a variable expansion).
- Only allow ']' at the *start* of a bare word if neither ']' nor ']]'
are valid lookahead tokens (i.e. we're not inside of a square bracket
command or an array subscript).
- Parentheses seem to never be allowed in bare words. You have to quote
them.

For alphanumeric words, I fall through to the normal scanner so that it
can continue to distinguish reserved words from other words.

Fixes #5
2018-02-27 16:55:20 -08:00
corpus Allow special characters in bare word arguments 2018-02-27 16:55:20 -08:00
examples Add tree-sitter's test script as an example file 2017-12-26 14:56:51 -08:00
src Allow special characters in bare word arguments 2018-02-27 16:55:20 -08:00
.gitattributes Add examples directory w/ one real shell script 2017-07-14 17:41:51 -07:00
.gitignore Initial commit 2017-07-14 12:28:54 -07:00
.npmignore Initial commit 2017-07-14 12:28:54 -07:00
.travis.yml Use a newer clang on travis 2017-07-14 17:53:04 -07:00
LICENSE Add license and readme 2017-07-14 14:46:24 -07:00
README.md Add license and readme 2017-07-14 14:46:24 -07:00
binding.gyp Start work on heredocs 2017-07-14 13:54:05 -07:00
grammar.js Allow special characters in bare word arguments 2018-02-27 16:55:20 -08:00
index.js Initial commit 2017-07-14 12:28:54 -07:00
package.json 0.5.0 2018-02-12 16:54:53 -08:00

README.md

tree-sitter-bash

Build Status

Bash grammar for tree-sitter.

References