136136# Debug log file for dumping parsed code
137137const _debug_log = Ref {Union{Nothing,IO}} (nothing )
138138
139- function core_parser_hook_for_lowering (code, filename:: String , lineno:: Int , offset:: Int , options:: Symbol )
140- core_parser_hook (code, filename:: String , lineno:: Int , offset:: Int , options:: Symbol , true )
141- end
142-
143139function core_parser_hook (code, filename:: String , lineno:: Int , offset:: Int , options:: Symbol , for_lowering= false )
144140 try
145141 # TODO : Check that we do all this input wrangling without copying the
@@ -237,7 +233,7 @@ function core_parser_hook(code, filename::String, lineno::Int, offset::Int, opti
237233 #
238234 # show_diagnostics(stdout, stream.diagnostics, code)
239235 #
240- ex = build_tree (for_lowering ? Tuple{Expr, SyntaxNode} : Expr, stream; filename= filename, first_line= lineno)
236+ ex = build_tree (Expr, stream; filename= filename, first_line= lineno)
241237 end
242238
243239 # Note the next byte in 1-based indexing is `last_byte(stream) + 1` but
294290
295291_default_system_parser = _has_v1_6_hooks ? Core. _parse : nothing
296292
297-
298293# hook into InteractiveUtils.@activate
299- activate! (enable= true ; for_lowering = false ) = enable_in_core! (enable, for_lowering )
294+ activate! (enable= true ) = enable_in_core! (enable)
300295
301296"""
302297 enable_in_core!([enable=true; freeze_world_age=true, debug_filename=nothing])
@@ -312,7 +307,7 @@ Keyword arguments:
312307* `debug_filename` - File name of parser debug log (defaults to `nothing` or
313308 the value of `ENV["JULIA_SYNTAX_DEBUG_FILE"]`).
314309"""
315- function enable_in_core! (enable= true , for_lowering = false ; freeze_world_age = true ,
310+ function enable_in_core! (enable= true ; freeze_world_age = true ,
316311 debug_filename = get (ENV , " JULIA_SYNTAX_DEBUG_FILE" , nothing ))
317312 if ! _has_v1_6_hooks
318313 error (" Cannot use JuliaSyntax as the main Julia parser in Julia version $VERSION < 1.6" )
@@ -324,9 +319,8 @@ function enable_in_core!(enable=true, for_lowering=false; freeze_world_age = tru
324319 _debug_log[] = nothing
325320 end
326321 if enable
327- hook = for_lowering ? core_parser_hook_for_lowering : core_parser_hook
328322 world_age = freeze_world_age ? Base. get_world_counter () : typemax (UInt)
329- _set_core_parse_hook (fix_world_age (hook , world_age))
323+ _set_core_parse_hook (fix_world_age (core_parser_hook , world_age))
330324 else
331325 @assert ! isnothing (_default_system_parser)
332326 _set_core_parse_hook (_default_system_parser)
0 commit comments