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 bug with comma after typed arg #1850

Closed
Tracked by #1828 ...
andychu opened this issue Feb 26, 2024 · 1 comment
Closed
Tracked by #1828 ...

Parsing bug with comma after typed arg #1850

andychu opened this issue Feb 26, 2024 · 1 comment

Comments

@andychu
Copy link
Contributor

andychu commented Feb 26, 2024

I accidentally used , instead of ; here

$ proc buggy (; a, b) { pp line (a), pp line (b) }    # why does this parse
$ buggy (42, 43)                                                                                                                                                                                                                                                                                
(Int)   43

This is messed up

$ bin/ysh -n -c 'pp line (a), pp line (b)'
(command.Simple
  blame_tok: <pp>
  more_env: []
  words: [{<pp>} {<line>} {<Id.Lit_Comma ",">} {<pp>} {<line>}]
  redirects: []
  typed_args: 
    (ArgList
      left: <Id.Op_LParen _>
      pos_args: [(expr.Var name:<Id.Expr_Name b>)]
      named_args: []
      right: <Id.Op_RParen _>
    )
  do_fork: T
)

@andychu andychu added the bug label Feb 26, 2024
andychu pushed a commit that referenced this issue Feb 27, 2024
- issue #1850 - parsing command.Simple
- issue #1826 - crash with b'' literals and Id.Unknown_Tok
@andychu andychu mentioned this issue Feb 27, 2024
29 tasks
@andychu andychu mentioned this issue Mar 22, 2024
19 tasks
andychu pushed a commit that referenced this issue Apr 14, 2024
This is issue #1850.

Also enhance runproc test cases.  We want to add 'extern' as well.
andychu pushed a commit that referenced this issue Apr 14, 2024
This is issue #1850.  I stumbled across this bug while testing out YSH
myself.

We still allow redirects at the end, like

    json write (x) >out.txt
@andychu
Copy link
Contributor Author

andychu commented Jun 20, 2024

@andychu andychu closed this as completed Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant