Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
895c0e34a1 |
1 changed files with 6 additions and 6 deletions
|
|
@ -105,12 +105,12 @@ macro class*(head, body: untyped): untyped =
|
||||||
# Empty
|
# Empty
|
||||||
|
|
||||||
# create a type section in the result
|
# create a type section in the result
|
||||||
result =
|
if exported:
|
||||||
if exported:
|
result =
|
||||||
# mark `typeName` with an asterisk
|
|
||||||
quote do:
|
quote do:
|
||||||
type `typeName`* = ref object of `baseName`
|
type `typeName`* = ref object of `baseName`
|
||||||
else:
|
else:
|
||||||
|
result =
|
||||||
quote do:
|
quote do:
|
||||||
type `typeName` = ref object of `baseName`
|
type `typeName` = ref object of `baseName`
|
||||||
|
|
||||||
|
|
@ -167,8 +167,8 @@ macro class*(head, body: untyped): untyped =
|
||||||
# specify the return type of the ctor proc
|
# specify the return type of the ctor proc
|
||||||
node.params[0] = typeName
|
node.params[0] = typeName
|
||||||
else:
|
else:
|
||||||
# inject `self: T` into the arguments
|
# inject `this: T` into the arguments
|
||||||
node.params.insert(1, newIdentDefs(ident("self"), typeName))
|
node.params.insert(1, newIdentDefs(ident("this"), typeName))
|
||||||
result.add(node)
|
result.add(node)
|
||||||
|
|
||||||
of nnkVarSection:
|
of nnkVarSection:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue