Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/expr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function _string_to_Expr(args)
# """\n a\n b""" ==> "a\nb"
return only(args2)
else
# This only happens when the kind is K"string" or when an error has occurred.
# This only happens when the kind is K"string" or when an error has occurred.
return Expr(:string, args2...)
end
end
Expand All @@ -159,7 +159,7 @@ function _fixup_Expr_children!(head, loc, args)
arg = args[i]
was_parens = @isexpr(arg, :parens)
arg = _strip_parens(arg)
if @isexpr(arg, :(=)) && eq_to_kw_in_call && i > 1
if @isexpr(arg, :(=)) && eq_to_kw_in_call && i > 1
arg = Expr(:kw, arg.args...)
elseif k != K"parens" && @isexpr(arg, :., 1) && arg.args[1] isa Tuple
h, a = arg.args[1]::Tuple{SyntaxHead,Any}
Expand Down
3 changes: 3 additions & 0 deletions src/hooks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ end

_default_system_parser = _has_v1_6_hooks ? Core._parse : nothing

# hook into InteractiveUtils.@activate
activate!(enable=true) = enable_in_core!(enable)

"""
enable_in_core!([enable=true; freeze_world_age=true, debug_filename=nothing])

Expand Down
3 changes: 2 additions & 1 deletion src/syntax_tree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ numchildren(node::TreeNode) = (isnothing(node.children) ? 0 : length(node.childr
Base.getindex(node::AbstractSyntaxNode, i::Int) = children(node)[i]
Base.getindex(node::AbstractSyntaxNode, rng::UnitRange) = view(children(node), rng)
Base.firstindex(node::AbstractSyntaxNode) = 1
Base.lastindex(node::AbstractSyntaxNode) = length(children(node))
Base.length(node::AbstractSyntaxNode) = length(children(node))
Base.lastindex(node::AbstractSyntaxNode) = length(node)

function Base.setindex!(node::SN, x::SN, i::Int) where {SN<:AbstractSyntaxNode}
children(node)[i] = x
Expand Down
Loading