In #8 i propose to use any array of puncts as modifiers to props and store them as prefix and postfix to attribute name.
Implementing this can be tricky, since some of puncts prefixes can be treated as part of expression in previos attribute value.
Example:
This example can be parsed as div with one attribute foo with value bar.baz, or as div with two attributes foo=bar and .baz.
To avoid this conflcits, i propose to have a flag in ParserConfig that will enforce users to use some limited form of expressions in value place.
Some values that is known to have no conflict during parsing:
- Literals
"foo", 'c', 123, 0x123, 0.1f32
- Expressions in braces/parens
(x+1), {foo.bar}, [1..2], [1u8;32]
- simple variable as value
foo
- async/try/const blocks
async {...}, const {...}
- Any form of closures with rules 1-2 aplied to thier body.
move || "foo", |foo|->Bar {foo.bar}
In #8 i propose to use any array of puncts as modifiers to props and store them as prefix and postfix to attribute name.
Implementing this can be tricky, since some of puncts prefixes can be treated as part of expression in previos attribute value.
Example:
This example can be parsed as
divwith one attributefoowith valuebar.baz, or asdivwith two attributesfoo=barand.baz.To avoid this conflcits, i propose to have a flag in
ParserConfigthat will enforce users to use some limited form of expressions in value place.Some values that is known to have no conflict during parsing:
"foo",'c',123,0x123,0.1f32(x+1),{foo.bar},[1..2],[1u8;32]fooasync {...},const {...}move || "foo",|foo|->Bar {foo.bar}