parent
045eeab6b4
commit
0718d6c2cd
3 changed files with 26 additions and 1 deletions
|
|
@ -676,3 +676,15 @@ block:
|
|||
## single line comment would be ok.
|
||||
block:
|
||||
var x = 7
|
||||
|
||||
|
||||
proc newRecordGen(ctx: Context; typ: TypRef): PNode =
|
||||
result = nkTypeDef.t(
|
||||
newId(typ.optSym.name, true, pragmas = [id(if typ.isUnion: "cUnion" else: "cStruct")]),
|
||||
empty(),
|
||||
nkObjectTy.t(
|
||||
empty(),
|
||||
empty(),
|
||||
nkRecList.t(
|
||||
typ.recFields.map(newRecFieldGen))))
|
||||
|
||||
|
|
|
|||
|
|
@ -682,3 +682,16 @@ block:
|
|||
## single line comment would be ok.
|
||||
block:
|
||||
var x = 7
|
||||
|
||||
|
||||
proc newRecordGen(ctx: Context; typ: TypRef): PNode =
|
||||
result = nkTypeDef.t(
|
||||
newId(typ.optSym.name, true, pragmas = [id(
|
||||
if typ.isUnion: "cUnion" else: "cStruct")]),
|
||||
empty(),
|
||||
nkObjectTy.t(
|
||||
empty(),
|
||||
empty(),
|
||||
nkRecList.t(
|
||||
typ.recFields.map(newRecFieldGen))))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue