Skip to content

Commit dcf331c

Browse files
committed
fix #20406, parse infix ~ as a normal operator
1 parent ad5cd7b commit dcf331c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

NEWS.md

+3
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ This section lists changes that do not have deprecation warnings.
112112
* In macro calls with parentheses, e.g. `@m(a=1)`, assignments are now parsed as
113113
`=` expressions, instead of as `kw` expressions. ([#7669])
114114

115+
* When used as an infix operator, `~` is now parsed as a call to an ordinary operator
116+
with assignment precedence, instead of as a macro call. ([#20406])
117+
115118
* (µ "micro" and ɛ "latin epsilon") are considered equivalent to
116119
the corresponding Greek characters in identifiers. `\varepsilon`
117120
now tab-completes to U+03B5 (greek small letter epsilon) ([#19464]).

doc/src/devdocs/ast.md

-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,6 @@ call. Finally, chains of comparisons have their own special expression structure
422422
| `x"y"z` | `(macrocall @x_str "y" "z")` |
423423
| `"x = $x"` | `(string "x = " x)` |
424424
| ``` `a b c` ``` | `(macrocall @cmd "a b c")` |
425-
| `x ~ distr` | `(macrocall @~ x distr)` |
426425

427426
Doc string syntax:
428427

src/julia-parser.scm

+1-3
Original file line numberDiff line numberDiff line change
@@ -754,9 +754,7 @@
754754
(not (eqv? (peek-char (ts:port s)) #\ )))
755755
(begin (ts:put-back! s t)
756756
ex)
757-
(let ((args (parse-chain s down '~)))
758-
`(macrocall @~ ,ex ,@(butlast args)
759-
,(loop (last args) (peek-token s)))))
757+
(list 'call t ex (parse-assignment s down)))
760758
(list t ex (parse-assignment s down)))))))
761759

762760
(define (parse-eq s)

0 commit comments

Comments
 (0)