|
Zen-C
|


Go to the source code of this file.
Data Structures | |
| struct | ZenSymbol |
| Represents a symbol in the symbol table. More... | |
| struct | Scope |
| Represents a lexical scope (block). More... | |
| struct | FuncSig |
| Registry entry for a function signature. More... | |
| struct | LambdaRef |
| Tracks a lambda (anonymous function) within the parser. More... | |
| struct | GenericTemplate |
| Template for a generic struct. More... | |
| struct | GenericFuncTemplate |
| Template for a generic function. More... | |
| struct | GenericImplTemplate |
| Template for a generic implementation block. More... | |
| struct | ImportedFile |
| Represents an imported source file (to prevent cycles/duplication). More... | |
| struct | Instantiation |
| Tracks a concrete instantiation of a generic template. More... | |
| struct | StructRef |
| Reference to a parsed struct (list node). More... | |
| struct | StructDef |
| Definition of a struct (lookup cache). More... | |
| struct | SliceType |
| Track used slice types for generation. More... | |
| struct | TupleType |
| Track used tuple signatures for generation. More... | |
| struct | EnumVariantReg |
| Registry of enum variants. More... | |
| struct | DeprecatedFunc |
| Functions marked as deprecated. More... | |
| struct | Module |
| Represents a module (namespace/file). More... | |
| struct | SelectiveImport |
| Symbol imported via selective import (import { X }). More... | |
| struct | ImplReg |
| Registry for trait implementations. More... | |
| struct | ImportedPlugin |
| Loaded compiler plugin. More... | |
| struct | TypeAlias |
| Type alias definition. More... | |
| struct | ParserContext |
| Global compilation state and symbol table. More... | |
| struct | TypeUsage |
Macros | |
| #define | MAX_KNOWN_GENERICS 1024 |
Typedefs | |
| typedef struct ParserContext | ParserContext |
| typedef struct ZenSymbol | ZenSymbol |
| Represents a symbol in the symbol table. | |
| typedef struct Scope | Scope |
| Represents a lexical scope (block). | |
| typedef struct FuncSig | FuncSig |
| Registry entry for a function signature. | |
| typedef struct LambdaRef | LambdaRef |
| Tracks a lambda (anonymous function) within the parser. | |
| typedef struct GenericTemplate | GenericTemplate |
| Template for a generic struct. | |
| typedef struct GenericFuncTemplate | GenericFuncTemplate |
| Template for a generic function. | |
| typedef struct GenericImplTemplate | GenericImplTemplate |
| Template for a generic implementation block. | |
| typedef struct ImportedFile | ImportedFile |
| Represents an imported source file (to prevent cycles/duplication). | |
| typedef struct Instantiation | Instantiation |
| Tracks a concrete instantiation of a generic template. | |
| typedef struct StructRef | StructRef |
| Reference to a parsed struct (list node). | |
| typedef struct StructDef | StructDef |
| Definition of a struct (lookup cache). | |
| typedef struct SliceType | SliceType |
| Track used slice types for generation. | |
| typedef struct TupleType | TupleType |
| Track used tuple signatures for generation. | |
| typedef struct EnumVariantReg | EnumVariantReg |
| Registry of enum variants. | |
| typedef struct DeprecatedFunc | DeprecatedFunc |
| Functions marked as deprecated. | |
| typedef struct Module | Module |
| Represents a module (namespace/file). | |
| typedef struct SelectiveImport | SelectiveImport |
| Symbol imported via selective import (import { X }). | |
| typedef struct ImplReg | ImplReg |
| Registry for trait implementations. | |
| typedef struct ImportedPlugin | ImportedPlugin |
| Loaded compiler plugin. | |
| typedef struct TypeAlias | TypeAlias |
| Type alias definition. | |
| typedef struct TypeUsage | TypeUsage |
Enumerations | |
| enum | Precedence { PREC_NONE , PREC_ASSIGNMENT , PREC_TERNARY , PREC_OR , PREC_AND , PREC_EQUALITY , PREC_COMPARISON , PREC_TERM , PREC_FACTOR , PREC_UNARY , PREC_CALL , PREC_PRIMARY } |
| Operator precedence for expression parsing. More... | |
Functions | |
| ASTNode * | parse_program (ParserContext *ctx, Lexer *l) |
| Parses a program. | |
| void | register_type_usage (ParserContext *ctx, const char *name, Token t) |
| Registers a type usage. | |
| int | validate_types (ParserContext *ctx) |
| Validates types. | |
| char * | token_strdup (Token t) |
| Duplicates a token. | |
| int | is_token (Token t, const char *s) |
| Checks if a token matches a string. | |
| Token | expect (Lexer *l, TokenType type, const char *msg) |
| Expects a token of a specific type. | |
| void | skip_comments (Lexer *l) |
| Skips comments in the lexer. | |
| char * | consume_until_semicolon (Lexer *l) |
| Consumes tokens until a semicolon is found. | |
| char * | consume_and_rewrite (ParserContext *ctx, Lexer *l) |
| Consumes and rewrites tokens. | |
| int | is_c_reserved_word (const char *name) |
| Checks if a name is a C reserved word. | |
| void | warn_c_reserved_word (Token t, const char *name) |
| Warns about a C reserved word. | |
| void | enter_scope (ParserContext *ctx) |
| Enters a new scope (pushes to scope stack). | |
| void | exit_scope (ParserContext *ctx) |
| Exits the current scope (pops from scope stack). | |
| void | add_symbol (ParserContext *ctx, const char *n, const char *t, Type *type_info) |
| Adds a symbol to the current scope. | |
| void | add_symbol_with_token (ParserContext *ctx, const char *n, const char *t, Type *type_info, Token tok) |
| Adds a symbol with definition token location. | |
| Type * | find_symbol_type_info (ParserContext *ctx, const char *n) |
| Finds a symbol's type information. | |
| char * | find_symbol_type (ParserContext *ctx, const char *n) |
| Finds a symbol's type. | |
| ZenSymbol * | find_symbol_entry (ParserContext *ctx, const char *n) |
| Finds a symbol's entry. | |
| ZenSymbol * | find_symbol_in_all (ParserContext *ctx, const char *n) |
| Finds a symbol in all scopes. | |
| char * | find_similar_symbol (ParserContext *ctx, const char *name) |
| void | register_func (ParserContext *ctx, const char *name, int count, char **defaults, Type **arg_types, Type *ret_type, int is_varargs, int is_async, Token decl_token) |
| Registers a function. | |
| void | register_func_template (ParserContext *ctx, const char *name, const char *param, ASTNode *node) |
| Registers a function template. | |
| GenericFuncTemplate * | find_func_template (ParserContext *ctx, const char *name) |
| Finds a function template. | |
| void | register_generic (ParserContext *ctx, char *name) |
| Registers a known generic type parameter. | |
| int | is_known_generic (ParserContext *ctx, char *name) |
| Checks if a name is a known generic parameter. | |
| void | register_impl_template (ParserContext *ctx, const char *sname, const char *param, ASTNode *node) |
| void | add_to_struct_list (ParserContext *ctx, ASTNode *node) |
| void | add_to_enum_list (ParserContext *ctx, ASTNode *node) |
| void | add_to_func_list (ParserContext *ctx, ASTNode *node) |
| void | add_to_impl_list (ParserContext *ctx, ASTNode *node) |
| void | add_to_global_list (ParserContext *ctx, ASTNode *node) |
| void | register_builtins (ParserContext *ctx) |
| void | add_instantiated_func (ParserContext *ctx, ASTNode *fn) |
| void | instantiate_generic (ParserContext *ctx, const char *name, const char *concrete_type, const char *unmangled_type, Token t) |
| Instantiates a generic struct/function. | |
| void | instantiate_generic_multi (ParserContext *ctx, const char *name, char **args, int arg_count, Token t) |
| Instantiates a multi-parameter generic. | |
| char * | sanitize_mangled_name (const char *name) |
| Sanitizes a mangled name for use in codegen. | |
| TypeAlias * | find_type_alias_node (ParserContext *ctx, const char *name) |
| Registers a type alias. | |
| void | register_type_alias (ParserContext *ctx, const char *alias, const char *original, int is_opaque, const char *defined_in_file) |
| void | register_impl (ParserContext *ctx, const char *trait, const char *strct) |
| Registers an implementation. | |
| int | check_impl (ParserContext *ctx, const char *trait, const char *strct) |
| Checks if a type implements a trait. | |
| void | register_template (ParserContext *ctx, const char *name, ASTNode *node) |
| Registers a template. | |
| void | register_deprecated_func (ParserContext *ctx, const char *name, const char *reason) |
| Registers a deprecated function. | |
| DeprecatedFunc * | find_deprecated_func (ParserContext *ctx, const char *name) |
| Finds a deprecated function. | |
| ASTNode * | parse_arrow_lambda_single (ParserContext *ctx, Lexer *l, char *param_name) |
| Parses a single parameter arrow lambda. | |
| ASTNode * | parse_arrow_lambda_multi (ParserContext *ctx, Lexer *l, char **param_names, int num_params) |
| Parses a multi-parameter arrow lambda. | |
| char * | parse_and_convert_args (ParserContext *ctx, Lexer *l, char ***defaults_out, int *count_out, Type ***types_out, char ***names_out, int *is_varargs_out, char ***ctype_overrides_out) |
| Parses and converts arguments. | |
| int | is_file_imported (ParserContext *ctx, const char *path) |
| Checks if a file has been imported. | |
| void | mark_file_imported (ParserContext *ctx, const char *path) |
| Marks a file as imported. | |
| void | register_plugin (ParserContext *ctx, const char *name, const char *alias) |
| Registers a plugin. | |
| const char * | resolve_plugin (ParserContext *ctx, const char *name_or_alias) |
| Resolves a plugin by name or alias. | |
| void | print_type_defs (ParserContext *ctx, FILE *out, ASTNode *nodes) |
| Prints type definitions to a file. | |
| char * | replace_in_string (const char *src, const char *old_w, const char *new_w) |
| Replaces a substring in a string. | |
| char * | replace_type_str (const char *src, const char *param, const char *concrete, const char *old_struct, const char *new_struct) |
| Replaces a type string in a string. | |
| Type * | replace_type_formal (Type *t, const char *p, const char *c, const char *os, const char *ns) |
| Replaces a type formal in a type. | |
| ASTNode * | copy_ast_replacing (ASTNode *n, const char *p, const char *c, const char *os, const char *ns) |
| Copies an AST node and replaces its type parameters. | |
| char * | extract_module_name (const char *path) |
| void | register_enum_variant (ParserContext *ctx, const char *ename, const char *vname, int tag) |
| Registers an enum variant. | |
| EnumVariantReg * | find_enum_variant (ParserContext *ctx, const char *vname) |
| Finds an enum variant. | |
| void | register_lambda (ParserContext *ctx, ASTNode *node) |
| Registers a lambda. | |
| void | analyze_lambda_captures (ParserContext *ctx, ASTNode *lambda) |
| Analyzes lambda captures. | |
| void | register_slice (ParserContext *ctx, const char *type) |
| Registers a slice type. | |
| void | register_tuple (ParserContext *ctx, const char *sig) |
| Registers a tuple type. | |
| ASTNode * | find_struct_def (ParserContext *ctx, const char *name) |
| Finds a struct definition. | |
| void | register_struct_def (ParserContext *ctx, const char *name, ASTNode *node) |
| Registers a struct definition. | |
| Module * | find_module (ParserContext *ctx, const char *alias) |
| Finds a module. | |
| void | register_module (ParserContext *ctx, const char *alias, const char *path) |
| Registers a module. | |
| void | register_selective_import (ParserContext *ctx, const char *symbol, const char *alias, const char *source_module) |
| Registers a selective import. | |
| SelectiveImport * | find_selective_import (ParserContext *ctx, const char *name) |
| Finds a selective import. | |
| const char * | find_type_alias (ParserContext *ctx, const char *alias) |
| Finds a type alias. | |
| void | register_extern_symbol (ParserContext *ctx, const char *name) |
| Registers an external symbol. | |
| int | is_extern_symbol (ParserContext *ctx, const char *name) |
| Checks if a symbol is external. | |
| int | should_suppress_undef_warning (ParserContext *ctx, const char *name) |
| Checks if a symbol should suppress an undefined warning. | |
| void | init_builtins () |
| Initializes built-in types and symbols. | |
| char * | rewrite_expr_methods (ParserContext *ctx, char *raw) |
| Rewrites expression methods. | |
| char * | process_fstring (ParserContext *ctx, const char *content, char ***used_syms, int *count) |
| Processes a formatted string. | |
| char * | instantiate_function_template (ParserContext *ctx, const char *name, const char *concrete_type, const char *unmangled_type) |
| Instantiates a function template. | |
| FuncSig * | find_func (ParserContext *ctx, const char *name) |
| Finds a function. | |
| Type * | parse_type_formal (ParserContext *ctx, Lexer *l) |
| Parses a type formal. | |
| int | check_opaque_alias_compat (ParserContext *ctx, Type *a, Type *b) |
| Checks compatibility of opaque aliases (allows access within defining file). | |
| char * | parse_type (ParserContext *ctx, Lexer *l) |
| Parses a type. | |
| Type * | parse_type_base (ParserContext *ctx, Lexer *l) |
| Parses a type base. | |
| ASTNode * | parse_expression (ParserContext *ctx, Lexer *l) |
| Parses an expression. | |
| ASTNode * | parse_expr_prec (ParserContext *ctx, Lexer *l, Precedence min_prec) |
| Parses an expression with minimum precedence. | |
| ASTNode * | parse_primary (ParserContext *ctx, Lexer *l) |
| Parses a primary expression (literal, variable, grouping). | |
| ASTNode * | parse_lambda (ParserContext *ctx, Lexer *l) |
| Parses a lambda. | |
| char * | parse_condition_raw (ParserContext *ctx, Lexer *l) |
| Parses a condition. | |
| char * | parse_array_literal (ParserContext *ctx, Lexer *l, const char *st) |
| Parses an array literal. | |
| char * | parse_tuple_literal (ParserContext *ctx, Lexer *l, const char *tn) |
| Parses a tuple literal. | |
| ASTNode * | parse_embed (ParserContext *ctx, Lexer *l) |
| Parses an embed. | |
| ASTNode * | parse_macro_call (ParserContext *ctx, Lexer *l, char *name) |
| Parses a macro call. | |
| ASTNode * | parse_statement (ParserContext *ctx, Lexer *l) |
| Parses a statement. | |
| ASTNode * | parse_block (ParserContext *ctx, Lexer *l) |
| Parses a block of statements { ... }. | |
| ASTNode * | parse_if (ParserContext *ctx, Lexer *l) |
| Parses an if statement. | |
| ASTNode * | parse_while (ParserContext *ctx, Lexer *l) |
| Parses a while loop. | |
| ASTNode * | parse_for (ParserContext *ctx, Lexer *l) |
| Parses a for loop. | |
| ASTNode * | parse_loop (ParserContext *ctx, Lexer *l) |
| Parses a loop. | |
| ASTNode * | parse_repeat (ParserContext *ctx, Lexer *l) |
| Parses a repeat loop. | |
| ASTNode * | parse_unless (ParserContext *ctx, Lexer *l) |
| Parses an unless statement. | |
| ASTNode * | parse_guard (ParserContext *ctx, Lexer *l) |
| Parses a guard statement. | |
| ASTNode * | parse_match (ParserContext *ctx, Lexer *l) |
| Parses a match statement. | |
| ASTNode * | parse_return (ParserContext *ctx, Lexer *l) |
| Parses a return statement. | |
| char * | process_printf_sugar (ParserContext *ctx, const char *content, int newline, const char *target, char ***used_syms, int *count, int check_symbols) |
| Processes a formatted string. | |
| ASTNode * | parse_assert (ParserContext *ctx, Lexer *l) |
| Parses an assert statement. | |
| ASTNode * | parse_defer (ParserContext *ctx, Lexer *l) |
| Parses a defer statement. | |
| ASTNode * | parse_asm (ParserContext *ctx, Lexer *l) |
| Parses an asm statement. | |
| ASTNode * | parse_plugin (ParserContext *ctx, Lexer *l) |
| Parses a plugin statement. | |
| ASTNode * | parse_var_decl (ParserContext *ctx, Lexer *l) |
| Parses a variable declaration. | |
| ASTNode * | parse_def (ParserContext *ctx, Lexer *l) |
| Parses a def statement. | |
| ASTNode * | parse_type_alias (ParserContext *ctx, Lexer *l, int is_opaque) |
| Parses a type alias. | |
| ASTNode * | parse_function (ParserContext *ctx, Lexer *l, int is_async) |
| Parses a function definition. | |
| ASTNode * | parse_struct (ParserContext *ctx, Lexer *l, int is_union, int is_opaque) |
| Parses a struct definition. | |
| ASTNode * | parse_enum (ParserContext *ctx, Lexer *l) |
| Parses an enum definition. | |
| ASTNode * | parse_trait (ParserContext *ctx, Lexer *l) |
| Parses a trait definition. | |
| ASTNode * | parse_impl (ParserContext *ctx, Lexer *l) |
| Parses an implementation. | |
| ASTNode * | parse_impl_trait (ParserContext *ctx, Lexer *l) |
| Parses an implementation trait. | |
| ASTNode * | parse_test (ParserContext *ctx, Lexer *l) |
| Parses a test definition. | |
| int | is_type_copy (ParserContext *ctx, Type *t) |
| Checks if a type is copyable. | |
| void | check_move_usage (ParserContext *ctx, ASTNode *node, Token t) |
| Checks if a type is copyable. | |
| ASTNode * | parse_include (ParserContext *ctx, Lexer *l) |
| Parses an include statement. | |
| ASTNode * | parse_import (ParserContext *ctx, Lexer *l) |
| Parses an import statement. | |
| ASTNode * | parse_comptime (ParserContext *ctx, Lexer *l) |
| Parses a comptime statement. | |
| char * | patch_self_args (const char *args, const char *struct_name) |
| Patches self arguments in a function. | |
| ASTNode * | parse_program_nodes (ParserContext *ctx, Lexer *l) |
| Main loop to parse top-level nodes in a file. | |
Variables | |
| ParserContext * | g_parser_ctx |
| #define MAX_KNOWN_GENERICS 1024 |
| typedef struct DeprecatedFunc DeprecatedFunc |
Functions marked as deprecated.
| typedef struct EnumVariantReg EnumVariantReg |
Registry of enum variants.
Registry entry for a function signature.
Stores metadata about declared functions for type checking and call validation.
| typedef struct GenericFuncTemplate GenericFuncTemplate |
Template for a generic function.
| typedef struct GenericImplTemplate GenericImplTemplate |
Template for a generic implementation block.
| typedef struct GenericTemplate GenericTemplate |
Template for a generic struct.
| typedef struct ImportedFile ImportedFile |
Represents an imported source file (to prevent cycles/duplication).
| typedef struct ImportedPlugin ImportedPlugin |
Loaded compiler plugin.
| typedef struct Instantiation Instantiation |
Tracks a concrete instantiation of a generic template.
| typedef struct ParserContext ParserContext |
Represents a lexical scope (block).
Scopes form a hierarchy (parent pointer) and contain a list of symbols defined in that scope.
| typedef struct SelectiveImport SelectiveImport |
Symbol imported via selective import (import { X }).
Represents a symbol in the symbol table.
Used for variables, functions, and other named entities.
| enum Precedence |
Operator precedence for expression parsing.
| void add_instantiated_func | ( | ParserContext * | ctx, |
| ASTNode * | fn | ||
| ) |

| void add_symbol | ( | ParserContext * | ctx, |
| const char * | n, | ||
| const char * | t, | ||
| Type * | type_info | ||
| ) |
Adds a symbol to the current scope.


| void add_symbol_with_token | ( | ParserContext * | ctx, |
| const char * | n, | ||
| const char * | t, | ||
| Type * | type_info, | ||
| Token | tok | ||
| ) |
Adds a symbol with definition token location.


| void add_to_enum_list | ( | ParserContext * | ctx, |
| ASTNode * | node | ||
| ) |


| void add_to_func_list | ( | ParserContext * | ctx, |
| ASTNode * | node | ||
| ) |


| void add_to_global_list | ( | ParserContext * | ctx, |
| ASTNode * | node | ||
| ) |


| void add_to_impl_list | ( | ParserContext * | ctx, |
| ASTNode * | node | ||
| ) |


| void add_to_struct_list | ( | ParserContext * | ctx, |
| ASTNode * | node | ||
| ) |


| void analyze_lambda_captures | ( | ParserContext * | ctx, |
| ASTNode * | lambda | ||
| ) |
Analyzes lambda captures.


| int check_impl | ( | ParserContext * | ctx, |
| const char * | trait, | ||
| const char * | strct | ||
| ) |
Checks if a type implements a trait.

| void check_move_usage | ( | ParserContext * | ctx, |
| ASTNode * | node, | ||
| Token | t | ||
| ) |
Checks if a type is copyable.


| int check_opaque_alias_compat | ( | ParserContext * | ctx, |
| Type * | a, | ||
| Type * | b | ||
| ) |
Checks compatibility of opaque aliases (allows access within defining file).


| char * consume_and_rewrite | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Consumes and rewrites tokens.

| char * consume_until_semicolon | ( | Lexer * | l | ) |
Consumes tokens until a semicolon is found.


| ASTNode * copy_ast_replacing | ( | ASTNode * | n, |
| const char * | p, | ||
| const char * | c, | ||
| const char * | os, | ||
| const char * | ns | ||
| ) |
Copies an AST node and replaces its type parameters.


| void enter_scope | ( | ParserContext * | ctx | ) |
Enters a new scope (pushes to scope stack).


| void exit_scope | ( | ParserContext * | ctx | ) |
Exits the current scope (pops from scope stack).

Expects a token of a specific type.


| char * extract_module_name | ( | const char * | path | ) |


| DeprecatedFunc * find_deprecated_func | ( | ParserContext * | ctx, |
| const char * | name | ||
| ) |
Finds a deprecated function.
| EnumVariantReg * find_enum_variant | ( | ParserContext * | ctx, |
| const char * | vname | ||
| ) |
Finds an enum variant.

| FuncSig * find_func | ( | ParserContext * | ctx, |
| const char * | name | ||
| ) |
Finds a function.


| GenericFuncTemplate * find_func_template | ( | ParserContext * | ctx, |
| const char * | name | ||
| ) |
Finds a function template.

| Module * find_module | ( | ParserContext * | ctx, |
| const char * | alias | ||
| ) |
Finds a module.

| SelectiveImport * find_selective_import | ( | ParserContext * | ctx, |
| const char * | name | ||
| ) |
Finds a selective import.

| char * find_similar_symbol | ( | ParserContext * | ctx, |
| const char * | name | ||
| ) |


| ASTNode * find_struct_def | ( | ParserContext * | ctx, |
| const char * | name | ||
| ) |
Finds a struct definition.

| ZenSymbol * find_symbol_entry | ( | ParserContext * | ctx, |
| const char * | n | ||
| ) |
Finds a symbol's entry.

| ZenSymbol * find_symbol_in_all | ( | ParserContext * | ctx, |
| const char * | n | ||
| ) |
Finds a symbol in all scopes.

| char * find_symbol_type | ( | ParserContext * | ctx, |
| const char * | n | ||
| ) |
Finds a symbol's type.

| Type * find_symbol_type_info | ( | ParserContext * | ctx, |
| const char * | n | ||
| ) |
Finds a symbol's type information.

| const char * find_type_alias | ( | ParserContext * | ctx, |
| const char * | alias | ||
| ) |
Finds a type alias.


| TypeAlias * find_type_alias_node | ( | ParserContext * | ctx, |
| const char * | name | ||
| ) |
Registers a type alias.

| void init_builtins | ( | ) |
Initializes built-in types and symbols.

| char * instantiate_function_template | ( | ParserContext * | ctx, |
| const char * | name, | ||
| const char * | concrete_type, | ||
| const char * | unmangled_type | ||
| ) |
Instantiates a function template.


| void instantiate_generic | ( | ParserContext * | ctx, |
| const char * | name, | ||
| const char * | concrete_type, | ||
| const char * | unmangled_type, | ||
| Token | t | ||
| ) |
Instantiates a generic struct/function.


| void instantiate_generic_multi | ( | ParserContext * | ctx, |
| const char * | name, | ||
| char ** | args, | ||
| int | arg_count, | ||
| Token | t | ||
| ) |
Instantiates a multi-parameter generic.


| int is_c_reserved_word | ( | const char * | name | ) |
Checks if a name is a C reserved word.

| int is_extern_symbol | ( | ParserContext * | ctx, |
| const char * | name | ||
| ) |
Checks if a symbol is external.

| int is_file_imported | ( | ParserContext * | ctx, |
| const char * | path | ||
| ) |
Checks if a file has been imported.

| int is_known_generic | ( | ParserContext * | ctx, |
| char * | name | ||
| ) |
Checks if a name is a known generic parameter.

| int is_token | ( | Token | t, |
| const char * | s | ||
| ) |
Checks if a token matches a string.

| int is_type_copy | ( | ParserContext * | ctx, |
| Type * | t | ||
| ) |
Checks if a type is copyable.


| void mark_file_imported | ( | ParserContext * | ctx, |
| const char * | path | ||
| ) |
Marks a file as imported.


| char * parse_and_convert_args | ( | ParserContext * | ctx, |
| Lexer * | l, | ||
| char *** | defaults_out, | ||
| int * | count_out, | ||
| Type *** | types_out, | ||
| char *** | names_out, | ||
| int * | is_varargs_out, | ||
| char *** | ctype_overrides_out | ||
| ) |
Parses and converts arguments.


| char * parse_array_literal | ( | ParserContext * | ctx, |
| Lexer * | l, | ||
| const char * | st | ||
| ) |
Parses an array literal.


| ASTNode * parse_arrow_lambda_multi | ( | ParserContext * | ctx, |
| Lexer * | l, | ||
| char ** | param_names, | ||
| int | num_params | ||
| ) |
Parses a multi-parameter arrow lambda.


| ASTNode * parse_arrow_lambda_single | ( | ParserContext * | ctx, |
| Lexer * | l, | ||
| char * | param_name | ||
| ) |
Parses a single parameter arrow lambda.


| ASTNode * parse_asm | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses an asm statement.


| ASTNode * parse_assert | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses an assert statement.


| ASTNode * parse_block | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a block of statements { ... }.


| ASTNode * parse_comptime | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a comptime statement.


| char * parse_condition_raw | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a condition.


| ASTNode * parse_def | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a def statement.


| ASTNode * parse_defer | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a defer statement.


| ASTNode * parse_embed | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses an embed.


| ASTNode * parse_enum | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses an enum definition.


| ASTNode * parse_expr_prec | ( | ParserContext * | ctx, |
| Lexer * | l, | ||
| Precedence | min_prec | ||
| ) |
Parses an expression with minimum precedence.


| ASTNode * parse_expression | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses an expression.


| ASTNode * parse_for | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a for loop.


| ASTNode * parse_function | ( | ParserContext * | ctx, |
| Lexer * | l, | ||
| int | is_async | ||
| ) |
Parses a function definition.


| ASTNode * parse_guard | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a guard statement.


| ASTNode * parse_if | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses an if statement.


| ASTNode * parse_impl | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses an implementation.


| ASTNode * parse_impl_trait | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses an implementation trait.
| ASTNode * parse_import | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses an import statement.


| ASTNode * parse_include | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses an include statement.


| ASTNode * parse_lambda | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a lambda.


| ASTNode * parse_loop | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a loop.


| ASTNode * parse_macro_call | ( | ParserContext * | ctx, |
| Lexer * | l, | ||
| char * | name | ||
| ) |
Parses a macro call.


| ASTNode * parse_match | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a match statement.


| ASTNode * parse_plugin | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a plugin statement.


| ASTNode * parse_primary | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a primary expression (literal, variable, grouping).

| ASTNode * parse_program | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a program.


| ASTNode * parse_program_nodes | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Main loop to parse top-level nodes in a file.


| ASTNode * parse_repeat | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a repeat loop.


| ASTNode * parse_return | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a return statement.


| ASTNode * parse_statement | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a statement.


| ASTNode * parse_struct | ( | ParserContext * | ctx, |
| Lexer * | l, | ||
| int | is_union, | ||
| int | is_opaque | ||
| ) |
Parses a struct definition.


| ASTNode * parse_test | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a test definition.


| ASTNode * parse_trait | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a trait definition.


| char * parse_tuple_literal | ( | ParserContext * | ctx, |
| Lexer * | l, | ||
| const char * | tn | ||
| ) |
Parses a tuple literal.


| char * parse_type | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a type.


| ASTNode * parse_type_alias | ( | ParserContext * | ctx, |
| Lexer * | l, | ||
| int | is_opaque | ||
| ) |
Parses a type alias.


| Type * parse_type_base | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a type base.


| Type * parse_type_formal | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a type formal.


| ASTNode * parse_unless | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses an unless statement.


| ASTNode * parse_var_decl | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a variable declaration.


| ASTNode * parse_while | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a while loop.


| char * patch_self_args | ( | const char * | args, |
| const char * | struct_name | ||
| ) |
Patches self arguments in a function.


| void print_type_defs | ( | ParserContext * | ctx, |
| FILE * | out, | ||
| ASTNode * | nodes | ||
| ) |
Prints type definitions to a file.
| char * process_fstring | ( | ParserContext * | ctx, |
| const char * | content, | ||
| char *** | used_syms, | ||
| int * | count | ||
| ) |
Processes a formatted string.

| char * process_printf_sugar | ( | ParserContext * | ctx, |
| const char * | content, | ||
| int | newline, | ||
| const char * | target, | ||
| char *** | used_syms, | ||
| int * | count, | ||
| int | check_symbols | ||
| ) |
Processes a formatted string.


| void register_builtins | ( | ParserContext * | ctx | ) |


| void register_deprecated_func | ( | ParserContext * | ctx, |
| const char * | name, | ||
| const char * | reason | ||
| ) |
Registers a deprecated function.


| void register_enum_variant | ( | ParserContext * | ctx, |
| const char * | ename, | ||
| const char * | vname, | ||
| int | tag | ||
| ) |
Registers an enum variant.


| void register_extern_symbol | ( | ParserContext * | ctx, |
| const char * | name | ||
| ) |
Registers an external symbol.


| void register_func | ( | ParserContext * | ctx, |
| const char * | name, | ||
| int | count, | ||
| char ** | defaults, | ||
| Type ** | arg_types, | ||
| Type * | ret_type, | ||
| int | is_varargs, | ||
| int | is_async, | ||
| Token | decl_token | ||
| ) |
Registers a function.


| void register_func_template | ( | ParserContext * | ctx, |
| const char * | name, | ||
| const char * | param, | ||
| ASTNode * | node | ||
| ) |
Registers a function template.


| void register_generic | ( | ParserContext * | ctx, |
| char * | name | ||
| ) |
Registers a known generic type parameter.

| void register_impl | ( | ParserContext * | ctx, |
| const char * | trait, | ||
| const char * | strct | ||
| ) |
Registers an implementation.


| void register_impl_template | ( | ParserContext * | ctx, |
| const char * | sname, | ||
| const char * | param, | ||
| ASTNode * | node | ||
| ) |


| void register_lambda | ( | ParserContext * | ctx, |
| ASTNode * | node | ||
| ) |
Registers a lambda.


| void register_module | ( | ParserContext * | ctx, |
| const char * | alias, | ||
| const char * | path | ||
| ) |
Registers a module.

| void register_plugin | ( | ParserContext * | ctx, |
| const char * | name, | ||
| const char * | alias | ||
| ) |
Registers a plugin.


| void register_selective_import | ( | ParserContext * | ctx, |
| const char * | symbol, | ||
| const char * | alias, | ||
| const char * | source_module | ||
| ) |
Registers a selective import.


| void register_slice | ( | ParserContext * | ctx, |
| const char * | type | ||
| ) |
Registers a slice type.


| void register_struct_def | ( | ParserContext * | ctx, |
| const char * | name, | ||
| ASTNode * | node | ||
| ) |
Registers a struct definition.


| void register_template | ( | ParserContext * | ctx, |
| const char * | name, | ||
| ASTNode * | node | ||
| ) |
Registers a template.


| void register_tuple | ( | ParserContext * | ctx, |
| const char * | sig | ||
| ) |
Registers a tuple type.


| void register_type_alias | ( | ParserContext * | ctx, |
| const char * | alias, | ||
| const char * | original, | ||
| int | is_opaque, | ||
| const char * | defined_in_file | ||
| ) |


| void register_type_usage | ( | ParserContext * | ctx, |
| const char * | name, | ||
| Token | t | ||
| ) |
Registers a type usage.


| char * replace_in_string | ( | const char * | src, |
| const char * | old_w, | ||
| const char * | new_w | ||
| ) |
Replaces a substring in a string.


| Type * replace_type_formal | ( | Type * | t, |
| const char * | p, | ||
| const char * | c, | ||
| const char * | os, | ||
| const char * | ns | ||
| ) |
Replaces a type formal in a type.


| char * replace_type_str | ( | const char * | src, |
| const char * | param, | ||
| const char * | concrete, | ||
| const char * | old_struct, | ||
| const char * | new_struct | ||
| ) |
Replaces a type string in a string.


| const char * resolve_plugin | ( | ParserContext * | ctx, |
| const char * | name_or_alias | ||
| ) |
Resolves a plugin by name or alias.

| char * rewrite_expr_methods | ( | ParserContext * | ctx, |
| char * | raw | ||
| ) |
Rewrites expression methods.


| char * sanitize_mangled_name | ( | const char * | name | ) |
Sanitizes a mangled name for use in codegen.


| int should_suppress_undef_warning | ( | ParserContext * | ctx, |
| const char * | name | ||
| ) |
Checks if a symbol should suppress an undefined warning.


| void skip_comments | ( | Lexer * | l | ) |
Skips comments in the lexer.


| char * token_strdup | ( | Token | t | ) |
Duplicates a token.


| int validate_types | ( | ParserContext * | ctx | ) |
Validates types.


| void warn_c_reserved_word | ( | Token | t, |
| const char * | name | ||
| ) |
Warns about a C reserved word.


|
extern |