mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 11:46:42 +01:00
dsl: fixed expression handling
This commit is contained in:
parent
9e0b7be9a9
commit
643658ab16
6 changed files with 384 additions and 270 deletions
|
|
@ -92,3 +92,24 @@ or configuration statements, and look like this:
|
|||
* [ ] const parse
|
||||
* [ ] live reload
|
||||
* [ ] serialize modified code back to original indentation
|
||||
|
||||
## implementation notes
|
||||
|
||||
### `DslExp` trait behavior
|
||||
|
||||
this is the trait which differentiates "a thing" from
|
||||
"a thing that is many things".
|
||||
|
||||
|source |key|exp |head |tail |
|
||||
|---------------|---|-------|---------|---------------|
|
||||
|`a` |`a`|e0 |`a` |None |
|
||||
|`(a)` |e1 |`a` |`(a)` |None |
|
||||
|`a b c` |e2 |e0 |`a` |`b c` |
|
||||
|`(a b c)` |e1 |`a b c`|`(a b c)`| |
|
||||
|`(a b c) d e` |e1 |e3 |`(a b c)`|`d e` |
|
||||
|`a (b c d) e f`|e1 |e0 |`a` |`(b c d) e f` |
|
||||
|
||||
* e0: Unexpected 'a'
|
||||
* e1: Unexpected '('
|
||||
* e2: Unexpected 'b'
|
||||
* e3: Unexpected 'd'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue