From 4b7f98a9a68b494a8a68250d5fe40e78e79f2e09 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Tue, 8 Sep 2015 21:17:56 +0200 Subject: [PATCH 1/2] Allow capital 'X' when string is not played --- patacrep/songs/chordpro/syntax.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patacrep/songs/chordpro/syntax.py b/patacrep/songs/chordpro/syntax.py index 80baf66f..582bae41 100644 --- a/patacrep/songs/chordpro/syntax.py +++ b/patacrep/songs/chordpro/syntax.py @@ -73,7 +73,7 @@ class ChordproParser(Parser): else: frets = [] for fret in groups['frets'].split(): - if fret == "x": + if fret in "xX": frets.append(None) else: frets.append(int(fret)) @@ -112,7 +112,7 @@ class ChordproParser(Parser): ^ (?P[^\ ]*)\ * (base-fret\ *(?P[2-9]))?\ * - frets\ *(?P((\d+|x)\ *)+)\ * + frets\ *(?P((\d+|x|X)\ *)+)\ * (fingers\ *(?P(([0-4-])\ *)*))? $ """, From 429442ad6f2b471a6fd24e41a5323a16dc4b7706 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Tue, 8 Sep 2015 21:22:44 +0200 Subject: [PATCH 2/2] base-fret can be any number greater than 1 (included) --- patacrep/songs/chordpro/syntax.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patacrep/songs/chordpro/syntax.py b/patacrep/songs/chordpro/syntax.py index 582bae41..ee0300b2 100644 --- a/patacrep/songs/chordpro/syntax.py +++ b/patacrep/songs/chordpro/syntax.py @@ -111,7 +111,7 @@ class ChordproParser(Parser): r""" ^ (?P[^\ ]*)\ * - (base-fret\ *(?P[2-9]))?\ * + (base-fret\ *(?P[1-9]\d*))?\ * frets\ *(?P((\d+|x|X)\ *)+)\ * (fingers\ *(?P(([0-4-])\ *)*))? $