Add comment, potentially fix linux test

This commit is contained in:
Joey Yakimowich-Payne 2020-05-06 07:20:29 -06:00
commit baaba7881b
2 changed files with 12 additions and 1 deletions

View file

@ -106,7 +106,7 @@ proc newConstDef(gState: State, node: TSNode, fname = "", fval = ""): PNode =
if not maybeTyNode.isNil:
let name = maybeTyNode.getName()
case name
of "type_descriptor", "sized_type_specifier":
of "type_descriptor", "sized_type_specifier", "primitive_type":
discard
else:
# Can't do gState.parseCExpression(root) here for some reason?

View file

@ -549,6 +549,17 @@ proc processTSNode(gState: State, node: TSNode, typeofNode: var PNode): PNode =
# Output -> true, false
result = gState.parseString(node.val)
of "type_descriptor":
# Input => int*
# (type_descriptor 1 2 4 "int*"
# (type_identifier 1 2 3 "int")
# (abstract_pointer_declarator 1 3 1 "*")
# )
#
# Output => ptr int
#
# nkPtrTy(
# nkIdent("int")
# )
let pointerDecl = node.anyChildInTree("abstract_pointer_declarator")
if pointerDecl.isNil: