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

fix #20406, parse infix ~ as a normal operator #20420

Merged
merged 1 commit into from
Feb 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ This section lists changes that do not have deprecation warnings.
* In macro calls with parentheses, e.g. `@m(a=1)`, assignments are now parsed as
`=` expressions, instead of as `kw` expressions. ([#7669])

* When used as an infix operator, `~` is now parsed as a call to an ordinary operator
with assignment precedence, instead of as a macro call. ([#20406])

* (µ "micro" and ɛ "latin epsilon") are considered equivalent to
the corresponding Greek characters in identifiers. `\varepsilon`
now tab-completes to U+03B5 (greek small letter epsilon) ([#19464]).
Expand Down
1 change: 0 additions & 1 deletion doc/src/devdocs/ast.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ call. Finally, chains of comparisons have their own special expression structure
| `x"y"z` | `(macrocall @x_str "y" "z")` |
| `"x = $x"` | `(string "x = " x)` |
| ``` `a b c` ``` | `(macrocall @cmd "a b c")` |
| `x ~ distr` | `(macrocall @~ x distr)` |

Doc string syntax:

Expand Down
4 changes: 1 addition & 3 deletions src/julia-parser.scm
Original file line number Diff line number Diff line change
Expand Up @@ -754,9 +754,7 @@
(not (eqv? (peek-char (ts:port s)) #\ )))
(begin (ts:put-back! s t)
ex)
(let ((args (parse-chain s down '~)))
`(macrocall @~ ,ex ,@(butlast args)
,(loop (last args) (peek-token s)))))
(list 'call t ex (parse-assignment s down)))
(list t ex (parse-assignment s down)))))))

(define (parse-eq s)
Expand Down