Home /Modules/compiler/CASE-HANDLER.md

CASE-HANDLER.md

lib/compiler/CASE-HANDLER.md · 34 line(s) · markdown

SLeeLa Case Handler

Purpose

Define consistent handling for the SLeeLa source keyword case and the case branch of compiler parsing. This handler is distinct from the new keyword used for explicit object creation.

Case-statement contract

The parser recognizes case labels only inside a valid selection construct, such as a supported switch or SLeeLa selection form. Each label is parsed as an expression or a permitted constant pattern according to the active language profile.

Object creation is a separate concern

The parser and semantic analyzer must not confuse a case label with the new keyword. Object creation is governed by OBJECT-CREATION.md and CONSTRUCTOR-SERIES.md:

Pipeline

source -> lexer -> parser -> case AST -> semantic validation -> control-flow IR -> VM lowering

Object creation follows its own path:

source -> call/object AST -> symbol resolution -> constructor selection -> initialization chain -> IR

This separation keeps parsing predictable and makes the language rules testable.