Commit 82bd5ba0 authored by John van Groningen's avatar John van Groningen
Browse files

refactor, reduce indentation of local functions want_list in want_LGraphExpr in module parse

parent 711effdf
......@@ -4232,15 +4232,14 @@ wantListPatternWithoutDefinitions pState
_
-> want_LGraphExpr token [] head_strictness pState
= want_LGraphExpr token [] head_strictness pState
where
where
want_LGraphExpr (CharListToken chars) acc head_strictness pState
= want_list (add_chars (fromString chars) acc) head_strictness pState
want_LGraphExpr token acc head_strictness pState
= case token of
CharListToken chars
-> want_list (add_chars (fromString chars) acc) pState
_ # (exp, pState) = wantPatternWithoutDefinitionsT token pState
-> want_list [exp: acc] pState
where
want_list acc pState
# (exp, pState) = wantPatternWithoutDefinitionsT token pState
= want_list [exp: acc] head_strictness pState
want_list acc head_strictness pState
# (token, pState) = nextToken FunctionContext pState
= case token of
SquareCloseToken
......@@ -4265,7 +4264,7 @@ wantListPatternWithoutDefinitions pState
# pState = wantToken FunctionContext "list" SquareCloseToken pState
-> (gen_pattern_tail_strict_cons_nodes acc exp head_strictness,pState)
| token=:ColonToken // to allow [1:2:[]] etc.
-> want_list [exp:acc] (tokenBack pState)
-> want_list [exp:acc] head_strictness (tokenBack pState)
# pState = parseError "list" (Yes token) "] or :" pState
-> (gen_pattern_cons_nodes acc exp head_strictness,pState)
DotDotToken
......@@ -4338,15 +4337,14 @@ wantListExp is_pattern pState
_
-> want_LGraphExpr token [] head_strictness pState
= want_LGraphExpr token [] head_strictness pState
where
where
want_LGraphExpr (CharListToken chars) acc head_strictness pState
= want_list (add_chars (fromString chars) acc) head_strictness pState
want_LGraphExpr token acc head_strictness pState
= case token of
CharListToken chars
-> want_list (add_chars (fromString chars) acc) pState
_ # (exp, pState) = (if is_pattern (wantPatternT token) (wantExpressionT token)) pState
-> want_list [exp: acc] pState
where
want_list acc pState
# (exp, pState) = (if is_pattern (wantPatternT token) (wantExpressionT token)) pState
= want_list [exp: acc] head_strictness pState
want_list acc head_strictness pState
# (token, pState) = nextToken FunctionContext pState
= case token of
SquareCloseToken
......@@ -4371,7 +4369,7 @@ wantListExp is_pattern pState
# pState = wantToken FunctionContext "list" SquareCloseToken pState
-> (gen_tail_strict_cons_nodes acc exp,pState)
| token=:ColonToken // to allow [1:2:[]] etc.
-> want_list [exp:acc] (tokenBack pState)
-> want_list [exp:acc] head_strictness (tokenBack pState)
# pState = parseError "list" (Yes token) "] or :" pState
-> (gen_cons_nodes acc exp,pState)
DotDotToken
......@@ -4443,9 +4441,10 @@ wantListExp is_pattern pState
-> case acc of
[e]
# pd_from_to_index =
if (head_strictness==HeadStrict) PD_FromToSTS
(if (head_strictness==HeadUnboxed) PD_FromToUTS
PD_FromToTS)
if (head_strictness==HeadStrict) PD_FromToS
(if (head_strictness==HeadUnboxed) PD_FromToU
(if (head_strictness==HeadOverloaded) PD_FromToO
PD_FromTo))
-> (PE_Sequ (SQ_FromTo pd_from_to_index e exp), pState)
[e2,e1]
# pd_from_then_to_index =
......@@ -4468,7 +4467,7 @@ wantListExp is_pattern pState
_ # nil_expr = makeNilExpression head_strictness is_pattern
pState = parseError "list" (Yes token) "list element separator" pState
-> (gen_cons_nodes acc nil_expr,pState)
where
gen_cons_nodes [] exp
= exp
gen_cons_nodes l exp
......
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