dxinteractive / xenpaper

Repo for xenpaper.com
https://xenpaper.com
MIT License
31 stars 4 forks source link

`m` in comment sometimes causes parsing error #47

Closed bgins closed 3 years ago

bgins commented 3 years ago

Hello :wave:.

I noticed that in some cases the character m in a comment triggers a parsing error. For example:

# Ptolemy's Diatonic Scales
{1/1 21/20 7/6 4/3 3/2 63/40 7/4}
0 1 2 3 4 5 6 7-

# Ptolemy's Tense Diatonic
{1/1 16/15 6/5 4/3 3/2 8/5 9/5}
0 1 2 3 4 5 6 7-

In this case, if the m is removed from the second instance of Ptolemy's, parsing succeeds.

This is an excellent app, and I have been enjoying it quite a lot. Thank you for making it! :heart:

dxinteractive commented 3 years ago

Oh how bizarre! I'll definitely need to fix this.

dxinteractive commented 3 years ago

Think I found it, looks like there's a missing ^ at the start of the regex that matches the m in the scale group prefixes liek {m0 1}. https://github.com/dxinteractive/xenpaper/blob/main/packages/xenpaper-ui/src/data/grammar.ts#L341

I'll try get a small release through soon with the fix.

bgins commented 3 years ago

Awesome thanks! :pray:

dxinteractive commented 3 years ago

Hi @bgins , I believe this is fixed now as of https://github.com/dxinteractive/xenpaper/releases/tag/1.4.1. Sorry it took so long!

bgins commented 3 years ago

Hey, just tried it out, and it's working great! Here's a paper with a set of ancient Greek enharmonic tunings. Extensive use of m in the comments throughout.

Thanks again for the great work on this app!