Go to file
Max Brunsfeld 6f81608535 Always lex braces and brackets as separate tokens
The lexer needs to always return braces and brackets separately so that
the parser can decide if they are part of some construct like an array
subscript or a variable expansion. This means that there was no point
in moving bare-word tokenization into the external scanner. I've moved
it back into the normal scanner.

The tricky part is how to deal with the separate '}' and ']' tokens
in the case where they are *not* part of a subscript or an expansion.
For example, in code like `echo {hi}`, the syntax tree should still
clearly indicate that only *one* argument is being passed to echo.
For now, we achieve this by grouping the '{', hi, and '}' tokens into
a single `concatenation` node, which is a bit odd, but it's the best
we can do.
2018-02-28 14:33:50 -08:00
corpus Always lex braces and brackets as separate tokens 2018-02-28 14:33:50 -08:00
examples Add tree-sitter's test script as an example file 2017-12-26 14:56:51 -08:00
src Always lex braces and brackets as separate tokens 2018-02-28 14:33:50 -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 Always lex braces and brackets as separate tokens 2018-02-28 14:33:50 -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