Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab support for ChordPro parsing: PeggySyntaxError: Expected "#", "%", "[", "\\", "]", "{", "|", or "}" but "3" found. #1143

Closed
AdrienAnelli opened this issue Apr 7, 2024 · 2 comments

Comments

@AdrienAnelli
Copy link

AdrienAnelli commented Apr 7, 2024

When there is a tab part inside a chord pro format like:

E|--------------------------|-x--5-|-------------------------|-x--3-|
B|--------------------------|-x--5-|-------------------------|-x--3-|
G|--------------------------|-x--5-|-------------------------|-x--4-|
D|--------------------------|-x--5-|-------------------------|-x--3-|
A|------5-------------------|-x--7-|-------5-----------------|-x--5-|
E|--5/7----7--5--3--0--3/5--|-x--5-|--5/7------7--5/3--0--3--|-x--3-|

E|--------------------------|-x--5-|-------------------------|-x--3-|
B|--------------------------|-x--5-|-------------------------|-x--3-|
G|--------------------------|-x--5-|-------------------------|-x--4-|
D|--------------------------|-x--5-|-------------------------|-x--3-|
A|-------5--7--5------------|-x--7-|-------5-----------------|-x--5-|
E|--5/7-----------7--0--5---|-x--5-|--5/7------7--5\3--0--3--|-x--3-|

The chord pro format cannot be parsed and this error is thrown: PeggySyntaxError: Expected "#", "%", "[", "\\", "]", "{", "|", or "}" but "3" found.

Also, this same tab description entered as text (chords over words) will be converted to chord pro format as:

[E][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][5-][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][3-][|]
[B][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][5-][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][3-][|]
[G][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][5-][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][4-][|]
[D][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][5-][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][3-][|]
[A]E [|]| [-]- [-]- [-]5 [-]/ [-]7 [-]- [5-]-- [-]- [-]7 [-]- [-]- [-]5 [-]- [-]- [-]3 [-]- [-]- [-]0 [-]- [-]- [-]3 [-]/ [-]5 [-]- [-]- [|]| [-]- [x]x [-]- [-]- [7-]5- [|]| [-]- [-]- [-]5 [-]/ [-]7 [-]- [-]- [5-]-- [-]- [-]- [-]7 [-]- [-]- [-]5 [-]/ [-]3 [-]- [-]- [-]0 [-]- [-]- [-]3 [-]- [-]- [|]| [-]- [x]x [-]- [-]- [5-]3- [|]|

[E][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][5-][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][3-][|]
[B][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][5-][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][3-][|]
[G][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][5-][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][4-][|]
[D][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][5-][|][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][-][|][-][x][-][-][3-][|]
[A]E [|]| [-]- [-]- [-]5 [-]/ [-]7 [-]- [-]- [5-]-- [-]- [7-]-- [-]- [5-]-- [-]- [-]7 [-]- [-]- [-]0 [-]- [-]- [-]5 [-]- [-]- [-]- [|]| [-]- [x]x [-]- [-]- [7-]5- [|]| [-]- [-]- [-]5 [-]/ [-]7 [-]- [-]- [5-]-- [-]- [-]- [-]7 [-]- [-]- [-]5 [-]\[-]3[-]- [-]- [-]0 [-]- [-]- [-]3 [-]- [-]- [|]| [-]- [x]x [-]- [-]- [5-]3- [|]|

Which gives using the text formatter:

E | - - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 5- | - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 3- |
B | - - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 5- | - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 3- |
G | - - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 5- | - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 4- |
D | - - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 5- | - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 3- |
A | - - - - - - 5- - - - - - - - - - - - - - - - - - - | - x - - 7- | - - - - - - - 5- - - - - - - - - - - - - - - - - | - x - - 5- |
E | - - 5 / 7 - -- - 7 - - 5 - - 3 - - 0 - - 3 / 5 - - | - x - - 5- | - - 5 / 7 - - -- - - 7 - - 5 / 3 - - 0 - - 3 - - | - x - - 3- |

E | - - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 5- | - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 3- |
B | - - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 5- | - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 3- |
G | - - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 5- | - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 4- |
D | - - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 5- | - - - - - - - - - - - - - - - - - - - - - - - - - | - x - - 3- |
A | - - - - - - - 5- - 7- - 5- - - - - - - - - - - - | - x - - 7- | - - - - - - - 5- - - - - - - -    - - - - - - - - | - x - - 5- |
E | - - 5 / 7 - - -- - -- - -- - 7 - - 0 - - 5 - - - | - x - - 5- | - - 5 / 7 - - -- - - 7 - - 5 \[-]3- - 0 - - 3 - - | - x - - 3- |

This was working fine with ChordSheetParser

@martijnversluis
Copy link
Owner

@AdrienAnelli Thanks for reaching out and submitting your issue.

For the first problem I have good news: I've been working on proper abc/grid/ly/tab section support for the ChordProParser, and I'll probably release that within a couple of days: #1144

The second problem is a bit harder to solve. ChordsOverWordsFormatter is not designed (yet) to recognise tab sections and treat them differently from chords with lyrics. I'll put this issue on the board though and see when I can invest some time to try and get this working.

@martijnversluis
Copy link
Owner

See #1182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants