Skip to content

Instantly share code, notes, and snippets.

@PhilipWitte
Created June 4, 2014 04:38
Show Gist options
  • Save PhilipWitte/19a00bfbbf7017e4bae7 to your computer and use it in GitHub Desktop.
Save PhilipWitte/19a00bfbbf7017e4bae7 to your computer and use it in GitHub Desktop.
result.insert(0,
if baseName == nil:
(quote do:
type `typeName` = ref object)[0]
else:
(quote do:
type `typeName` = ref object of `baseName`)[0]
)
# Inspect the tree structure:
#
# echo result.treeRepr
# --------------------
# StmtList
# TypeSection
# TypeDef
# Ident !"Animal"
# Empty
# RefTy
# ObjectTy
# Empty
# OfInherit
# Ident !"TObject"
# Empty <= We want to replace this
# MethodDef
# ...
result[0][0][2][0][2] = recList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment