Skip to content

v0.6.0-alpha

Pre-release
Pre-release

Choose a tag to compare

@Sim20004 Sim20004 released this 05 Sep 20:19
· 69 commits to main since this release

TeapotLang v0.6.0-alpha

Semantic analysis

  • Reworked the Symbol model to separate declaration scope from owned scope:
    • scope now consistently means the scope a symbol is declared in.
    • A new child_scope field represents the scope a symbol owns (e.g. a function's body scope, a struct's field scope). Previously scope conflated both meanings depending on symbol kind, which made function and variable symbols behave inconsistently.
    • Removed the now-redundant params field from Symbol.
  • Added real semantic support for struct fields, enum declarations, enum members, error declarations, and error members. These were previously unregistered and would raise SemanticError ("Unknown node") when encountered.
    • New handlers: register_struct_field, register_enum, register_enum_member, register_error, register_error_member.
    • Structs, enums, and errors now each get their own child SymbolTable, so their members are scoped correctly rather than being ignored or leaking into the enclosing scope.

Tests and fixtures

  • Added examples/fixtures/parser-sem-an.tp, a larger end-to-end fixture exercising structs, enums, errors, and operators together.
  • Rewrote examples/fixtures/semanticanalysis.tp to include enum and error declarations, which it previously omitted.
  • Updated the semantic and integration test suites to assert against child_scope instead of scope for functions and structs, and added new coverage for enum, error, and struct-field registration, plus nested-function scope-chain behaviour.

Notes

This release focuses entirely on internal semantic-analysis structure and does not change the language surface, parser grammar, or CLI behaviour. Code generation and executable output remain unimplemented.