palfrey/maiden

Hyphens are not counted as letters

Closed this issue · 1 comments

The parser at https://palfrey.github.io/maiden/ skips hyphens in the count of letters in literals.

For example, Belle was a be-our-guest intellectual generates Assignment { target: Variable("Belle"), value: Floating(102.0) }. The literal be-our-guest contains ten letters and two hyphens for a total of twelve, so the value should be 122.0 instead.

https://github.com/RockstarLang/rockstar/blob/master/spec.md says "The hyphen (-) is counted as a letter – so you can use terms like 'all-consuming' (13 letters > 3) and 'power-hungry' (12 letters > 2) instead of having to think of 12- and 13-letter words."

Agreed. So the upstream change was RockstarLang/rockstar#234 and unfortunately (see #33 for fixing this) our PEG file is manually derived from upstream's one so I'll need to fix that by hand.