l0_cli_commands.py

l0_cli_commands.py

Module: l0_cli_commands

Source: compiler/stage1_py/l0_cli_commands.py Language: Python

Symbols

Namespace l0_cli_commands

Function l0_cli_commands._get_module_names

1
list[str] l0_cli_commands._get_module_names(argparse.Namespace args, CompilationUnit cu)

Get the list of module names based on the –all-modules flag.

Parameters:

  • args: Parsed command-line arguments.
  • cu: The compilation unit.

Returns: A list of module names to process.

Function l0_cli_commands.cmd_codegen

1
int l0_cli_commands.cmd_codegen(argparse.Namespace args)

Generate C code for a module.

Parameters:

  • args: Parsed command-line arguments.

Returns: Exit code (0 for success, non-zero for failure).

Function l0_cli_commands.cmd_check

1
int l0_cli_commands.cmd_check(argparse.Namespace args)

Run analysis and type checking without code generation.

Parameters:

  • args: Parsed command-line arguments.

Returns: Exit code (0 for success, non-zero for failure).

Function l0_cli_commands.cmd_compile

1
int l0_cli_commands.cmd_compile(argparse.Namespace args)

Report that separate compilation is not implemented in Stage 1 yet.

Parameters:

  • args: Parsed command-line arguments.

Returns: Exit code 1.

Function l0_cli_commands.cmd_ast

1
int l0_cli_commands.cmd_ast(argparse.Namespace args)

Pretty-print the parsed AST.

By default, prints only the entry module. With all-modules, prints every module in the compilation unit.

Parameters:

  • args: Parsed command-line arguments.

Returns: Exit code (0 for success, non-zero for failure).

Function l0_cli_commands._format_token_dump_text

1
str l0_cli_commands._format_token_dump_text(tok)

Return token payload text for –tok output.

Function l0_cli_commands._dump_tokens_for_file

1
int l0_cli_commands._dump_tokens_for_file(Path path, bool include_eof)

Dump lexer tokens for a single file.

Parameters:

  • path: Path to the source file.
  • include_eof: Whether to include the EOF token in the output.

Returns: Exit code (0 for success, non-zero for failure).

Function l0_cli_commands.cmd_tok

1
int l0_cli_commands.cmd_tok(argparse.Namespace args)

Dump lexer tokens.

By default, dumps tokens for the entry module only. With all-modules, dumps tokens for all modules in the compilation unit.

Parameters:

  • args: Parsed command-line arguments.

Returns: Exit code (0 for success, non-zero for failure).

Function l0_cli_commands.cmd_sym

1
int l0_cli_commands.cmd_sym(argparse.Namespace args)

Dump module-level symbol tables.

By default, dumps symbols only for the entry module. With all-modules, dumps symbols for all modules in the compilation unit.

Parameters:

  • args: Parsed command-line arguments.

Returns: Exit code (0 for success, non-zero for failure).

Function l0_cli_commands.cmd_type

1
int l0_cli_commands.cmd_type(argparse.Namespace args)

Dump resolved type information.

Dumps function signatures, struct field types, enum variant payloads, and type aliases.

Parameters:

  • args: Parsed command-line arguments.

Returns: Exit code (0 for success, non-zero for failure).