Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal: reorder ParsedNodeKind for range checks #907

Merged
merged 4 commits into from
Sep 21, 2023
Merged
Changes from 3 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
8 changes: 5 additions & 3 deletions compiler/ast/ast_parsed_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ type
pnkPostfix
pnkExprEqExpr
pnkExprColonExpr
pnkIdentDefs
pnkConstDef
pnkVarTuple
pnkPar
pnkSqrBracket
Expand Down Expand Up @@ -174,6 +172,7 @@ type
pnkIncludeStmt
pnkExportStmt
pnkExportExceptStmt
pnkTypeSection
pnkConstSection
pnkLetSection
pnkVarSection
Expand All @@ -184,8 +183,9 @@ type
pnkIteratorDef
pnkMacroDef
pnkTemplateDef
pnkTypeSection
pnkConstDef
pnkTypeDef
pnkIdentDefs
pnkEnumTy
pnkEnumFieldDef
pnkObjectTy
Expand Down Expand Up @@ -265,6 +265,8 @@ const
pnkFloatKinds* = {pnkFloatLit..pnkFloat128Lit}
pnkIntKinds* = {pnkCharLit..pnkUInt64Lit}
pnkStrKinds* = {pnkStrLit..pnkTripleStrLit}
pnkDeclarativeDefs* = {pnkProcDef, pnkFuncDef, pnkMethodDef, pnkIteratorDef, pnkConverterDef}
pnkRoutineDefs* = pnkDeclarativeDefs + {pnkMacroDef, pnkTemplateDef}

func len*(node: ParsedNode): int =
## Number of sons of the parsed node
Expand Down