Skip to content

Commit

Permalink
Fixes to Chapter 9 code.
Browse files Browse the repository at this point in the history
  • Loading branch information
dom96 committed Aug 29, 2016
1 parent d9e54e2 commit 6ccd0a3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Chapter9/configurator/configurator.nim
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import macros

proc createRefType(ident: NimIdent, identDefs: seq[NimNode]): NimNode =
result = newNimNode(nnkTypeSection).add(
newNimNode(nnkTypeDef).add(
result = newTree(nnkTypeSection,
newTree(nnkTypeDef,
newIdentNode(ident),
newEmptyNode(),
newNimNode(nnkRefTy).add(
newNimNode(nnkObjectTy).add(
newTree(nnkRefTy,
newTree(nnkObjectTy,
newEmptyNode(),
newEmptyNode(),
newNimNode(nnkRecList).add(
newTree(nnkRecList,
identDefs
)
)
Expand Down Expand Up @@ -74,7 +74,7 @@ macro config*(typeName: untyped, fields: untyped): untyped =
import json
config MyAppConfig:
address: string
echo(123)
port: int

var myConf = newMyAppConfig()
myConf.load("myappconfig.cfg")
Expand Down

0 comments on commit 6ccd0a3

Please sign in to comment.