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

Support array literals in #each blocks #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

savetheclocktower
Copy link

@savetheclocktower savetheclocktower commented Jan 8, 2024

Fixes #48.

I failed to find a comprehensive spec for #each, but experimentation in the REPL shows that it can take any sort of array literal, any sort of string, or a single identifier. (There may be more valid input, but someone else can explore those edge cases.)

String literals were already valid, so it was just a matter of consuming everything between balanced [ and ]. (Just for #each, though; array literals are not valid in #await.)

Originally I had it so that the calls to scan_for_balanced_character would inspect the returned boolean and return false themselves if they got a false value — i.e., bailing early from a catastrophic parsing failure instead of proceeding to the end of the file. But this broke the test case in random.txt, so I reverted that change.

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.

each_start_expr cannot parse array of strings
1 participant