fixed () -> e short lambda parsing (close #93)

This commit is contained in:
Nicolas Cannasse
2020-05-07 10:24:04 +02:00
parent 085f4ec37e
commit ae9560124e
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -360,6 +360,13 @@ class Parser {
case TConst(c):
return parseExprNext(mk(EConst(c)));
case TPOpen:
tk = token();
if( tk == TPClose ) {
ensureToken(TOp("->"));
var eret = parseExpr();
return mk(EFunction([], mk(EReturn(eret),p1)), p1);
}
push(tk);
var e = parseExpr();
tk = token();
switch( tk ) {