You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/kdl.nim
+23-16Lines changed: 23 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -14,12 +14,16 @@
14
14
## Arguments are a sequence of values, while properties are an unordered table of string and values.
15
15
## Arguments and properties' values are represented by the object variant `KdlVal`. `KdlVal` can be of any kind `KString`, `KFloat`, `KBool`, `KNull` or `KInt`.
16
16
runnableExamples:
17
-
let doc = parseKdl("node (i8)1 null key=\"val\" {child \"abc\" true}") # You can also read files using parseKdlFile("file.kdl")
18
-
assert doc ==@[
19
-
initKNode("node",
20
-
args =@[initKVal(1, "i8".some), initKNull()],
21
-
props = {"key": initKVal("val")}.toTable,
22
-
children =@[initKNode("child", args =@[initKVal("abc"), initKVal(true)])])
17
+
let doc = parseKdl("node (i8)1 null key=\"val\" {child \"abc\" true}")
18
+
# You can also read files using parseKdlFile("file.kdl")
19
+
assert doc ==
20
+
@[
21
+
initKNode(
22
+
"node",
23
+
args =@[initKVal(1, "i8".some), initKNull()],
24
+
props = {"key": initKVal("val")}.toTable,
25
+
children =@[initKNode("child", args =@[initKVal("abc"), initKVal(true)])],
26
+
)
23
27
]
24
28
25
29
## ### Reading nodes
@@ -75,22 +79,25 @@ runnableExamples:
75
79
## To create KDL documents, nodes or values without parsing or object constructors you can use the `toKdlDoc`, `toKdlNode` and`toKdlVal` macros which have a similar syntax to KDL:
0 commit comments