Skip to content

Commit

Permalink
Allow juxtaposition of macro and array literal
Browse files Browse the repository at this point in the history
  • Loading branch information
cdsousa committed Sep 1, 2017
1 parent 99173bb commit 486239f
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/julia-parser.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1157,16 +1157,18 @@
;; ref(a,i) = x
(let* ((es end-symbol)
(al (with-end-symbol (parse-cat s #\] es))))
(if (null? al)
(loop (list 'ref ex))
(case (car al)
((vect) (loop (list* 'ref ex (cdr al))))
((hcat) (loop (list* 'typed_hcat ex (cdr al))))
((vcat)
(loop (list* 'typed_vcat ex (cdr al))))
((comprehension)
(loop (list* 'typed_comprehension ex (cdr al))))
(else (error "unknown parse-cat result (internal error)"))))))
(if macrocall?
(list 'call ex al)
(if (null? al)
(loop (list 'ref ex))
(case (car al)
((vect) (loop (list* 'ref ex (cdr al))))
((hcat) (loop (list* 'typed_hcat ex (cdr al))))
((vcat)
(loop (list* 'typed_vcat ex (cdr al))))
((comprehension)
(loop (list* 'typed_comprehension ex (cdr al))))
(else (error "unknown parse-cat result (internal error)")))))))
((|.|)
(if (ts:space? s) (disallowed-space ex t))
(take-token s)
Expand Down

0 comments on commit 486239f

Please sign in to comment.