Make expressionVisitor take a single Node

This commit is contained in:
Jeroen Engels 2021-10-27 17:49:19 +02:00
parent 8bc5c18ba5
commit 7a830e1a06

View File

@ -1317,10 +1317,11 @@ mergeModuleVisitors initialProjectContext maybeModuleContextCreator visitors =
fromModuleRuleSchemaToRunnableModuleVisitor : ModuleRuleSchema schemaState moduleContext -> RunnableModuleVisitor moduleContext
fromModuleRuleSchemaToRunnableModuleVisitor (ModuleRuleSchema schema) =
let
expressionVisitor : List (Node Expression) -> ( List (Error {}), moduleContext ) -> ( List (Error {}), moduleContext )
expressionVisitor : Node Expression -> ( List (Error {}), moduleContext ) -> ( List (Error {}), moduleContext )
expressionVisitor =
if shouldVisitExpressions schema then
accumulateList (visitExpression expressionVisitorRecord)
\node errorsAndContext ->
accumulate (visitExpression expressionVisitorRecord node) errorsAndContext
else
\_ errorsAndContext -> errorsAndContext