Skip to content

Commit

Permalink
better syntax errors for break / continue statements, closes #9358
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebolewski committed Jun 3, 2015
1 parent a0e503e commit b96d8cc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/julia-parser.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,14 @@
(if (or (eqv? t #\newline) (closing-token? t))
(list 'return '(null))
(list 'return (parse-eq s)))))
((break continue) (list word))
((break continue)
(let ((t (peek-token s)))
(if (or (eof-object? t)
(and (eq? t 'end) (not end-symbol))
(memv t '(#\newline #\; #\) :)))
(list word)
(error (string "unexpected \"" t "\" after " word)))))

((const)
(let ((assgn (parse-eq s)))
(if (not (and (pair? assgn)
Expand Down

0 comments on commit b96d8cc

Please sign in to comment.