Skip to content

Commit

Permalink
fix breaking test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
karan-batavia committed Jan 6, 2024
1 parent fd478a3 commit c69fdab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ class AstCreator(val relativeFileName: String, val parserResult: ParserResult, v
Option(NodeTypes.TYPE_DECL),
Some("") // TODO: Find fullyQualifiedPackage and assign to astParent
)
methodAstParentStack.push(fakeGlobalMethodForFile)
// methodAstParentStack.push(fakeGlobalMethodForFile) // TODO: Confirm if this has to be included in the methodAstParentStack as this affects fullName creation for structs
scope.pushNewScope(fakeGlobalMethodForFile)
val memberAsts = astForMembers(cu.json(ParserKeys.Members).arr.map(createDotNetNodeInfo).toSeq)
methodAstParentStack.pop()
// methodAstParentStack.pop()
scope.popScope()
memberAsts
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ trait AstForDeclarationsCreator(implicit withSchemaValidation: ValidationMode) {
.zipWithIndex
.map(astForParameter)
.toSeq
val body = astForMethodBody(createDotNetNodeInfo(methodDecl.json(ParserKeys.Body)))
val methodReturn = nodeToMethodReturn(createDotNetNodeInfo(methodDecl.json(ParserKeys.ReturnType)))
val signature =
methodSignature(methodReturn, params.flatMap(_.nodes.collectFirst { case x: NewMethodParameterIn => x }))
val fullName = s"${astFullName(methodDecl)}:$signature"
val methodNode_ = methodNode(methodDecl, name, code(methodDecl), fullName, Option(signature), relativeFileName)
methodAstParentStack.push(methodNode_)
scope.pushNewScope(methodNode_)
val body = astForMethodBody(createDotNetNodeInfo(methodDecl.json(ParserKeys.Body)))
val modifiers = astForModifiers(methodDecl).flatMap(_.nodes).collect { case x: NewModifier => x }
val thisNode =
if (!modifiers.exists(_.modifierType == ModifierTypes.STATIC)) astForThisNode(methodDecl)
Expand Down

0 comments on commit c69fdab

Please sign in to comment.