Skip to content

Commit 3ab8589

Browse files
committed
Move disable_in_core!() -> enable_in_core!(false)
This reduces the number of functions by one.
1 parent 6d446bb commit 3ab8589

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

src/hooks.jl

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,13 @@ flisp parser for all parsing work.
6666
6767
That is, JuliaSyntax will be used for `include()` `Meta.parse()`, the REPL, etc.
6868
"""
69-
function enable_in_core!()
70-
# TODO: Use invoke_in_world to freeze the world age at the time this was enabled.
71-
Base.eval(Core, :(_parse = $core_parser_hook))
72-
nothing
73-
end
74-
75-
"""
76-
Revert to the flisp parser for all parsing work.
77-
"""
78-
function disable_in_core!()
79-
Base.eval(Core, :(_parse = Core.Compiler.fl_parse))
69+
function enable_in_core!(enable=true)
70+
if enable
71+
# TODO: Use invoke_in_world to freeze the world age at the time this was enabled.
72+
Base.eval(Core, :(_parse = $core_parser_hook))
73+
else
74+
Base.eval(Core, :(_parse = Core.Compiler.fl_parse))
75+
end
8076
nothing
8177
end
8278

test/hooks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
# Meta.ParseError when Core integration is enabled.
1313
@test_throws JuliaSyntax.ParseError Meta.parse("[x")
1414

15-
JuliaSyntax.disable_in_core!()
15+
JuliaSyntax.enable_in_core!(false)
1616
end

0 commit comments

Comments
 (0)