Skip to content

Commit 09576ca

Browse files
authored
Merge pull request #499 from JuliaLang/fe/backports-0.4.10
Backports for release 0.4.10
2 parents 7e444ae + 08b1126 commit 09576ca

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "JuliaSyntax"
22
uuid = "70703baa-626e-46a2-a12c-08ffd08c73b4"
33
authors = ["Claire Foster <[email protected]> and contributors"]
4-
version = "0.4.9"
4+
version = "0.4.10"
55

66
[compat]
77
julia = "1.0"

src/parser.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ function parse_block(ps::ParseState, down=parse_eq, mark=position(ps))
475475
end
476476

477477
# Parse a block, but leave emitting the block up to the caller.
478-
function parse_block_inner(ps::ParseState, down)
478+
function parse_block_inner(ps::ParseState, down::F) where {F <: Function}
479479
parse_Nary(ps, down, KSet"NewlineWs ;", KSet"end else elseif catch finally")
480480
end
481481

@@ -1585,7 +1585,7 @@ function parse_call_chain(ps::ParseState, mark, is_macrocall=false)
15851585
ckind == K"vcat" ? K"typed_vcat" :
15861586
ckind == K"comprehension" ? K"typed_comprehension" :
15871587
ckind == K"ncat" ? K"typed_ncat" :
1588-
internal_error("unrecognized kind in parse_cat ", ckind)
1588+
internal_error("unrecognized kind in parse_cat ", string(ckind))
15891589
emit(ps, mark, outk, cflags)
15901590
check_ncat_compat(ps, mark, ckind)
15911591
end
@@ -2011,7 +2011,7 @@ function parse_resword(ps::ParseState)
20112011
elseif word == K"do"
20122012
bump(ps, TRIVIA_FLAG, error="invalid `do` syntax")
20132013
else
2014-
internal_error("unhandled reserved word ", word)
2014+
internal_error("unhandled reserved word ", string(word))
20152015
end
20162016
end
20172017

src/utils.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ _unsafe_wrap_substring(s) = (s.offset, unsafe_wrap(Vector{UInt8}, s.string))
1919
#--------------------------------------------------
2020
#
2121
# Internal error, used as assertion failure for cases we expect can't happen.
22-
@noinline function internal_error(strs...)
22+
@noinline function internal_error(strs::Vararg{String, N}) where {N}
2323
error("Internal error: ", strs...)
2424
end
2525

2626
# Like @assert, but always enabled and calls internal_error()
2727
macro check(ex, msgs...)
2828
msg = isempty(msgs) ? ex : msgs[1]
2929
if isa(msg, AbstractString)
30-
msg = msg
30+
msg = String(msg)
3131
elseif !isempty(msgs) && (isa(msg, Expr) || isa(msg, Symbol))
3232
msg = :(string($(esc(msg))))
3333
else
@@ -133,4 +133,3 @@ function _printstyled(io::IO, text; fgcolor=nothing, bgcolor=nothing, href=nothi
133133
first = false
134134
end
135135
end
136-

0 commit comments

Comments
 (0)