Commit graph

7 commits

Author SHA1 Message Date
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 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
Ika 46de5998d4 refactor: replace external tokens with internal ones 2019-08-19 23:58:20 +08:00
Ika 5acac3958f feat: initial implementation 2019-08-18 18:30:34 +08:00