-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
Hello! Thank you for all this amazing stuff around!
I have identified a misbehaviour of lexer. When assignment is proceeded by a numeric, it is ignored by the lexer and is not reflected in the music document.
from ly.document import Document
from ly.music import document
str_INCORRECT_result = """
\\version "2.24.3"
\\include "def.ly"
numeric = 2 % this line messes up the lexer
assignment = \\relative c {
a4
}
"""
str_correct_result = """
\\version "2.24.3"
\\include "def.ly"
numeric = "2"
assignment = \\relative c {
a4
}
"""
d_correct = document(Document(str_correct_result))
d_INCORRECT = document(Document(str_INCORRECT_result))
print(d_correct.dump())
# <Document>
# <Version '\\version'>
# <String '"'>
# <Include '\\include'>
# <String '"'>
# <Assignment 'numeric'>
# <String '"'>
# <Assignment 'assignment'> <-- CORRECT
# <Relative '\\relative'>
# <Note 'c'>
# <MusicList '{'>
# <Note 'a'>
# <Duration '4'>
print(d_INCORRECT.dump())
# <Document>
# <Version '\\version'>
# <String '"'>
# <Include '\\include'>
# <String '"'>
# <Assignment 'numeric'>
# <Unpitched>
# <Duration '2'>
# <Relative '\\relative'> <-- NOT CORRECT – <Assignment> MISSING!
# <Note 'c'>
# <MusicList '{'>
# <Note 'a'>
# <Duration '4'>Metadata
Metadata
Assignees
Labels
No labels