From 8fd2afd79c48674c4e36db8d93f849217733644d Mon Sep 17 00:00:00 2001 From: aviatesk Date: Sat, 9 Nov 2019 18:23:21 +0900 Subject: [PATCH] update to https://github.com/MikeInnes/MacroTools.jl/pull/127 --- Project.toml | 3 ++- src/debugger/stepper.jl | 1 - src/refactor.jl | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index 20088d43..f503dc73 100644 --- a/Project.toml +++ b/Project.toml @@ -27,6 +27,7 @@ Profile = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" Requires = "ae029012-a4dd-5104-9daa-d747884805df" Sockets = "6462fe0b-24de-5631-8697-dd941f90decc" +SourceWalk = "2987fe4f-acca-4bd1-87ee-98b3d562f1a1" Traceur = "37b6cedf-1f77-55f8-9503-c64b63398394" TreeViews = "a2a6695c-b41b-5b7d-aed9-dbfdeacea5d7" WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" @@ -45,7 +46,7 @@ JuliaInterpreter = "^0.7.0" Juno = "^0.7.0" LNR = "^0.2.0" Lazy = "^0.13.2, ^0.14" -MacroTools = "^0.5" +MacroTools = "^0.5.1" Media = "^0.5" OrderedCollections = "^1.1" Requires = "^0.5" diff --git a/src/debugger/stepper.jl b/src/debugger/stepper.jl index a59cc4f5..7ea73a60 100644 --- a/src/debugger/stepper.jl +++ b/src/debugger/stepper.jl @@ -3,7 +3,6 @@ using JuliaInterpreter: pc_expr, extract_args, debug_command, root, caller, import JuliaInterpreter import ..Atom: fullpath, handle, @msg, Inline, display_error import Juno: Row -using MacroTools mutable struct DebuggerState frame::Union{Nothing, Frame} diff --git a/src/refactor.jl b/src/refactor.jl index 40c4384a..a5c987f9 100644 --- a/src/refactor.jl +++ b/src/refactor.jl @@ -1,3 +1,5 @@ +using SourceWalk: textwalk, sourcewalk + handle("renamerefactor") do data @destruct [ oldWord, @@ -91,9 +93,9 @@ function localrenamerefactor(oldword, newword, column, row, startrow, context, e scope === nothing && return "" currentcontext = scope.bindstr - newcontext = MacroTools.textwalk(currentcontext) do sym oldsym = Symbol(oldword) newsym = Symbol(newword) + newcontext = textwalk(currentcontext) do sym sym === oldsym ? newsym : sym end @@ -159,7 +161,7 @@ function _globalrenamerefactor(oldword, newword, mod, expr, files) for (i, file) ∈ enumerate(files) @logmsg -1 "Refactoring: $file ($i / $total)" progress=i/total _id=id - MacroTools.sourcewalk(file) do ex + sourcewalk(file) do ex if ex === oldsym push!(modifiedfiles, fullpath(file)) newsym