Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made my grammar file work with recent versions of treetop.

  • Loading branch information...
commit d0b6d730c18a1d2fce53bedea1194bc7b6e35f19 1 parent eaa66c3
@adamjmurray authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/cosy/parser/grammar.treetop
View
8 lib/cosy/parser/grammar.treetop
@@ -83,18 +83,18 @@ module Cosy
rule pitch do
- note_name:[A-Ga-g] ![A-Zac-z] accidentals:('#'/'b'/'+'/'_')* octave:(int)? <PitchNode>
+ note_name:([A-Ga-g] '') ![A-Zac-z] accidentals:('#'/'b'/'+'/'_')* octave:(int)? <PitchNode>
/
pitch_keyword number:(number/ruby) <NumericPitchNode>
end
rule interval do
- sign:[+-]?
+ sign:([+-] '')?
quality:(
'major' / 'maj' / 'minor' / 'min' / 'perfect' / 'per' / 'augmented' / 'aug' / 'diminished' / 'dim' /
'MAJOR' / 'MAJ' / 'MINOR' / 'MIN' / 'PERFECT' / 'PER' / 'AUGMENTED' / 'AUG' / 'DIMINISHED' / 'DIM' /
- [MmpP] )
+ [MmpP] '')
degree:[0-9]+ <IntervalNode>
/
('interval'/[Ii]) number:(number/ruby) <NumericIntervalNode>
@@ -121,7 +121,7 @@ module Cosy
rule metrical_duration do
'whole' / 'half' / 'quarter' / 'eighth' / 'ei' / 'EI' / 'sixteenth' /
'thirty' '-'? 'second' / 'sixty' '-'? 'fourth' /
- [WwHhQqIiSsRrXx]
+ [WwHhQqIiSsRrXx] ''
end
Please sign in to comment.
Something went wrong with that request. Please try again.