fmt tests; properly define string literals; work on scanner

This commit is contained in:
mhoffm
2021-06-17 19:39:46 +02:00
parent 4801d16825
commit 88401e3bf3
20 changed files with 8036 additions and 5094 deletions

View File

@@ -6,7 +6,7 @@ tree-sitter grammar for the [HCL](https://github.com/hashicorp/hcl/blob/main/hcl
Highlighting `example/example.hcl`:
![Highlighting Example](https://i.imgur.com/M1PZkqL.png)
![Highlighting Example](https://i.imgur.com/sgFcxLK.png)
## Developing
@@ -16,17 +16,6 @@ It is recommended to use `nix` to fulfill all development dependencies. To activ
To run tests simply run `nix-shell --run 'tree-sitter test'`.
## Quoted Template Expressions
In principle it is allowed to contain arbitary expressions in quoted template interpolations. Consider for example:
```hcl
foo = "prefix-${func(\"bar\")}"
```
To make parsing a little easier, this parser only checks for valid escape sequences and template chars.
When using this parser one would have to take the content of a template interpolation, unescape it and parse it again to get the syntax tree. The same applies to template directives.
## Todo
* [ ] use [Unicode® Standard Annex #31](https://www.unicode.org/reports/tr31/) (augmented with '-') for identifiers