Skip to content

Commit

Permalink
Merge pull request #26154 from JuliaLang/jb/fix26137
Browse files Browse the repository at this point in the history
RFC: fix #26137, change parsing of unary ops on parenthesized expressions
  • Loading branch information
JeffBezanson authored Feb 27, 2018
2 parents b97d2f8 + 952361f commit 1e13b12
Show file tree
Hide file tree
Showing 5 changed files with 230 additions and 130 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ Language changes
* `=>` now has its own precedence level, giving it strictly higher precedence than
`=` and `,` ([#25391]).

* The conditions under which unary operators followed by `(` are parsed as prefix function
calls have changed ([#26154]).

* `begin` is disallowed inside indexing expressions, in order to enable the syntax
`a[begin]` (for selecting the first element) in the future ([#23354]).

Expand Down
5 changes: 3 additions & 2 deletions src/ast.scm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
(if (has-parameters? l)
(string (string.join (map deparse (cdr l)) sep)
(if (length= (cdr l) 1) "," "")
"; "
(string.join (map deparse (cdar l)) ", "))
(deparse (car l)))
(string.join (map deparse l) sep)))

(define (deparse-prefix-call head args opn cls)
Expand Down Expand Up @@ -95,6 +94,7 @@
(if (length= e 3)
(deparse (caddr e))
(deparse (cons 'braces (cddr e))))))
((parameters) (string "; " (deparse-arglist (cdr e))))
;; bracket forms
((tuple)
(string #\( (deparse-arglist (cdr e))
Expand Down Expand Up @@ -406,6 +406,7 @@
(eq? (cadr (caddr x)) 'Vararg)))))
(define (trans? x) (and (pair? x) (eq? (car x) '|.'|)))
(define (ctrans? x) (and (pair? x) (eq? (car x) '|'|)))
(define (linenum? x) (and (pair? x) (eq? (car x) 'line)))

(define (make-assignment l r) `(= ,l ,r))
(define (assignment? e) (and (pair? e) (eq? (car e) '=)))
Expand Down
Loading

2 comments on commit 1e13b12

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

Please sign in to comment.