diff --git a/Project.toml b/Project.toml index c5594ec2..bc83aa5f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "JuliaSyntax" uuid = "70703baa-626e-46a2-a12c-08ffd08c73b4" authors = ["Chris Foster and contributors"] -version = "0.3.4" +version = "0.3.5" [compat] julia = "1.0" diff --git a/src/expr.jl b/src/expr.jl index 61ec2e75..7efe9a55 100644 --- a/src/expr.jl +++ b/src/expr.jl @@ -11,7 +11,7 @@ function is_stringchunk(node) return k == K"String" || k == K"CmdString" end -function reorder_parameters!(args, params_pos) +function reorder_parameters!(args::Vector{Any}, params_pos) p = 0 for i = length(args):-1:1 if !Meta.isexpr(args[i], :parameters) @@ -24,7 +24,7 @@ function reorder_parameters!(args, params_pos) end # nest frankentuples parameters sections for i = length(args)-1:-1:p - pushfirst!(args[i].args, pop!(args)) + pushfirst!((args[i]::Expr).args, pop!(args)) end # Move parameters to args[params_pos] insert!(args, params_pos, pop!(args)) diff --git a/src/kinds.jl b/src/kinds.jl index 3b5fa1bd..24bab68e 100644 --- a/src/kinds.jl +++ b/src/kinds.jl @@ -1062,7 +1062,7 @@ function untokenize(k::Kind; unique=true) end # Error kind => description -_token_error_descriptions = Dict{Kind, String}( +const _token_error_descriptions = Dict{Kind, String}( K"ErrorEofMultiComment" => "unterminated multi-line comment #= ... =#", K"ErrorInvalidNumericConstant" => "invalid numeric constant", K"ErrorHexFloatMustContainP" => "hex float literal must contain `p` or `P`", diff --git a/src/parse_stream.jl b/src/parse_stream.jl index 2189da23..580c246d 100644 --- a/src/parse_stream.jl +++ b/src/parse_stream.jl @@ -717,7 +717,7 @@ example TODO: Are these the only cases? Can we replace this general utility with a simpler one which only splits preceding dots? """ -function bump_split(stream::ParseStream, split_spec...) +function bump_split(stream::ParseStream, split_spec::Vararg{Any, N}) where {N} tok = stream.lookahead[stream.lookahead_index] stream.lookahead_index += 1 b = _next_byte(stream)