Skip to main content

Module build_code_frame_error

Module build_code_frame_error 

Source

Structsยง

Cleaner ๐Ÿ”’
Visitor that normalizes AST by removing syntax contexts and type annotations. This allows for more reliable expression matching across different parsing contexts.
CodeFrame ๐Ÿ”’
ExpressionFinder ๐Ÿ”’
Visitor that searches for a specific expression in an AST. Uses discriminant matching for fast filtering before expensive eq_ignore_span checks.
TplConverter ๐Ÿ”’
Visitor that normalizes template literals and string concatenations. Helps match expressions that may be written differently in source vs AST.

Functionsยง

build_code_frame_error ๐Ÿ”’
build_code_frame_error_and_panic ๐Ÿ”’
compute_cache_key ๐Ÿ”’
Computes a cache key for an expression based on its type and structure
create_module ๐Ÿ”’
find_expression_span ๐Ÿ”’
Finds the span of a target expression within a program AST
get_memoized_frame_source_code ๐Ÿ”’
Gets or parses the source code as a Program AST, with memoization. Returns a cleaned and normalized Program that can be used for expression finding.
get_source_code ๐Ÿ”’
Gets the source code with the following priority:
get_span_from_source_code ๐Ÿ”’
Finds the span (source location) of a target expression within the source code. Uses caching to avoid redundant AST traversals for the same expression.
load_code_frame_from_cache ๐Ÿ”’
Loads a CodeFrame with the source file for error display
parse_and_normalize_program ๐Ÿ”’
Parses source code into a Program AST and normalizes it
print_module ๐Ÿ”’
print_program ๐Ÿ”’
read_source_file ๐Ÿ”’