Skip to content

alphaTex rest after section tag causes parsing error #683

@jonaro00

Description

@jonaro00

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Starting a bar with a rest directly after a symbol-less \section tag causes the r in the rest to be parsed as the section name, as the \section tag reads up to two "names" after it. Although this is the "expected" behavior from the parser, it leads to some confusion when learning the language.

This...

1.3.4*4 |
\section Verse
r.1 | 2.3.4*4 |

...causes this to be rendered:
image

My current workaround is to start the bar with a duration range instead:

1.3.4*4 |
\section Verse
:1 r | 2.3.4*4 |

Expected Behavior

The expected behavior from a new user of alphaTex would be for the r to be parsed as a rest in the example from above.
image

My suggested solution at this stage would be to disallow section names to be r, as it seems very unlikely for someone to legitimately use that. Fixing the "bug" and the confusion it brings is probably worth it. However, there are probably even better solutions to this problem.

Steps To Reproduce

See above

Link to jsFiddle, CodePen, Project

No response

Found in Version

1.2

Platform

Web

Environment

- **OS**: Windows 10
- **Browser**: Chromium 96

Anything else?

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions