diff --git a/dist/platform/elc b/dist/platform/elc index 5e83d07..05e4591 100755 Binary files a/dist/platform/elc and b/dist/platform/elc differ diff --git a/el-compiler/src/parser.el b/el-compiler/src/parser.el index afd1c33..ffe63b3 100644 --- a/el-compiler/src/parser.el +++ b/el-compiler/src/parser.el @@ -744,11 +744,16 @@ fn parse_stmt(tokens: [Map], pos: Int) -> Map { return make_result({ "stmt": "FnDef", "name": name, "params": params, "body": body, "ret_type": ret_type }, p) } - // type definition + // type definition: `type Name = { field: Type, ... }` + // The `=` between the name and the brace is optional in the spec but + // present in practice. Skip it if present before consuming the LBrace. if k == "Type" { let p = pos + 1 let name = tok_value(tokens, p) let p = p + 1 + // Consume optional `=` before the opening brace + let pk = tok_kind(tokens, p) + if pk == "Eq" { let p = p + 1 } let p = expect(tokens, p, "LBrace") let fields: [Map] = native_list_empty() let running = true