dsl: fixed expression handling

This commit is contained in:
🪞👃🪞 2025-07-31 22:33:59 +03:00
parent 9e0b7be9a9
commit 643658ab16
6 changed files with 384 additions and 270 deletions

View file

@ -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'