From 569eb769e8bafbddbb2fef727d085f67f5884280 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Thu, 2 Feb 2017 18:53:25 -0500 Subject: [PATCH] fix #20406, parse infix `~` as a normal operator --- NEWS.md | 3 +++ src/julia-parser.scm | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index cff00ac489416c..98e0aa9a22ba7b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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]). diff --git a/src/julia-parser.scm b/src/julia-parser.scm index 43dd546c4b4b73..a6cae89d919275 100644 --- a/src/julia-parser.scm +++ b/src/julia-parser.scm @@ -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)