Skip to content

Commit

Permalink
fix JuliaLang#37656: don't always error on space before ' (JuliaLang#…
Browse files Browse the repository at this point in the history
  • Loading branch information
simeonschaub authored Sep 22, 2020
1 parent f6a8dcb commit 9b4f473
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/julia-parser.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1238,10 +1238,11 @@
,@(cddr name))
`(|.| ,ex (quote ,name))))))))
((|'|)
(if (ts:space? s)
(error (string "space not allowed before \"" t "\"")))
(take-token s)
(loop (list t ex)))
(if (not (ts:space? s))
(begin
(take-token s)
(loop (list t ex)))
ex))
((|.'|) (error "the \".'\" operator is discontinued"))
((#\{ )
(disallow-space s ex t)
Expand Down
3 changes: 3 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2342,3 +2342,6 @@ else
end

@test :(a +ꜝ b) == Expr(:call, :+ꜝ, :a, :b)

# issue #37656
@test :(if true 'a' else 1 end) == Expr(:if, true, quote 'a' end, quote 1 end)

0 comments on commit 9b4f473

Please sign in to comment.