Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/gear2/enum2nif.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by enumgen.nim. DO NOT EDIT!
# Generated by gear2/generator/enumgen.nim in Nimony repo. DO NOT EDIT!

import compiler / [ast, options]

Expand Down Expand Up @@ -27,7 +27,7 @@ proc toNifTag*(s: TNodeKind): string =
of nkStrLit: "strlit"
of nkRStrLit: "rstrlit"
of nkTripleStrLit: "triplestrlit"
of nkNilLit: "nillit"
of nkNilLit: "nil"
of nkComesFrom: "comesfrom"
of nkDotCall: "dotcall"
of nkCommand: "cmd"
Expand Down Expand Up @@ -197,7 +197,7 @@ proc parseNodeKind*(s: string): TNodeKind =
of "strlit": nkStrLit
of "rstrlit": nkRStrLit
of "triplestrlit": nkTripleStrLit
of "nillit": nkNilLit
of "nil": nkNilLit
of "comesfrom": nkComesFrom
of "dotcall": nkDotCall
of "cmd": nkCommand
Expand Down Expand Up @@ -744,6 +744,7 @@ proc toNifTag*(s: TMagic): string =
of mExit: "exit"
of mSetLengthStr: "setlenstr"
of mSetLengthSeq: "setlenseq"
of mSetLengthSeqUninit: "setlensequninit"
of mIsPartOf: "ispartof"
of mAstToStr: "asttostr"
of mParallel: "parallel"
Expand Down Expand Up @@ -799,7 +800,7 @@ proc toNifTag*(s: TMagic): string =
of mString: "string"
of mCstring: "cstring"
of mPointer: "pointer"
of mNil: "nil"
of mNil: "nilm"
of mExpr: "exprm"
of mStmt: "stmtm"
of mTypeDesc: "typedesc"
Expand Down Expand Up @@ -1025,6 +1026,7 @@ proc parseMagic*(s: string): TMagic =
of "exit": mExit
of "setlenstr": mSetLengthStr
of "setlenseq": mSetLengthSeq
of "setlensequninit": mSetLengthSeqUninit
of "ispartof": mIsPartOf
of "asttostr": mAstToStr
of "parallel": mParallel
Expand Down Expand Up @@ -1080,7 +1082,7 @@ proc parseMagic*(s: string): TMagic =
of "string": mString
of "cstring": mCstring
of "pointer": mPointer
of "nil": mNil
of "nilm": mNil
of "exprm": mExpr
of "stmtm": mStmt
of "typedesc": mTypeDesc
Expand Down
4 changes: 3 additions & 1 deletion src/gear2/generator/enumgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const
("nkBreakStmt", "brk"),
("nkStmtListExpr", "expr"),
("nkEnumFieldDef", "efld"),
("nkNilLit", "nil"),
("ccNoConvention", "noconv"),
("mExpr", "exprm"),
("mStmt", "stmtm"),
Expand All @@ -53,6 +54,7 @@ const
("mRange", "rangem"),
("mVar", "varm"),
("mInSet", "contains"),
("mNil", "nilm"),
("tyBuiltInTypeClass", "bconcept"),
("tyUserTypeClass", "uconcept"),
("tyUserTypeClassInst", "uconceptinst"),
Expand Down Expand Up @@ -222,7 +224,7 @@ proc genFlags[E](f: var File; enumName: string; prefixLen = 2) =
f.write code

var f = open("src/gear2/enum2nif.nim", fmWrite)
f.write "# Generated by enumgen.nim. DO NOT EDIT!\n\n"
f.write "# Generated by gear2/generator/enumgen.nim in Nimony repo. DO NOT EDIT!\n\n"
f.write "import compiler / [ast, options]\n\n"
# use the same mapping for TNodeKind and TMagic so that we can detect conflicts!
var nodeTags = initOrderedTable[string, bool]()
Expand Down
Loading