From 81835ad92a20243021412f3034aeaeb0813d63a8 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Mon, 30 Jul 2018 19:44:22 -0400 Subject: [PATCH] parse assignment as keyword args inside indexing fixes #25631 --- src/julia-parser.scm | 2 +- src/julia-syntax.scm | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/julia-parser.scm b/src/julia-parser.scm index 6c47f69e23cb30..923af3309ef60e 100644 --- a/src/julia-parser.scm +++ b/src/julia-parser.scm @@ -1185,7 +1185,7 @@ (if (null? al) (loop (list 'ref ex)) (case (car al) - ((vect) (loop (list* 'ref ex (cdr al)))) + ((vect) (loop (list* 'ref ex (map =-to-kw (cdr al))))) ((hcat) (loop (list* 'typed_hcat ex (cdr al)))) ((vcat) (loop (list* 'typed_vcat ex (cdr al)))) diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index 9ea65f4593456a..47001857a4e37b 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -1954,8 +1954,6 @@ (let ((a (cadr lhs)) (idxs (cddr lhs)) (rhs (caddr e))) - (if (any assignment? idxs) - (syntax-deprecation "assignment inside indexing" "" #f)) (let* ((reuse (and (pair? a) (contains (lambda (x) (eq? x 'end)) idxs))) @@ -2010,8 +2008,6 @@ 'ref (lambda (e) (let ((args (cddr e))) - (if (any assignment? args) - (syntax-deprecation "assignment inside indexing" "" #f)) (if (has-parameters? args) (error "unexpected semicolon in array expression") (expand-forms (partially-expand-ref e)))))