Replace prsFoo() with foo()

This commit is contained in:
Emery Hemingway 2021-09-06 16:15:09 +02:00
parent cb4f4df4f1
commit 2016974e95
1 changed files with 8 additions and 2 deletions

View File

@ -360,14 +360,20 @@ proc generateProcs(result: var seq[PNode]; name: string; sn: SchemaNode) =
newEmpty())
initRecordCall.add(
nn(nkCall, ident"toPreserve", id, ident"EmbeddedType"))
var procId = name
procId[0] = procId[0].toLowerAscii
result.add nn(nkProcDef,
exportIdent("prs" & name),
exportIdent(procId),
newEmpty(),
newEmpty(),
params,
newEmpty(),
newEmpty(),
nn(nkStmtList, initRecordCall))
nn(nkStmtList,
PNode(
kind: nkCommentStmt,
comment: "Preserves constructor for ``" & name & "``."),
initRecordCall))
else: discard
proc generateNimFile*(scm: Schema; path: string) =