Skip to content

Commit

Permalink
Merge pull request #499 from JuliaLang/fe/backports-0.4.10
Browse files Browse the repository at this point in the history
Backports for release 0.4.10
  • Loading branch information
fredrikekre authored Sep 2, 2024
2 parents 7e444ae + 08b1126 commit 09576ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "JuliaSyntax"
uuid = "70703baa-626e-46a2-a12c-08ffd08c73b4"
authors = ["Claire Foster <[email protected]> and contributors"]
version = "0.4.9"
version = "0.4.10"

[compat]
julia = "1.0"
Expand Down
6 changes: 3 additions & 3 deletions src/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ function parse_block(ps::ParseState, down=parse_eq, mark=position(ps))
end

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

Expand Down Expand Up @@ -1585,7 +1585,7 @@ function parse_call_chain(ps::ParseState, mark, is_macrocall=false)
ckind == K"vcat" ? K"typed_vcat" :
ckind == K"comprehension" ? K"typed_comprehension" :
ckind == K"ncat" ? K"typed_ncat" :
internal_error("unrecognized kind in parse_cat ", ckind)
internal_error("unrecognized kind in parse_cat ", string(ckind))
emit(ps, mark, outk, cflags)
check_ncat_compat(ps, mark, ckind)
end
Expand Down Expand Up @@ -2011,7 +2011,7 @@ function parse_resword(ps::ParseState)
elseif word == K"do"
bump(ps, TRIVIA_FLAG, error="invalid `do` syntax")
else
internal_error("unhandled reserved word ", word)
internal_error("unhandled reserved word ", string(word))
end
end

Expand Down
5 changes: 2 additions & 3 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ _unsafe_wrap_substring(s) = (s.offset, unsafe_wrap(Vector{UInt8}, s.string))
#--------------------------------------------------
#
# Internal error, used as assertion failure for cases we expect can't happen.
@noinline function internal_error(strs...)
@noinline function internal_error(strs::Vararg{String, N}) where {N}
error("Internal error: ", strs...)
end

# Like @assert, but always enabled and calls internal_error()
macro check(ex, msgs...)
msg = isempty(msgs) ? ex : msgs[1]
if isa(msg, AbstractString)
msg = msg
msg = String(msg)
elseif !isempty(msgs) && (isa(msg, Expr) || isa(msg, Symbol))
msg = :(string($(esc(msg))))
else
Expand Down Expand Up @@ -133,4 +133,3 @@ function _printstyled(io::IO, text; fgcolor=nothing, bgcolor=nothing, href=nothi
first = false
end
end

2 comments on commit 09576ca

@fredrikekre
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/114343

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.10 -m "<description of version>" 09576ca6b8b11d0888e6fce855ae188d0b3a6737
git push origin v0.4.10

Please sign in to comment.