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

Parsing arithmetic expansion #35

Merged
merged 7 commits into from
May 4, 2021
Merged

Parsing arithmetic expansion #35

merged 7 commits into from
May 4, 2021

Conversation

magicant
Copy link
Owner

@magicant magicant commented May 1, 2021

  • Define syntax
  • Define errors for arithmetic expansion parser
  • Implement a version of Lexer::text that handles nested parentheses
  • Implement Lexer::arithmetic_expansion
  • Call Lexer::arithmetic_expansion from Lexer::dollar_word_unit
  • syntax.rs: TODO Arithmetic expansion in text_unquote_with_quotes

https://github.com/magicant/yash/blob/150f39d8dc4dd32af9ce54d53dfdec5df2ae7ea3/tests/arith-y.tst#L5-L8

POSIX says, "The expression shall be treated as if it were in double-quotes, except that a double-quote inside the expression is not treated specially." This means single- and double-quotes are not special and backslashes are special only before a dollar, backquote, backslash, or newline.

@magicant magicant self-assigned this May 1, 2021
@magicant magicant marked this pull request as ready for review May 4, 2021 14:15
@magicant magicant merged commit 1edea48 into master May 4, 2021
@magicant magicant deleted the arith_parser branch May 4, 2021 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant