Split pipelines

This commit is contained in:
Jeroen Engels 2024-09-08 18:41:50 +02:00
parent 9b2b19d2cb
commit f45c2aeba4
2 changed files with 54 additions and 43 deletions

View File

@ -433,15 +433,17 @@ collectLookupTable declarations context =
visitExpressions : Node Expression -> Context -> Context
visitExpressions node context =
-- IGNORE TCO
context
|> popScopeEnter node
|> expressionEnterVisitor node
|> (\newContext ->
List.foldl
visitExpressions
newContext
(expressionChildren node)
)
let
newContext : Context
newContext =
context
|> popScopeEnter node
|> expressionEnterVisitor node
in
List.foldl
visitExpressions
newContext
(expressionChildren node)
|> popScopeExit node
|> expressionExitVisitor node

View File

@ -5862,16 +5862,19 @@ visitDeclarationsAndExpressions declarations rules =
visitDeclarationAndExpressions : Node Declaration -> JsArray RuleModuleVisitor -> JsArray RuleModuleVisitor
visitDeclarationAndExpressions declaration rules =
rules
|> mutatingMap (\acc -> runVisitor .declarationVisitorOnEnter declaration acc)
|> (\updatedRules ->
case Node.value declaration of
Declaration.FunctionDeclaration function ->
visitExpression (Node.value function.declaration |> .expression) updatedRules
let
updatedRules : JsArray RuleModuleVisitor
updatedRules =
rules
|> mutatingMap (\acc -> runVisitor .declarationVisitorOnEnter declaration acc)
in
(case Node.value declaration of
Declaration.FunctionDeclaration function ->
visitExpression (Node.value function.declaration |> .expression) updatedRules
_ ->
updatedRules
)
_ ->
updatedRules
)
|> mutatingMap (\acc -> runVisitor .declarationVisitorOnExit declaration acc)
@ -5879,38 +5882,44 @@ visitExpression : Node Expression -> JsArray RuleModuleVisitor -> JsArray RuleMo
visitExpression node rules =
case Node.value node of
Expression.LetExpression letBlock ->
rules
|> mutatingMap (\acc -> runVisitor .expressionVisitorOnEnter node acc)
|> (\updatedRules ->
List.foldl
(visitLetDeclaration (Node (Node.range node) letBlock))
updatedRules
letBlock.declarations
)
let
updatedRules : JsArray RuleModuleVisitor
updatedRules =
rules
|> mutatingMap (\acc -> runVisitor .expressionVisitorOnEnter node acc)
in
List.foldl
(visitLetDeclaration (Node (Node.range node) letBlock))
updatedRules
letBlock.declarations
|> visitExpression letBlock.expression
|> mutatingMap (\acc -> runVisitor .expressionVisitorOnExit node acc)
Expression.CaseExpression caseBlock ->
rules
|> mutatingMap (\acc -> runVisitor .expressionVisitorOnEnter node acc)
|> visitExpression caseBlock.expression
|> (\updatedRules ->
List.foldl
(\case_ acc -> visitCaseBranch (Node (Node.range node) caseBlock) case_ acc)
updatedRules
caseBlock.cases
)
let
updatedRules : JsArray RuleModuleVisitor
updatedRules =
rules
|> mutatingMap (\acc -> runVisitor .expressionVisitorOnEnter node acc)
|> visitExpression caseBlock.expression
in
List.foldl
(\case_ acc -> visitCaseBranch (Node (Node.range node) caseBlock) case_ acc)
updatedRules
caseBlock.cases
|> mutatingMap (\acc -> runVisitor .expressionVisitorOnExit node acc)
_ ->
rules
|> mutatingMap (\acc -> runVisitor .expressionVisitorOnEnter node acc)
|> (\updatedRules ->
List.foldl
visitExpression
updatedRules
(expressionChildren node)
)
let
updatedRules : JsArray RuleModuleVisitor
updatedRules =
rules
|> mutatingMap (\acc -> runVisitor .expressionVisitorOnEnter node acc)
in
List.foldl
visitExpression
updatedRules
(expressionChildren node)
|> mutatingMap (\acc -> runVisitor .expressionVisitorOnExit node acc)