Commit edc0429e authored by Pieter Koopman's avatar Pieter Koopman
Browse files

cases in lets fixed

parent 48211525
......@@ -31,7 +31,6 @@ is_record_update updates
// ... RWS
// Sjaak
/*
Parser for Clean 2.0
......@@ -1697,7 +1696,7 @@ wantRhsExpressionT token pState
| succ
# (exprs, pState) = parseList trySimpleRhsExpression pState
= (combineExpressions expr exprs, pState)
= (PE_Empty, parseError "RHS expression" (Yes token) "<expression>" pState)
= (PE_Empty, parseError "RHS expression" (Yes token) "<expression> **" pState)
wantLhsExpressionT :: !Token !ParseState -> (!ParsedExpr, !ParseState)
wantLhsExpressionT token pState
......@@ -1765,7 +1764,7 @@ where
wantSelectors :: Token *ParseState -> *(![ParsedSelection], !*ParseState)
wantSelectors token pState
# (selector, pState) = want_selector token pState
(token, pState) = nextToken FunctionContext pState
(token, pState) = nextToken FunctionContext pState
| token == DotToken
# (token, pState) = nextToken FunctionContext pState
(selectors, pState) = wantSelectors token pState
......@@ -2085,6 +2084,7 @@ where
{ nu_selectors :: ![ParsedSelection]
, nu_update_expr :: !ParsedExpr
}
errorIdent :: Ident
errorIdent
= {id_name = "<<error>>", id_info = nilPtr}
......@@ -2515,6 +2515,7 @@ wantEndGroup msg pState
| ss_useLayout
= case token of
EndGroupToken -> pState
InToken -> tokenBack pState
_ -> parseError msg (Yes token) "end of group with layout" pState
// ~ ss_useLayout
| token == CurlyCloseToken
......@@ -2569,6 +2570,7 @@ wantEndLocals pState
| ss_useLayout
= case token of
EndGroupToken -> pState
InToken -> tokenBack pState // For let expressions with cases
_ -> parseError "local definitions" (Yes token) "end of locals with layout" pState
// ~ ss_useLayout
| token == CurlyCloseToken
......@@ -2593,6 +2595,7 @@ wantEndCase pState
SemicolonToken -> tokenBack (appScanState dropOffsidePosition pState)
CommaToken -> tokenBack (appScanState dropOffsidePosition pState)
ColonToken -> tokenBack (appScanState dropOffsidePosition pState)
InToken -> tokenBack (appScanState dropOffsidePosition pState)
_ -> parseError "case expression" (Yes token) "end of case with layout" pState
// ~ ss_useLayout
| token == CurlyCloseToken
......
......@@ -1375,7 +1375,8 @@ checkOffside pos token scanState=:{ss_offsides,ss_useLayout,ss_input}
= (newToken, scanState) // -->> ("new offsides",new_offsides)
= gen_end_groups (dec n) scanState
| token == InToken
# scanState = tokenBack { scanState & ss_offsides = tl ss_offsides }
= (token, { scanState & ss_offsides = tl ss_offsides })
/* # scanState = tokenBack { scanState & ss_offsides = tl ss_offsides }
newToken = EndGroupToken
= ( newToken
, { scanState
......@@ -1389,7 +1390,7 @@ checkOffside pos token scanState=:{ss_offsides,ss_useLayout,ss_input}
scanState.ss_tokenBuffer
}
) -->> (token,"EndGroupToken generated: in",pos,ss_offsides)
// otherwise
*/ // otherwise
= newOffside token scanState
where
newOffside token scanState=:{ss_offsides}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment