Skip to content

fix: reserved word substrings #263

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

Merged
merged 2 commits into from
Apr 11, 2025
Merged

Conversation

lucascolley
Copy link
Contributor

closes gh-256

@@ -177,10 +177,10 @@ Stdout = ${ "|" ~ !"|" ~ !"&"}
StdoutStderr = { "|&" }

RESERVED_WORD = _{
If | Then | Else | Elif | Fi | Do | Done |
(If | Then | Else | Elif | Fi | Done | Do |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still a little fragile—"done" needs to be checked for match before "do"

@wolfv
Copy link
Member

wolfv commented Apr 8, 2025

Awesome!

// Test that there is no panic (prefix-dev/shell#256)
TestBuilder::new()
.command(r#"find . -name 'platform*'"#)
.assert_exit_code(1)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the exit code can vary between 0 and 1, we just want to test that it doesn't panic. Not sure how best to do that in this framework

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use a non existing command and check whether it's a parse error or command not found?

Like finotexists bla?

@wolfv wolfv merged commit 38a1830 into prefix-dev:main Apr 11, 2025
7 of 8 checks passed
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.

find . -name 'platform*' fails to parse
2 participants