aboutsummaryrefslogtreecommitdiff
path: root/frontend/parse.icl
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/parse.icl')
-rw-r--r--frontend/parse.icl16
1 files changed, 7 insertions, 9 deletions
diff --git a/frontend/parse.icl b/frontend/parse.icl
index d5b15ef..03a968d 100644
--- a/frontend/parse.icl
+++ b/frontend/parse.icl
@@ -3676,19 +3676,17 @@ trySimpleNonLhsExpressionT :: !Token *ParseState -> *(!Bool,!ParsedExpr,!*ParseS
trySimpleNonLhsExpressionT BackSlashToken pState
# (token, pState) = nextToken FunctionContext pState
| token == CaseToken
- # (token, pState) = nextToken FunctionContext pState
- # pState = if (token == OfToken) id tokenBack pState
# (lam_ident, pState) = internalIdent "_lcl" pState
(case_ident, pState) = internalIdent "_lcc" pState
(arg_ident, pState) = internalIdent "_lca" pState
- (alts, pState) = wantCaseAlts pState
+ (alts, pState) = wantCaseOfExp pState
(file_name, line_nr, pState)
= getFileAndLineNr pState
position = FunPos file_name line_nr lam_ident.id_name
expr = PE_Case case_ident (PE_Ident arg_ident) alts
ewl = {ewl_nodes = [], ewl_expr = expr, ewl_locals = LocalParsedDefs [], ewl_position = LinePos file_name line_nr}
rhs = {rhs_alts = UnGuardedExpr ewl, rhs_locals = LocalParsedDefs []}
- = (True, PE_Lambda lam_ident [PE_Ident arg_ident] rhs position, pState)
+ = (True, PE_Lambda lam_ident [PE_Ident arg_ident] rhs position, pState)
# pState = tokenBack pState
# (lam_ident, pState) = internalIdent (toString backslash) pState
(file_name, line_nr, pState)
@@ -4179,13 +4177,13 @@ wantCaseExp :: !ParseState -> (ParsedExpr, !ParseState)
wantCaseExp pState
# (case_ident, pState) = internalIdent "_c" pState
# (case_exp, pState) = wantExpression pState
- # pState = wantToken FunctionContext "case expression" OfToken pState
- # (alts, pState) = wantCaseAlts pState
+ # (alts, pState) = wantCaseOfExp pState
= (PE_Case case_ident case_exp alts, pState)
-wantCaseAlts :: !ParseState -> ([CaseAlt], !ParseState)
-wantCaseAlts pState
- # pState = wantBeginGroup "case" pState
+wantCaseOfExp :: !ParseState -> ([CaseAlt], !ParseState)
+wantCaseOfExp pState
+ # pState = wantToken FunctionContext "case expression" OfToken pState
+ pState = wantBeginGroup "case" pState
(case_alts, (definingSymbol,pState))
= parseList tryCaseAlt (RhsDefiningSymbolCase, pState)
(found, alt, pState) = tryLastCaseAlt definingSymbol pState