-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formalize grammar #22
Conversation
Tests pass over at |
src/sw2.pegjs
Outdated
_ = Whitespace* | ||
|
||
Expression | ||
= head:Term tail:(_ ('+' / '-') _ Term)* { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
src/sw2.pegjs
Outdated
= $([+-]? (SlashFraction / PlainNumber)) | ||
|
||
Monzo | ||
= '[' components:(_ @Component _ ','? _)* '>' { return Monzo(components) } |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Replace the parser with a PEG.js AST parser and an AST evaluator. ref #21
ea1861b
to
c0842ac
Compare
Ran this by some scales from the Xenharmonic Alliance Discord. Seems to produce the same results. |
I see signed SW2 doesn’t accept the scale or/and ignores those entries. Even in SW2, |
This is a re-implementation of the existing and poorly laid out grammar of Scale Workshop 2. I regret allowing |
But it doesn’t (by itself as a whole row). Then it’s good. But the parser as it is allows it, so transitioning to SW3 parser should catch these places. |
That is simply due to a fortunate bug. It was always meant to parse and has been fixed in the latest deployment. |
Self-review: Seems reasonable and should make it easier slot in the new unit system in the next major version. |
Replace the parser with a PEG.js AST parser and an AST evaluator.
ref #21