Summary
The lexer defines operator tokens, but parser/sema currently do not implement infix operator parsing and typing with precedence.
Evidence
Contract Evidence:
- docs/project-ttl-language.md:97
- cmds/ttlc/internal/parser/parser.go:354
Current Gap
The lexer defines operator tokens, but parser/sema currently do not implement infix operator parsing and typing with precedence.
Proposed Scope
Acceptance Criteria
- Add AST support for infix/binary expressions.
- Parse
+, -, *, / (and precedence/associativity) in expression grammar.
- Add semantic checks for operator operand/result compatibility.
- Produce stable diagnostics for invalid operator combinations.
Test Scenarios
- Precedence test: multiplication binds tighter than addition.
- Parenthesized expressions override default precedence.
- Invalid operand type combinations emit type errors.
Out of Scope
- Full Go operator surface beyond agreed phase scope.
- Constant-folding optimization.
Summary
The lexer defines operator tokens, but parser/sema currently do not implement infix operator parsing and typing with precedence.
Evidence
Contract Evidence:
Current Gap
The lexer defines operator tokens, but parser/sema currently do not implement infix operator parsing and typing with precedence.
Proposed Scope
Acceptance Criteria
+,-,*,/(and precedence/associativity) in expression grammar.Test Scenarios
Out of Scope