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

\language not always parsed correctly #6

Open
drtutut opened this issue Nov 10, 2023 · 0 comments
Open

\language not always parsed correctly #6

drtutut opened this issue Nov 10, 2023 · 0 comments

Comments

@drtutut
Copy link

drtutut commented Nov 10, 2023

Lilypond accepts language names with or without double quotes around the name.
Quickly does not recognize the language name if it is not quoted.

To reproduce, run the following code:

text = r"""
% Correctly detected
\language "nederlands"
\language "català"
\language "catalan"
\language "deutsch"
\language "english"
\language "español"
\language "espanol"
\language "français"
\language "italiano"
\language "norks"
\language "português"
\language "portugues"
\language "suomi"
\language "svenska"
\language "vlaams"

% Should be detected as well
\language nederlands
\language català
\language catalan
\language deutsch
\language english
\language español
\language espanol
\language français
\language italiano
\language norks
\language português
\language portugues
\language suomi
\language svenska
\language vlaams
"""
doc = parce.Document(LilyPond.root, transformer=True)
doc.set_text(text)
music = doc.get_transform(True)
music.dump()

The second form (without quotes) leads to lily.Language nodes with None as the detected language, followed by a lily.Symbol node containing the unparsed language name.

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

No branches or pull requests

1 participant