- ast.ml: Added Nullable variant to field_ty; param.ty/method_sig.ret/method_decl.ret now use field_ty - parser.ml: Parse ? prefix for field types, return types, parameters - dump.ml: Render ?T in --dump-ast output - types.ml: New typechecker (Task 6) with nullable field-kind derivation (WO_K_NULLABLE=6) - dune: Added types module - Added golden test fixtures for nullable types and statement/expression parser - Added implementation plan doc
17 lines
569 B
Text
17 lines
569 B
Text
1:1 CLASS Widget
|
|
2:3 METHOD describe(mut active: Bool) -> Text
|
|
3:5 IF active
|
|
4:7 LET inner = Widget { active: false }
|
|
5:7 RETURN "on-plain"
|
|
7:5 WHILE active
|
|
8:7 ASSIGN active = false
|
|
10:5 FOR part IN active
|
|
11:7 RETURN "loop"
|
|
13:5 IF Widget { active: true }.active
|
|
14:7 RETURN "on-parenthesized"
|
|
16:5 IF make(Widget { active: true })
|
|
17:7 RETURN "on-call-arg"
|
|
19:5 IF items[Widget { active: true }]
|
|
20:7 RETURN "on-index"
|
|
22:5 LET w = Widget { active: true, label: "hello" }
|
|
23:5 RETURN "off"
|