pub struct AstConfig {Show 13 fields
pub imports: Vec<String>,
pub result_type: Option<String>,
pub span_type: Option<String>,
pub string_type: Option<String>,
pub error_type: Option<String>,
pub generate_parse_result: bool,
pub generate_span: bool,
pub generate_parse_error: bool,
pub apply_mappings: bool,
pub string_dict_type: Option<String>,
pub string_dict_method: Option<String>,
pub helper_code: Vec<String>,
pub result_variants: Vec<ResultVariant>,
}Expand description
Configuration for AST integration
Fields§
§imports: Vec<String>External modules to import (e.g., “crate::ast::*”)
result_type: Option<String>Return type of the parse() function
span_type: Option<String>External span type to use instead of generated Span
string_type: Option<String>External string type to use instead of String (e.g., “JsString”)
error_type: Option<String>External error type to use instead of generated ParseError
generate_parse_result: boolWhether to generate the internal ParseResult enum (default: true)
generate_span: boolWhether to generate the internal Span struct (default: true)
generate_parse_error: boolWhether to generate the internal ParseError struct (default: true)
apply_mappings: boolWhether to apply AST mappings during parsing (default: false)
string_dict_type: Option<String>String dictionary type for string interning (e.g., “StringDict”)
string_dict_method: Option<String>Method to call on string dict to intern a string (default: “get_or_insert”)
helper_code: Vec<String>Helper functions to include in generated code
result_variants: Vec<ResultVariant>Custom ParseResult variants for typed AST nodes