Commit graph

9 commits

Author SHA1 Message Date
Ika 64da30ce70
feat: add queries for highlighting (#13) 2020-07-04 16:17:01 +08:00
Ika 7df9880bf8
feat: upgrade to TOML spec v1.0.0-rc.1 (#11)
* chore: add toml-spec
* feat: upgrade to TOML spec v1.0.0-rc.1
* fix: accurate position for multiline string end
2020-06-29 00:08:52 +08:00
Ika 1e70956efb chore: use tree-sitter-cli@0.15.9-custom 2019-09-30 15:14:55 +08:00
Ika 42afd6a0eb
feat: unflatten structure and rename nodes (#4)
Since the AST should reflect its logical structure as close as possible, I revert the changes from #2. This PR also renames nodes with more appropriate names.

BREAKING CHANGE:

- rename `file` with `document`.
- rename `table_array` with `table_array_element`.
- unflatten `table` and `table_array_element`, i.e., `pair`s are now their children instead of siblings.
2019-08-31 22:16:56 +08:00
Ika 000f53ee75 chore: update formatting 2019-08-22 17:22:58 +08:00
Ika 752419c33d
fix: trailing whitespaces are allowed for local_time (#3)
Input:

(each `·` indicates a whitespace)

```toml
valid·=·1979-05-27·
```

Output:

```
# before

(file
  (ERROR
    (key)))

# after

(file
  (pair
    (key) (local_date)))
```
2019-08-21 09:13:14 +08:00
Ika a0cd384b98 feat: rename root with file 2019-08-20 15:01:47 +08:00
Ika a3812033af
feat: flatten table/table-array structure (#2)
Input:

```toml
[table]
key = "value"
```

Output:

```sh
# before
(root
  (table
    (key)
    (pair (key) (string)))

# after
(root
  (table (key))
  (pair (key) (string)))
```
2019-08-20 14:59:19 +08:00
Ika e2b28db714
fix: disallow invalid whitespaces between scalar components (#1) 2019-08-20 09:30:20 +08:00