wl
wl copied to clipboard
Infix function call support
In[1]:= a ~ b ~ c
2018/05/25 23:01:35 System`UnParsed: {Rune:126 Val: pos:7} ExpressionCase(136) &wl.Expression{
· Case: 136,
· Expression: &wl.Expression{
· · Case: 136,
· · Expression: &wl.Expression{
· · · Case: 139,
· · · Token: IDENT, "a",
· · },
· · Expression2: &wl.Expression{
· · · Case: 139,
· · · Token: IDENT, "b",
· · },
· · Token: '~',
· },
· Expression2: &wl.Expression{
· · Case: 139,
· · Token: IDENT, "c",
· },
· Token: '~',
}
exit status 1
Desired behavior:
In[56]:= a ~ b ~ c
Out[56]= b[a, c]
This might be best solved in interp.go in the expreduce package, instead of this parser. Perhaps if @cznic sees an easy way to perform this parsing using yacc then we can do it in this package. At least this package still produces a parsed result rather than a syntax error.
@corywalker
I'm fine with anything you consider a correct solution. I may become more actionable next week, feel free to push a fix if you have one, thanks.
This might be best solved in interp.go in the expreduce package, instead of this parser.
@corywalker Has the fix as suggested above been implemented and can this issue be closed?