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

Mininal awk code with omitted {} or ; does not work #49

Open
ghuls opened this issue Feb 5, 2021 · 1 comment
Open

Mininal awk code with omitted {} or ; does not work #49

ghuls opened this issue Feb 5, 2021 · 1 comment

Comments

@ghuls
Copy link
Contributor

ghuls commented Feb 5, 2021

Mininal awk code with omitted {} or ; does not work:

❯ frawk 'BEGIN { if (1 == 1) print "yes" }'
Unrecognized token `}` found at line 1, column 33:line 1, column 34
Expected one of "\n" or ";"

❯ frawk 'BEGIN { if (1 == 1) { print "yes" } }'
yes

❯ frawk 'BEGIN { if (1 == 1) print "yes"; }'
yes

Personally I always use the second way, but a lot of awk code omits braces.

@ezrosent
Copy link
Owner

ezrosent commented Feb 6, 2021

Thanks for filing this issue; I've run into this too when running other scripts. I tried to fix this once but never really got anywhere; It's been a while though so I'll try this again. There's nothing here that's super complicated, the parsing code is just a bit harder to modify than it ought to be.

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

2 participants