summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-08-29 09:37:45 +0800
committerJSDurand <mmemmew@gmail.com>2022-08-29 09:37:45 +0800
commitb36b5b232be479bd69a6e2f421c5e740429a15bf (patch)
tree4b22f9777c1a8a7aa9fe384e0418f2c8fa421c0b
parent87325ea0711efb0f9dbd56e35f37b1f5c92aabe8 (diff)
Fix the grammar
There were some bugs in the grammar specification of the sheet. Now the grammar is supposedly correct.
-rw-r--r--src/sheet/sheet grammar.abnf10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sheet/sheet grammar.abnf b/src/sheet/sheet grammar.abnf
index b7b842e..3076f6b 100644
--- a/src/sheet/sheet grammar.abnf
+++ b/src/sheet/sheet grammar.abnf
@@ -31,20 +31,20 @@ bpm = "b" 1*DIGIT
instrument = "i" ( "piano" / "violin" )
; A note has three parts: octave, tone, and duration.
-note = *1octave tone *1duration
+note = tone *("/" tone) *1duration
-octave = "o" 1*DIGIT
+tone = *1octave ( "a" / "b" / "c" / "d" / "e" / "f" / "g" ) *1tone-shift
-tone = ( "a" / "b" / "c" / "d" "e" / "f" / "g" ) *tone-shift
+octave = "o" 1*DIGIT / 1*">" / 1*"<"
; Shifts the tone by some number of semitones
-tone-shift = "+" / "-"
+tone-shift = 1*"+" / 1*"-"
; A duration is either in the standard sheet notation or a precise
; duration.
;
; There are no overlaps between the two variants.
-duration = 1*DIGIT *"." / "p" 1*DIGIT *1("." 1* DIGIT)
+duration = *DIGIT *"." / "p" 1*DIGIT *1("." 1* DIGIT)
cram-repetition = *1cram *1repetition