Skip to main content

create_mod_v2

Function create_mod_v2 

Source
pub fn create_mod_v2(
    ctx: &mut AnalysisContext,
    parent: &SymbolPath,
    mod_name: &str,
    content: &str,
    is_pub: bool,
) -> ExecutionResult
Expand description

Create a new module with content (V2 ASTRegistry-based)

This operation:

  1. Parses the content to extract items
  2. Registers each item under parent::mod_name::item_name
  3. Adds a mod declaration (mod xxx; or pub mod xxx;) to the parent