@@ -274,7 +274,12 @@ let lsts-parse-typed-macro(tokens: List<Token>): (AST, List<Token>) = (
274
274
lsts-parse-expect(c"(", tokens); tokens = tail(tokens);
275
275
while lsts-parse-head(tokens)!=c")" {
276
276
if not(is(margs,ASTNil)) then { lsts-parse-expect(c",", tokens); tokens = tail(tokens); };
277
- (let mbind, tokens) = lsts-parse-atom-without-tail(tokens);
277
+ (let binding, tokens) = lsts-parse-identifier(tokens);
278
+ let mbind = mk-var(binding);
279
+ while lsts-parse-head(tokens) != c":" {
280
+ (binding, tokens) = lsts-parse-identifier(tokens);
281
+ mbind = mk-cons(mbind, mk-var(binding));
282
+ };
278
283
lsts-parse-expect(c":", tokens); tokens = tail(tokens);
279
284
(let mbindt, tokens) = lsts-parse-type(tokens);
280
285
let marg = mk-app(mk-lit(c":"), mk-cons(mbind, mk-atype(mbindt)));
@@ -324,7 +329,7 @@ let lsts-parse-type-conjugate(tokens: List<Token>): Tuple<Type,List<Token>> = (
324
329
lsts-parse-expect(c"?", tokens); tokens = tail(tokens);
325
330
TAny {}
326
331
} else if lsts-is-ident-head(lsts-parse-head(tokens)) && not(lsts-is-type-tag(lsts-parse-head(tokens))) {
327
- let varname = lsts-parse-head(tokens); tokens = tail (tokens);
332
+ ( let varname, tokens) = lsts-parse-identifier (tokens);
328
333
TVar { varname }
329
334
} else {
330
335
if not(lsts-is-type-tag(lsts-parse-head(tokens))) {
@@ -1075,13 +1080,13 @@ let lsts-parse-small-expression(tokens: List<Token>): Tuple<AST,List<Token>> = (
1075
1080
tokens = rhs-rest.second;
1076
1081
lsts-parse-expect(c"}", tokens); tokens = tail(tokens);
1077
1082
base = mk-app(
1078
- Var{ c"macro::while", with-location( mk-token("macro::while"),loc) },
1079
- mk-cons(
1080
- c-rest.first,
1081
- mk-app(
1082
- Var{ c"scope", with-location( mk-token("scope"),loc) },
1083
- rhs-rest.first
1084
- )
1083
+ mk-app(
1084
+ Var{ c"while", with-location( mk-token("while"),loc) },
1085
+ c-rest.first
1086
+ ),
1087
+ mk-app(
1088
+ Var{ c"scope", with-location(mk-token("scope"),loc) },
1089
+ rhs-rest.first
1085
1090
)
1086
1091
);
1087
1092
);
0 commit comments