Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

Parse error involving variables within variable definitions #64

Closed
elydpg opened this issue Feb 27, 2018 · 3 comments
Closed

Parse error involving variables within variable definitions #64

elydpg opened this issue Feb 27, 2018 · 3 comments
Assignees
Labels

Comments

@elydpg
Copy link

elydpg commented Feb 27, 2018

Consider the following code:

soprano = >c< b >c<
alto = g g g
tenor = e d e
bass = c <b> c
piano: V1: soprano V2: alto V3: tenor V4: bass

Plays normally
However,

soprano = >c< b >c<
alto = g g g
tenor = e d e
bass = c <b> c

melody = V1: soprano V2: alto V3: tenor V4: bass

piano: melody

Throws the error [27713] ERROR Unrecognized event: :name (this happens regardless of whether or not the variable melody is actually used or not).
However,

soprano = >c< b >c<
alto = g g g
tenor = e d e
bass = c <b> c

melody = [V1: soprano V2: alto V3: tenor V4: bass]

piano: melody

Plays normally.

@daveyarwood
Copy link
Member

Another nice catch @elyisgreat -- I've found the cause* and am working on a fix.

*Don't ask, it's a really weird edge case!

@daveyarwood
Copy link
Member

...OK, I'll explain :)

Voices ended up actually being a red herring. It turns out that there's a bug in the parser that has to do with ending a variable definition with another variable reference.

This works because the foo = line ends with f (not a variable):

bar = c d e
foo = bar f

piano: foo

But this fails with Unrecognized event: :name because the reference to bar isn't getting disambiguated from a "name" token into a "get variable" token.

bar = c d e
foo = bar

piano: foo

Should have a fix out shortly!

@daveyarwood daveyarwood changed the title voices with variables in variable definitions Parse error involving variables within variable definitions Mar 1, 2018
@daveyarwood
Copy link
Member

Fixed in 1.0.0-rc80.

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

No branches or pull requests

2 participants