MCPcopy Index your code
hub / github.com/RustPython/RustPython / eprint_location

Function eprint_location

crates/codegen/src/compile.rs:343–360  ·  view source on GitHub ↗
(zelf: &Compiler)

Source from the content-addressed store, hash-verified

341}
342
343fn eprint_location(zelf: &Compiler) {
344 let start = zelf
345 .source_file
346 .to_source_code()
347 .source_location(zelf.current_source_range.start(), PositionEncoding::Utf8);
348 let end = zelf
349 .source_file
350 .to_source_code()
351 .source_location(zelf.current_source_range.end(), PositionEncoding::Utf8);
352 eprintln!(
353 "LOCATION: {} from {}:{} to {}:{}",
354 zelf.source_file.name(),
355 start.line,
356 start.character_offset,
357 end.line,
358 end.character_offset
359 );
360}
361
362/// Better traceback for internal error
363#[track_caller]

Callers 2

unwrap_internalFunction · 0.85
compiler_unwrap_optionFunction · 0.85

Calls 3

source_locationMethod · 0.80
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected