@@ -31,7 +31,7 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
3131
3232 val clauses = elements.slice(0 , MaxInitializers )
3333
34- val args = clauses.map(x => astForNodeWithFunctionReference(x) )
34+ val args = clauses.map(astForNode )
3535
3636 val ast = callAst(initCallNode, args)
3737 if (elements.sizeIs > MaxInitializers ) {
@@ -55,8 +55,8 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
5555
5656 val propertiesAsts = slicedElements.map {
5757 case dictElement : DictionaryElementSyntax =>
58- val lhsAst = astForNodeWithFunctionReference (dictElement.key)
59- val rhsAst = astForNodeWithFunctionReference (dictElement.value)
58+ val lhsAst = astForNode (dictElement.key)
59+ val rhsAst = astForNode (dictElement.value)
6060
6161 val lhsTmpNode = Ast (identifierNode(dictElement, tmpName))
6262 val lhsIndexAccessCallAst =
@@ -69,7 +69,7 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
6969 line(dictElement),
7070 column(dictElement)
7171 )
72- case other => astForNodeWithFunctionReference (other)
72+ case other => astForNode (other)
7373 }
7474
7575 val tmpNode = identifierNode(node, tmpName)
@@ -103,7 +103,7 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
103103 val tpe = cleanType(tpeCode)
104104 registerType(tpe)
105105 val cpgCastExpression = callNode(node, code(node), op, op, DispatchTypes .STATIC_DISPATCH , None , Some (tpe))
106- val expr = astForNodeWithFunctionReference (node.expression)
106+ val expr = astForNode (node.expression)
107107 val typeRefNode_ = typeRefNode(tpeNode, tpeCode, tpe)
108108 val arg = Ast (typeRefNode_)
109109 callAst(cpgCastExpression, List (arg, expr))
@@ -113,7 +113,7 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
113113
114114 private def astForAwaitExprSyntax (node : AwaitExprSyntax ): Ast = {
115115 val callNode_ = callNode(node, code(node), " <operator>.await" , DispatchTypes .STATIC_DISPATCH )
116- val argAsts = List (astForNodeWithFunctionReference (node.expression))
116+ val argAsts = List (astForNode (node.expression))
117117 callAst(callNode_, argAsts)
118118 }
119119
@@ -124,22 +124,22 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
124124 }
125125
126126 private def astForBorrowExprSyntax (node : BorrowExprSyntax ): Ast = {
127- astForNodeWithFunctionReference (node.expression)
127+ astForNode (node.expression)
128128 }
129129
130130 private def astForCanImportExprSyntax (node : CanImportExprSyntax ): Ast = notHandledYet(node)
131131 private def astForCanImportVersionInfoSyntax (node : CanImportVersionInfoSyntax ): Ast = notHandledYet(node)
132132
133133 private def astForClosureExprSyntax (node : ClosureExprSyntax ): Ast = {
134- astForNodeWithFunctionReference (node)
134+ astForNode (node)
135135 }
136136
137137 private def astForConsumeExprSyntax (node : ConsumeExprSyntax ): Ast = {
138- astForNodeWithFunctionReference (node.expression)
138+ astForNode (node.expression)
139139 }
140140
141141 private def astForCopyExprSyntax (node : CopyExprSyntax ): Ast = {
142- astForNodeWithFunctionReference (node.expression)
142+ astForNode (node.expression)
143143 }
144144
145145 private def astForDeclReferenceExprSyntax (node : DeclReferenceExprSyntax ): Ast = {
@@ -171,7 +171,7 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
171171 }
172172
173173 private def astForForceUnwrapExprSyntax (node : ForceUnwrapExprSyntax ): Ast = {
174- astForNodeWithFunctionReference (node.expression)
174+ astForNode (node.expression)
175175 }
176176
177177 private def createBuiltinStaticCall (callExpr : FunctionCallExprSyntax , callee : ExprSyntax , fullName : String ): Ast = {
@@ -222,25 +222,25 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
222222 base match {
223223 case None =>
224224 // referencing implicit this
225- val receiverAst = astForNodeWithFunctionReference (callee)
225+ val receiverAst = astForNode (callee)
226226 val baseNode = identifierNode(m, " this" )
227227 scope.addVariableReference(" this" , baseNode, Defines .Any , EvaluationStrategies .BY_REFERENCE )
228228 (receiverAst, baseNode, code(member))
229229 case Some (d : DeclReferenceExprSyntax ) if code(d) == " this" || code(d) == " self" =>
230- val receiverAst = astForNodeWithFunctionReference (callee)
230+ val receiverAst = astForNode (callee)
231231 val baseNode = identifierNode(d, code(d))
232232 scope.addVariableReference(code(d), baseNode, Defines .Any , EvaluationStrategies .BY_REFERENCE )
233233 (receiverAst, baseNode, code(member))
234234 case Some (d : DeclReferenceExprSyntax ) =>
235- val receiverAst = astForNodeWithFunctionReference (callee)
235+ val receiverAst = astForNode (callee)
236236 val baseNode = identifierNode(d, code(d))
237237 scope.addVariableReference(code(d), baseNode, Defines .Any , EvaluationStrategies .BY_REFERENCE )
238238 (receiverAst, baseNode, code(member))
239239 case Some (otherBase) =>
240240 val tmpVarName = scopeLocalUniqueName(" tmp" )
241241 val baseTmpNode = identifierNode(otherBase, tmpVarName)
242242 scope.addVariableReference(tmpVarName, baseTmpNode, Defines .Any , EvaluationStrategies .BY_REFERENCE )
243- val baseAst = astForNodeWithFunctionReference (otherBase)
243+ val baseAst = astForNode (otherBase)
244244 val codeField = s " ( ${codeOf(baseTmpNode)} = ${codeOf(baseAst.nodes.head)}) "
245245 val tmpAssignmentAst =
246246 createAssignmentCallAst(Ast (baseTmpNode), baseAst, codeField, line(otherBase), column(otherBase))
@@ -251,7 +251,7 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
251251 (fieldAccessAst, thisTmpNode, code(member))
252252 }
253253 case _ =>
254- val receiverAst = astForNodeWithFunctionReference (callee)
254+ val receiverAst = astForNode (callee)
255255 val thisNode = identifierNode(callee, " this" )
256256 scope.addVariableReference(thisNode.name, thisNode, Defines .Any , EvaluationStrategies .BY_REFERENCE )
257257 (receiverAst, thisNode, calleeCode)
@@ -278,15 +278,15 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
278278
279279 private def astForInOutExprSyntax (node : InOutExprSyntax ): Ast = {
280280 val op = Defines .PrefixOperatorMap (code(node.ampersand))
281- val argAst = astForNodeWithFunctionReference (node.expression)
281+ val argAst = astForNode (node.expression)
282282 val callNode_ = callNode(node, code(node), op, DispatchTypes .STATIC_DISPATCH )
283283 callAst(callNode_, List (argAst))
284284 }
285285
286286 private def astForInfixOperatorExprSyntax (node : InfixOperatorExprSyntax ): Ast = {
287287 val op = Defines .InfixOperatorMap (code(node.operator))
288- val lhsAst = astForNodeWithFunctionReference (node.leftOperand)
289- val rhsAst = astForNodeWithFunctionReference (node.rightOperand)
288+ val lhsAst = astForNode (node.leftOperand)
289+ val rhsAst = astForNode (node.rightOperand)
290290 val callNode_ = callNode(node, code(node), op, DispatchTypes .STATIC_DISPATCH )
291291 val argAsts = List (lhsAst, rhsAst)
292292 callAst(callNode_, argAsts)
@@ -297,7 +297,7 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
297297 }
298298
299299 private def astForIsExprSyntax (node : IsExprSyntax ): Ast = {
300- val lhsAst = astForNodeWithFunctionReference (node.expression)
300+ val lhsAst = astForNode (node.expression)
301301 val rhsAst = astForNode(node.`type`)
302302 val callNode_ = callNode(node, code(node), Operators .instanceOf, DispatchTypes .STATIC_DISPATCH )
303303 val argAsts = List (lhsAst, rhsAst)
@@ -309,7 +309,7 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
309309 private def astForMacroExpansionExprSyntax (node : MacroExpansionExprSyntax ): Ast = {
310310 val name = code(node.macroName)
311311 val argAsts = astForNode(node.arguments) +:
312- node.trailingClosure.toList.map(astForNodeWithFunctionReference ) :+
312+ node.trailingClosure.toList.map(astForNode ) :+
313313 astForNode(node.additionalTrailingClosures)
314314 val callNode =
315315 NewCall ()
@@ -337,7 +337,7 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
337337 scope.addVariableReference(code(d), baseNode, Defines .Any , EvaluationStrategies .BY_REFERENCE )
338338 Ast (baseNode)
339339 case Some (otherBase) =>
340- astForNodeWithFunctionReference (otherBase)
340+ astForNode (otherBase)
341341 }
342342
343343 member.baseName match {
@@ -358,15 +358,15 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
358358 }
359359
360360 private def astForOptionalChainingExprSyntax (node : OptionalChainingExprSyntax ): Ast = {
361- astForNodeWithFunctionReference (node.expression)
361+ astForNode (node.expression)
362362 }
363363
364364 private def astForPackElementExprSyntax (node : PackElementExprSyntax ): Ast = {
365- astForNodeWithFunctionReference (node.pack)
365+ astForNode (node.pack)
366366 }
367367
368368 private def astForPackExpansionExprSyntax (node : PackExpansionExprSyntax ): Ast = {
369- astForNodeWithFunctionReference (node.repetitionPattern)
369+ astForNode (node.repetitionPattern)
370370 }
371371
372372 private def astForPatternExprSyntax (node : PatternExprSyntax ): Ast = {
@@ -418,14 +418,14 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
418418 private def astForPostfixOperatorExprSyntax (node : PostfixOperatorExprSyntax ): Ast = {
419419 val operatorMethod = Defines .PostfixOperatorMap (code(node.operator))
420420 val unaryCall = callNode(node, code(node), operatorMethod, operatorMethod, DispatchTypes .STATIC_DISPATCH )
421- val expressionAst = astForNodeWithFunctionReference (node.expression)
421+ val expressionAst = astForNode (node.expression)
422422 callAst(unaryCall, List (expressionAst))
423423 }
424424
425425 private def astForPrefixOperatorExprSyntax (node : PrefixOperatorExprSyntax ): Ast = {
426426 val operatorMethod = Defines .PrefixOperatorMap (code(node.operator))
427427 val unaryCall = callNode(node, code(node), operatorMethod, operatorMethod, DispatchTypes .STATIC_DISPATCH )
428- val expressionAst = astForNodeWithFunctionReference (node.expression)
428+ val expressionAst = astForNode (node.expression)
429429 callAst(unaryCall, List (expressionAst))
430430 }
431431
@@ -444,7 +444,7 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
444444 }
445445
446446 private def astForSubscriptCallExprSyntax (node : SubscriptCallExprSyntax ): Ast = {
447- val baseAst = astForNodeWithFunctionReference (node.calledExpression)
447+ val baseAst = astForNode (node.calledExpression)
448448 val memberAst = astForNode(node.arguments)
449449 val additionalArgsAsts = node.trailingClosure.toList.map(astForNode) ++
450450 node.additionalTrailingClosures.children.map(c => astForNode(c.closure))
@@ -462,13 +462,13 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
462462 val (tAsts, flowAst) = s.label match {
463463 case i : SwitchCaseLabelSyntax =>
464464 val children = i.caseItems.children
465- val childrenTestAsts = children.map(c => astForNodeWithFunctionReference (c.pattern))
465+ val childrenTestAsts = children.map(c => astForNode (c.pattern))
466466 val childrenFlowAsts = children.collect {
467467 case child if child.whereClause.isDefined =>
468468 val whereClause = child.whereClause.get
469469 val ifNode =
470470 controlStructureNode(whereClause.condition, ControlStructureTypes .IF , code(whereClause.condition))
471- val whereAst = astForNodeWithFunctionReference (whereClause)
471+ val whereAst = astForNode (whereClause)
472472 val whereClauseCallNode = callNode(
473473 whereClause.condition,
474474 s " !( ${code(whereClause.condition)}) " ,
@@ -509,7 +509,7 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
509509 // The semantics of switch statement children is partially defined by their order value.
510510 // The blockAst must have order == 2. Only to avoid collision we set switchExpressionAst to 1
511511 // because the semantics of it is already indicated via the condition edge.
512- val switchExpressionAst = astForNodeWithFunctionReference (node.subject)
512+ val switchExpressionAst = astForNode (node.subject)
513513 setOrderExplicitly(switchExpressionAst, 1 )
514514
515515 val blockNode_ = blockNode(node).order(2 )
@@ -529,9 +529,9 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
529529 val name = Operators .conditional
530530 val call = callNode(node, code(node), name, DispatchTypes .STATIC_DISPATCH )
531531
532- val condAst = astForNodeWithFunctionReference (node.condition)
533- val posAst = astForNodeWithFunctionReference (node.thenExpression)
534- val negAst = astForNodeWithFunctionReference (node.elseExpression)
532+ val condAst = astForNode (node.condition)
533+ val posAst = astForNode (node.thenExpression)
534+ val negAst = astForNode (node.elseExpression)
535535
536536 val children = List (condAst, posAst, negAst)
537537 callAst(call, children)
@@ -546,7 +546,7 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) {
546546 private def astForTupleExprSyntax (node : TupleExprSyntax ): Ast = {
547547 node.elements.children.toList match {
548548 case Nil => astForListLikeExpr(node, Seq .empty)
549- case head :: Nil => astForNodeWithFunctionReference (head)
549+ case head :: Nil => astForNode (head)
550550 case other => astForListLikeExpr(node, other)
551551 }
552552 }
0 commit comments