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

parser: dollar expansions and multiple #define on the same line #230

Merged
merged 5 commits into from
May 16, 2020

Conversation

jpcima
Copy link
Collaborator

@jpcima jpcima commented May 14, 2020

This fixes some parsing problems, preventing some real files being read correctly.
Tests included.

  • in case of a possibly ambiguous $ expansion, the shorter existing variable name wins (ARIA)
  • support of #define $foo 1 #define $bar 2 all on the same line
    this is done by factorizing the code which extracts the opcode value with look-ahead, and this does the same work in presence of #define
    did the same as ARIA, which consists in extracting only the first word

@jpcima jpcima requested a review from paulfd May 14, 2020 18:51
@jpcima jpcima marked this pull request as draft May 15, 2020 07:05
@jpcima jpcima force-pushed the parser-definitions branch from 08c22ea to a138b93 Compare May 15, 2020 07:40
@jpcima jpcima marked this pull request as ready for review May 15, 2020 07:41
@jpcima
Copy link
Collaborator Author

jpcima commented May 15, 2020

  • Identified a regression
  • fixed, and added the matching test case

@jpcima jpcima mentioned this pull request May 15, 2020
4 tasks
@jpcima
Copy link
Collaborator Author

jpcima commented May 15, 2020

The last commit is an addition that fixes some cases found in Salander Grand Piano where directives and opcode values are all on the same line.

Example

<group> #define $VEL v1 lovel=1 hivel=26 #include "Data/region.txt"

@jpcima jpcima marked this pull request as draft May 15, 2020 13:11
@jpcima jpcima force-pushed the parser-definitions branch from e892bc7 to 4b8eaeb Compare May 15, 2020 13:19
@jpcima jpcima marked this pull request as ready for review May 15, 2020 13:19
@jpcima
Copy link
Collaborator Author

jpcima commented May 15, 2020

Fixed a small mistake. apologies for spam
Parsing sfz is delicate and always new annoyances are found, but that's no secret at this point.

Salamander and Naked Drums should both work (together with the other small side PRs)

@jpcima jpcima merged commit 30d5d7a into sfztools:develop May 16, 2020
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

Successfully merging this pull request may close these issues.

1 participant