zyxw59 / rssc

Rust rewrite of zyxw59/soundchanger and zyxw59/conlang
MIT License
0 stars 0 forks source link

Better syntax for complex environments #12

Open zyxw59 opened 2 years ago

zyxw59 commented 2 years ago

The current syntax (&(a_b |(c_ _d)) is unintuitive and a bit hard to read. It would be nice to have an infix syntax. The main challenge is grouping — ( is already a valid character to start a regex, so there's some parsing ambiguity if it's also used to group environments.

zyxw59 commented 2 years ago

Idea: get rid of the [] syntax for character classes, and replace it with anonymous categories (a feature I've thought of implementing anyway) using {}; this frees up [] to use for grouping environments — &(a_b |(c_ _d)) would become a_b & [c_ | _d], which is a lot more readable, and doesn't require as many parens