# Generated by tools/gen_tags.nim from doc/tags.md. DO NOT EDIT!

import tags

type
  NimonyExpr* = enum
    NoExpr
    ErrX = (ord(ErrTagId), "err")  ## indicates an error
    SufX = (ord(SufTagId), "suf")  ## literal with suffix annotation
    AtX = (ord(AtTagId), "at")  ## array indexing operation (typed Nimony form vs untyped NIFC form); also used for generic proc/type instantiation `(at callee T1 T2 ...)`
    DerefX = (ord(DerefTagId), "deref")  ## pointer deref operation
    DotX = (ord(DotTagId), "dot")  ## object field selection; optional integer is the inheritance depth of the field; optional trailing `STRLIT` is an *access token* (carrying `"x"` like an export marker) — when present, the expression was already type-checked in a scope with access to the field, so re-check at expansion/serialization sites must accept the access even if the field is private. Emitted by sem when a template body or `.semantics` serializer is type-checked in the field's defining module and later expanded/consumed elsewhere.
    PatX = (ord(PatTagId), "pat")  ## pointer indexing operation
    ParX = (ord(ParTagId), "par")  ## syntactic parenthesis
    AddrX = (ord(AddrTagId), "addr")  ## address of operation
    NilX = (ord(NilTagId), "nil")  ## nil pointer value; closure `nil` carries the proc type and a nil environment
    InfX = (ord(InfTagId), "inf")  ## positive infinity floating point value
    NeginfX = (ord(NeginfTagId), "neginf")  ## negative infinity floating point value
    NanX = (ord(NanTagId), "nan")  ## NaN floating point value
    FalseX = (ord(FalseTagId), "false")  ## boolean `false` value
    TrueX = (ord(TrueTagId), "true")  ## boolean `true` value
    AndX = (ord(AndTagId), "and")  ## boolean `and` operation
    OrX = (ord(OrTagId), "or")  ## boolean `or` operation
    XorX = (ord(XorTagId), "xor")  ## boolean `xor` operation
    NotX = (ord(NotTagId), "not")  ## boolean `not` operation
    NegX = (ord(NegTagId), "neg")  ## negation operation
    SizeofX = (ord(SizeofTagId), "sizeof")  ## `sizeof` operation
    AlignofX = (ord(AlignofTagId), "alignof")  ## `alignof` operation
    OffsetofX = (ord(OffsetofTagId), "offsetof")  ## `offsetof` operation
    OconstrX = (ord(OconstrTagId), "oconstr")  ## object constructor
    AconstrX = (ord(AconstrTagId), "aconstr")  ## array constructor
    BracketX = (ord(BracketTagId), "bracket")  ## untyped array constructor
    CurlyX = (ord(CurlyTagId), "curly")  ## untyped set constructor
    CurlyatX = (ord(CurlyatTagId), "curlyat")  ## curly expression `a{i}`
    KvX = (ord(KvTagId), "kv")  ## key-value pair; optional INTLIT indicates field is in an inherited object
    OvfX = (ord(OvfTagId), "ovf")  ## access overflow flag
    AddX = (ord(AddTagId), "add")
    SubX = (ord(SubTagId), "sub")
    MulX = (ord(MulTagId), "mul")
    DivX = (ord(DivTagId), "div")
    ModX = (ord(ModTagId), "mod")
    ShrX = (ord(ShrTagId), "shr")
    ShlX = (ord(ShlTagId), "shl")
    BitandX = (ord(BitandTagId), "bitand")
    BitorX = (ord(BitorTagId), "bitor")
    BitxorX = (ord(BitxorTagId), "bitxor")
    BitnotX = (ord(BitnotTagId), "bitnot")
    EqX = (ord(EqTagId), "eq")
    NeqX = (ord(NeqTagId), "neq")
    LeX = (ord(LeTagId), "le")
    LtX = (ord(LtTagId), "lt")
    CastX = (ord(CastTagId), "cast")  ## `cast` operation (typed cast expression, or `{.cast(pragma).}` pragma form)
    ConvX = (ord(ConvTagId), "conv")  ## type conversion
    CallX = (ord(CallTagId), "call")  ## call operation
    CmdX = (ord(CmdTagId), "cmd")  ## command operation
    CchoiceX = (ord(CchoiceTagId), "cchoice")  ## closed choice
    OchoiceX = (ord(OchoiceTagId), "ochoice")  ## open choice
    PragmaxX = (ord(PragmaxTagId), "pragmax")  ## pragma expressions
    QuotedX = (ord(QuotedTagId), "quoted")  ## name in backticks
    HderefX = (ord(HderefTagId), "hderef")  ## hidden pointer deref operation
    DdotX = (ord(DdotTagId), "ddot")  ## deref dot: expression, field symbol, field index; optional trailing `STRLIT` is the same *access token* described on `(dot ...)` — certifies the access was type-checked with private-field visibility and must be accepted on re-check.
    HaddrX = (ord(HaddrTagId), "haddr")  ## hidden address of operation
    NewrefX = (ord(NewrefTagId), "newref")  ## Nim's `new` magic proc that allocates a `ref T`; optional initializer expression
    NewobjX = (ord(NewobjTagId), "newobj")  ## new object constructor
    TupX = (ord(TupTagId), "tup")  ## untyped tuple constructor
    TupconstrX = (ord(TupconstrTagId), "tupconstr")  ## tuple constructor
    SetconstrX = (ord(SetconstrTagId), "setconstr")  ## set constructor
    TabconstrX = (ord(TabconstrTagId), "tabconstr")  ## table constructor
    AshrX = (ord(AshrTagId), "ashr")
    BaseobjX = (ord(BaseobjTagId), "baseobj")  ## object conversion to base type
    HconvX = (ord(HconvTagId), "hconv")  ## hidden basic type conversion
    DconvX = (ord(DconvTagId), "dconv")  ## conversion between `distinct` types
    CallstrlitX = (ord(CallstrlitTagId), "callstrlit")
    InfixX = (ord(InfixTagId), "infix")  ## infix call form kept verbatim inside unsem'd bodies: operator followed by two or more operands (extra args come from default parameters, e.g. `s $ 80` → `` `$`(s, 80, defaultReplacement) ``)
    PrefixX = (ord(PrefixTagId), "prefix")  ## prefix call form kept verbatim inside unsem'd bodies: operator followed by single operand
    HcallX = (ord(HcallTagId), "hcall")  ## hidden converter call
    CompilesX = (ord(CompilesTagId), "compiles")
    DeclaredX = (ord(DeclaredTagId), "declared")
    DefinedX = (ord(DefinedTagId), "defined")
    AstToStrX = (ord(AstToStrTagId), "astToStr")  ## converts AST to string
    InstanceofX = (ord(InstanceofTagId), "instanceof")  ## only-fans operator for object privilege checking
    ProccallX = (ord(ProccallTagId), "proccall")  ## like the `call` tag but always a static call (no dynamic method) dispatch
    HighX = (ord(HighTagId), "high")
    LowX = (ord(LowTagId), "low")
    TypeofX = (ord(TypeofTagId), "typeof")  ## `typeof` operation for accessing the type of an expression
    UnpackX = (ord(UnpackTagId), "unpack")  ## magic varargs expansion — see *Tuple Unpacking* section below
    FieldsX = (ord(FieldsTagId), "fields")  ## fields iterator
    FieldpairsX = (ord(FieldpairsTagId), "fieldpairs")  ## fieldPairs iterator
    EnumtostrX = (ord(EnumtostrTagId), "enumtostr")
    IsmainmoduleX = (ord(IsmainmoduleTagId), "ismainmodule")
    DefaultobjX = (ord(DefaultobjTagId), "defaultobj")
    DefaulttupX = (ord(DefaulttupTagId), "defaulttup")
    DefaultdistinctX = (ord(DefaultdistinctTagId), "defaultdistinct")
    DelayX = (ord(DelayTagId), "delay")  ## `delay(fn args)` builtin for delayed continuation creation
    Delay0X = (ord(Delay0TagId), "delay0")  ## `delay()` no-arg: capture current coroutine's own continuation
    SuspendX = (ord(SuspendTagId), "suspend")  ## `suspend()` magic proc: suspends the coroutine and returns Continuation(nil, nil)
    ExprX = (ord(ExprTagId), "expr")
    DoX = (ord(DoTagId), "do")  ## `do` expression
    ArratX = (ord(ArratTagId), "arrat")  ## two optional exprs: `high` boundary and the `low` boundary (if != 0)
    TupatX = (ord(TupatTagId), "tupat")
    PlussetX = (ord(PlussetTagId), "plusset")
    MinussetX = (ord(MinussetTagId), "minusset")
    MulsetX = (ord(MulsetTagId), "mulset")
    XorsetX = (ord(XorsetTagId), "xorset")
    EqsetX = (ord(EqsetTagId), "eqset")
    LesetX = (ord(LesetTagId), "leset")
    LtsetX = (ord(LtsetTagId), "ltset")
    InsetX = (ord(InsetTagId), "inset")
    CardX = (ord(CardTagId), "card")
    EmoveX = (ord(EmoveTagId), "emove")
    DestroyX = (ord(DestroyTagId), "destroy")
    DupX = (ord(DupTagId), "dup")
    CopyX = (ord(CopyTagId), "copy")
    WasmovedX = (ord(WasmovedTagId), "wasmoved")
    SinkhX = (ord(SinkhTagId), "sinkh")
    TraceX = (ord(TraceTagId), "trace")
    InternalTypeNameX = (ord(InternalTypeNameTagId), "internalTypeName")  ## returns compiler's internal type name
    InternalFieldPairsX = (ord(InternalFieldPairsTagId), "internalFieldPairs")  ## variant of fieldPairs iterator returns compiler's internal field name
    FailedX = (ord(FailedTagId), "failed")  ## used to access the hidden failure flag for raising calls
    IsX = (ord(IsTagId), "is")  ## `is` operator
    EnvpX = (ord(EnvpTagId), "envp")  ## `envp.Y` field access to hidden `env` parameter which is of type `T`

proc rawTagIsNimonyExpr*(raw: TagEnum): bool {.inline.} =
  raw in {ErrTagId, SufTagId, AtTagId, DerefTagId, DotTagId, PatTagId, ParTagId, AddrTagId, NilTagId, InfTagId, NeginfTagId, NanTagId, FalseTagId, TrueTagId, AndTagId, OrTagId, XorTagId, NotTagId, NegTagId, SizeofTagId, AlignofTagId, OffsetofTagId, OconstrTagId, AconstrTagId, BracketTagId, CurlyTagId, CurlyatTagId, KvTagId, OvfTagId, AddTagId, SubTagId, MulTagId, DivTagId, ModTagId, ShrTagId, ShlTagId, BitandTagId, BitorTagId, BitxorTagId, BitnotTagId, EqTagId, NeqTagId, LeTagId, LtTagId, CastTagId, ConvTagId, CallTagId, CmdTagId, CchoiceTagId, OchoiceTagId, PragmaxTagId, QuotedTagId, HderefTagId, DdotTagId, HaddrTagId, NewrefTagId, NewobjTagId, TupTagId, TupconstrTagId, SetconstrTagId, TabconstrTagId, AshrTagId, BaseobjTagId, HconvTagId, DconvTagId, CallstrlitTagId, InfixTagId, PrefixTagId, HcallTagId, CompilesTagId, DeclaredTagId, DefinedTagId, AstToStrTagId, InstanceofTagId, ProccallTagId, HighTagId, LowTagId, TypeofTagId, UnpackTagId, FieldsTagId, FieldpairsTagId, EnumtostrTagId, IsmainmoduleTagId, DefaultobjTagId, DefaulttupTagId, DefaultdistinctTagId, DelayTagId, Delay0TagId, SuspendTagId, ExprTagId, DoTagId, ArratTagId, TupatTagId, PlussetTagId, MinussetTagId, MulsetTagId, XorsetTagId, EqsetTagId, LesetTagId, LtsetTagId, InsetTagId, CardTagId, EmoveTagId, DestroyTagId, DupTagId, CopyTagId, WasmovedTagId, SinkhTagId, TraceTagId, InternalTypeNameTagId, InternalFieldPairsTagId, FailedTagId, IsTagId, EnvpTagId}

type
  NimonyStmt* = enum
    NoStmt
    CallS = (ord(CallTagId), "call")  ## call operation
    CmdS = (ord(CmdTagId), "cmd")  ## command operation
    GvarS = (ord(GvarTagId), "gvar")  ## global variable declaration
    TvarS = (ord(TvarTagId), "tvar")  ## thread local variable declaration
    VarS = (ord(VarTagId), "var")  ## variable declaration; type slot may be omitted when inferred from initializer
    ConstS = (ord(ConstTagId), "const")  ## const variable declaration
    ResultS = (ord(ResultTagId), "result")  ## result variable declaration
    GletS = (ord(GletTagId), "glet")  ## global let variable declaration
    TletS = (ord(TletTagId), "tlet")  ## thread local let variable declaration
    LetS = (ord(LetTagId), "let")  ## let variable declaration; type is optional when used in `(unpackflat …)`
    CursorS = (ord(CursorTagId), "cursor")  ## cursor variable declaration
    PatternvarS = (ord(PatternvarTagId), "patternvar")  ## pattern variable declaration
    ProcS = (ord(ProcTagId), "proc")  ## proc declaration
    FuncS = (ord(FuncTagId), "func")  ## function declaration
    IteratorS = (ord(IteratorTagId), "iterator")  ## iterator declaration
    ConverterS = (ord(ConverterTagId), "converter")  ## converter declaration
    MethodS = (ord(MethodTagId), "method")  ## method declaration
    MacroS = (ord(MacroTagId), "macro")  ## macro declaration
    TemplateS = (ord(TemplateTagId), "template")  ## template declaration
    TypeS = (ord(TypeTagId), "type")  ## type declaration
    BlockS = (ord(BlockTagId), "block")  ## block declaration
    EmitS = (ord(EmitTagId), "emit")  ## emit statement
    AsgnS = (ord(AsgnTagId), "asgn")  ## assignment statement
    ScopeS = (ord(ScopeTagId), "scope")  ## explicit scope annotation, like `stmts`
    IfS = (ord(IfTagId), "if")  ## if statement header
    WhenS = (ord(WhenTagId), "when")  ## when statement header
    BreakS = (ord(BreakTagId), "break")  ## `break` statement
    ContinueS = (ord(ContinueTagId), "continue")  ## `continue` statement
    ForS = (ord(ForTagId), "for")  ## for statement
    WhileS = (ord(WhileTagId), "while")  ## `while` statement
    CaseS = (ord(CaseTagId), "case")  ## `case` statement
    RetS = (ord(RetTagId), "ret")  ## `return` instruction
    YldS = (ord(YldTagId), "yld")  ## yield statement
    StmtsS = (ord(StmtsTagId), "stmts")  ## list of statements
    PragmasS = (ord(PragmasTagId), "pragmas")  ## begin of pragma section
    PragmaxS = (ord(PragmaxTagId), "pragmax")  ## pragma expressions
    InclS = (ord(InclTagId), "incl")  ## `incl` set operation; first child is the set's element type
    ExclS = (ord(ExclTagId), "excl")  ## `excl` set operation; first child is the set's element type
    IncludeS = (ord(IncludeTagId), "include")  ## `include` statement
    ImportS = (ord(ImportTagId), "import")  ## `import` statement
    ImportasS = (ord(ImportasTagId), "importas")  ## `import as` statement
    FromimportS = (ord(FromimportTagId), "fromimport")  ## `from import` statement
    ImportexceptS = (ord(ImportexceptTagId), "importexcept")  ## `importexcept` statement
    ExportS = (ord(ExportTagId), "export")  ## `export` statement
    ExportexceptS = (ord(ExportexceptTagId), "exportexcept")  ## `exportexcept` statement
    CommentS = (ord(CommentTagId), "comment")  ## `comment` statement; also used as a variadic trailer for module metadata
    DiscardS = (ord(DiscardTagId), "discard")  ## `discard` statement; optional expression to discard
    TryS = (ord(TryTagId), "try")  ## `try` statement
    RaiseS = (ord(RaiseTagId), "raise")  ## `raise` statement
    UnpackdeclS = (ord(UnpackdeclTagId), "unpackdecl")  ## unpack var/let/const declaration
    AssumeS = (ord(AssumeTagId), "assume")  ## `assume` pragma/annotation
    AssertS = (ord(AssertTagId), "assert")  ## `assert` pragma/annotation
    CallstrlitS = (ord(CallstrlitTagId), "callstrlit")
    InfixS = (ord(InfixTagId), "infix")  ## infix call form kept verbatim inside unsem'd bodies: operator followed by two or more operands (extra args come from default parameters, e.g. `s $ 80` → `` `$`(s, 80, defaultReplacement) ``)
    PrefixS = (ord(PrefixTagId), "prefix")  ## prefix call form kept verbatim inside unsem'd bodies: operator followed by single operand
    HcallS = (ord(HcallTagId), "hcall")  ## hidden converter call
    StaticstmtS = (ord(StaticstmtTagId), "staticstmt")  ## `static` statement
    BindS = (ord(BindTagId), "bind")  ## `bind` statement
    MixinS = (ord(MixinTagId), "mixin")  ## `mixin` statement
    UsingS = (ord(UsingTagId), "using")  ## `using` statement
    AsmS = (ord(AsmTagId), "asm")  ## `asm` statement
    DeferS = (ord(DeferTagId), "defer")  ## `defer` statement

proc rawTagIsNimonyStmt*(raw: TagEnum): bool {.inline.} =
  raw in {CallTagId, CmdTagId, GvarTagId, TvarTagId, VarTagId, ConstTagId, ResultTagId, GletTagId, TletTagId, LetTagId, CursorTagId, PatternvarTagId, ProcTagId, FuncTagId, IteratorTagId, ConverterTagId, MethodTagId, MacroTagId, TemplateTagId, TypeTagId, BlockTagId, EmitTagId, AsgnTagId, ScopeTagId, IfTagId, WhenTagId, BreakTagId, ContinueTagId, ForTagId, WhileTagId, CaseTagId, RetTagId, YldTagId, StmtsTagId, PragmasTagId, PragmaxTagId, InclTagId, ExclTagId, IncludeTagId, ImportTagId, ImportasTagId, FromimportTagId, ImportexceptTagId, ExportTagId, ExportexceptTagId, CommentTagId, DiscardTagId, TryTagId, RaiseTagId, UnpackdeclTagId, AssumeTagId, AssertTagId, CallstrlitTagId, InfixTagId, PrefixTagId, HcallTagId, StaticstmtTagId, BindTagId, MixinTagId, UsingTagId, AsmTagId, DeferTagId}

type
  NimonyType* = enum
    NoType
    ErrT = (ord(ErrTagId), "err")  ## indicates an error
    AtT = (ord(AtTagId), "at")  ## array indexing operation (typed Nimony form vs untyped NIFC form); also used for generic proc/type instantiation `(at callee T1 T2 ...)`
    AndT = (ord(AndTagId), "and")  ## boolean `and` operation
    OrT = (ord(OrTagId), "or")  ## boolean `or` operation
    NotT = (ord(NotTagId), "not")  ## boolean `not` operation
    ProcT = (ord(ProcTagId), "proc")  ## proc declaration
    FuncT = (ord(FuncTagId), "func")  ## function declaration
    IteratorT = (ord(IteratorTagId), "iterator")  ## iterator declaration
    ConverterT = (ord(ConverterTagId), "converter")  ## converter declaration
    MethodT = (ord(MethodTagId), "method")  ## method declaration
    MacroT = (ord(MacroTagId), "macro")  ## macro declaration
    TemplateT = (ord(TemplateTagId), "template")  ## template declaration
    ObjectT = (ord(ObjectTagId), "object")  ## object type declaration
    EnumT = (ord(EnumTagId), "enum")  ## enum type declaration
    ProctypeT = (ord(ProctypeTagId), "proctype")  ## Nimony proc type. Slot 0 carries the nilability tag — either a `.` placeholder or one of `(notnil)`, `(nil)`, `(unchecked)`. NIFC proc type, same shape as `(proc D ...)` with anonymous name slot (varargs spec; effects/body slots present but unused).
    IT = (ord(ITagId), "i")  ## `int` builtin type
    UT = (ord(UTagId), "u")  ## `uint` builtin type; size in bits followed by optional attributes (`(importc ...)`, `(header ...)`, etc.)
    FT = (ord(FTagId), "f")  ## `float` builtin type
    CT = (ord(CTagId), "c")  ## `char` builtin type
    BoolT = (ord(BoolTagId), "bool")  ## `bool` builtin type
    VoidT = (ord(VoidTagId), "void")  ## `void` return type
    PtrT = (ord(PtrTagId), "ptr")  ## `ptr` type contructor; the `(unchecked)` pragma relaxes nil checking on deref
    ArrayT = (ord(ArrayTagId), "array")  ## `array` type constructor (element type, index type/range)
    VarargsT = (ord(VarargsTagId), "varargs")  ## `varargs` type/proc annotation: Nimony carries the element type and an optional transformer symbol (e.g. `` `$` ``); NIFC keeps only the element type
    StaticT = (ord(StaticTagId), "static")  ## `static` type or annotation
    TupleT = (ord(TupleTagId), "tuple")  ## `tuple` type
    OnumT = (ord(OnumTagId), "onum")  ## enum with holes type
    AnumT = (ord(AnumTagId), "anum")  ## sum type discriminator enum ("auto enum")
    RefT = (ord(RefTagId), "ref")  ## `ref` type; the `(unchecked)` pragma relaxes nil checking on deref
    MutT = (ord(MutTagId), "mut")  ## `mut` type
    OutT = (ord(OutTagId), "out")  ## `out` type
    LentT = (ord(LentTagId), "lent")  ## `lent` type
    SinkT = (ord(SinkTagId), "sink")  ## `sink` type
    NiltT = (ord(NiltTagId), "nilt")  ## `nilt` type
    ConceptT = (ord(ConceptTagId), "concept")  ## `concept` type: two reserved slots, a typevar symbol and the concept body statements
    DistinctT = (ord(DistinctTagId), "distinct")  ## `distinct` type
    ItertypeT = (ord(ItertypeTagId), "itertype")  ## `itertype` type
    RangetypeT = (ord(RangetypeTagId), "rangetype")  ## `rangetype` type
    UarrayT = (ord(UarrayTagId), "uarray")  ## `uarray` type
    SetT = (ord(SetTagId), "set")  ## `set` type
    AutoT = (ord(AutoTagId), "auto")  ## `auto` type
    SymkindT = (ord(SymkindTagId), "symkind")  ## `symkind` type
    TypekindT = (ord(TypekindTagId), "typekind")  ## `typekind` type
    TypedescT = (ord(TypedescTagId), "typedesc")  ## `typedesc` type
    UntypedT = (ord(UntypedTagId), "untyped")  ## `untyped` type
    TypedT = (ord(TypedTagId), "typed")  ## `typed` type
    CstringT = (ord(CstringTagId), "cstring")  ## `cstring` type; optional child is the string literal used in a `cstring"…"` generalized string
    PointerT = (ord(PointerTagId), "pointer")  ## `pointer` type; the optional `(nil)` annotation marks a nilable pointer
    OrdinalT = (ord(OrdinalTagId), "ordinal")  ## `ordinal` type

proc rawTagIsNimonyType*(raw: TagEnum): bool {.inline.} =
  raw in {ErrTagId, AtTagId, AndTagId, OrTagId, NotTagId, ProcTagId, FuncTagId, IteratorTagId, ConverterTagId, MethodTagId, MacroTagId, TemplateTagId, ObjectTagId, EnumTagId, ProctypeTagId, ITagId, UTagId, FTagId, CTagId, BoolTagId, VoidTagId, PtrTagId, ArrayTagId, VarargsTagId, StaticTagId, TupleTagId, OnumTagId, AnumTagId, RefTagId, MutTagId, OutTagId, LentTagId, SinkTagId, NiltTagId, ConceptTagId, DistinctTagId, ItertypeTagId, RangetypeTagId, UarrayTagId, SetTagId, AutoTagId, SymkindTagId, TypekindTagId, TypedescTagId, UntypedTagId, TypedTagId, CstringTagId, PointerTagId, OrdinalTagId}

type
  NimonyOther* = enum
    NoSub
    NilU = (ord(NilTagId), "nil")  ## nil pointer value; closure `nil` carries the proc type and a nil environment
    NotnilU = (ord(NotnilTagId), "notnil")  ## `not nil` pointer annotation
    UncheckedU = (ord(UncheckedTagId), "unchecked")  ## `unchecked` pointer annotation (derefs do not require nil checking)
    KvU = (ord(KvTagId), "kv")  ## key-value pair; optional INTLIT indicates field is in an inherited object
    VvU = (ord(VvTagId), "vv")  ## value-value pair (used for explicitly named arguments in function calls)
    RangeU = (ord(RangeTagId), "range")  ## `(range a b)` construct
    RangesU = (ord(RangesTagId), "ranges")
    ParamU = (ord(ParamTagId), "param")  ## parameter declaration
    TypevarU = (ord(TypevarTagId), "typevar")  ## type variable declaration; constraint `.T` is optional
    EfldU = (ord(EfldTagId), "efld")  ## enum field declaration; slot 2 carries the export marker *or* the compile-time value (may be `.`)
    FldU = (ord(FldTagId), "fld")  ## field declaration
    WhenU = (ord(WhenTagId), "when")  ## when statement header
    ElifU = (ord(ElifTagId), "elif")  ## pair of (condition, action)
    ElseU = (ord(ElseTagId), "else")  ## `else` action
    TypevarsU = (ord(TypevarsTagId), "typevars")  ## type variable/generic parameters
    CaseU = (ord(CaseTagId), "case")  ## `case` statement
    OfU = (ord(OfTagId), "of")  ## `of` branch within a `case` statement
    StmtsU = (ord(StmtsTagId), "stmts")  ## list of statements
    ParamsU = (ord(ParamsTagId), "params")  ## list of proc parameters, also used as a "proc type"
    PragmasU = (ord(PragmasTagId), "pragmas")  ## begin of pragma section
    EitherU = (ord(EitherTagId), "either")  ## `either` construct to combine location versions
    JoinU = (ord(JoinTagId), "join")  ## `join` construct inside `ite`
    UnpackflatU = (ord(UnpackflatTagId), "unpackflat")  ## unpack into flat variable list
    UnpacktupU = (ord(UnpacktupTagId), "unpacktup")  ## unpack tuple
    ExceptU = (ord(ExceptTagId), "except")  ## except subsection
    FinU = (ord(FinTagId), "fin")  ## finally subsection

proc rawTagIsNimonyOther*(raw: TagEnum): bool {.inline.} =
  raw in {NilTagId, NotnilTagId, UncheckedTagId, KvTagId, VvTagId, RangeTagId, RangesTagId, ParamTagId, TypevarTagId, EfldTagId, FldTagId, WhenTagId, ElifTagId, ElseTagId, TypevarsTagId, CaseTagId, OfTagId, StmtsTagId, ParamsTagId, PragmasTagId, EitherTagId, JoinTagId, UnpackflatTagId, UnpacktupTagId, ExceptTagId, FinTagId}

type
  NimonyPragma* = enum
    NoPragma
    CastP = (ord(CastTagId), "cast")  ## `cast` operation (typed cast expression, or `{.cast(pragma).}` pragma form)
    CursorP = (ord(CursorTagId), "cursor")  ## cursor variable declaration
    EmitP = (ord(EmitTagId), "emit")  ## emit statement
    UnionP = (ord(UnionTagId), "union")  ## first one is Nifc union declaration, second one is Nimony union pragma
    InlineP = (ord(InlineTagId), "inline")  ## `inline` proc annotation
    NoinlineP = (ord(NoinlineTagId), "noinline")  ## `noinline` proc annotation
    ClosureP = (ord(ClosureTagId), "closure")  ## `closure` proc annotation; not a calling convention anymore, simply annotates a proc as a closure
    VarargsP = (ord(VarargsTagId), "varargs")  ## `varargs` type/proc annotation: Nimony carries the element type and an optional transformer symbol (e.g. `` `$` ``); NIFC keeps only the element type
    SelectanyP = (ord(SelectanyTagId), "selectany")
    AlignP = (ord(AlignTagId), "align")
    BitsP = (ord(BitsTagId), "bits")
    NodeclP = (ord(NodeclTagId), "nodecl")  ## `nodecl` annotation
    RaisesP = (ord(RaisesTagId), "raises")  ## proc annotation; optional list of exception types the proc may raise
    UntypedP = (ord(UntypedTagId), "untyped")  ## `untyped` type
    MagicP = (ord(MagicTagId), "magic")  ## `magic` pragma; argument is the magic's name as string literal or ident (e.g. `"Bool"`, `HoleyEnum`)
    ImportcP = (ord(ImportcTagId), "importc")  ## `importc` pragma
    ImportcppP = (ord(ImportcppTagId), "importcpp")  ## `importcpp` pragma
    DynlibP = (ord(DynlibTagId), "dynlib")  ## `dynlib` pragma
    ExportcP = (ord(ExportcTagId), "exportc")  ## `exportc` pragma
    HeaderP = (ord(HeaderTagId), "header")  ## `header` pragma
    ThreadvarP = (ord(ThreadvarTagId), "threadvar")  ## `threadvar` pragma
    GlobalP = (ord(GlobalTagId), "global")  ## `global` pragma
    DiscardableP = (ord(DiscardableTagId), "discardable")  ## `discardable` pragma
    NoreturnP = (ord(NoreturnTagId), "noreturn")  ## `noreturn` pragma
    BorrowP = (ord(BorrowTagId), "borrow")  ## `borrow` pragma
    NoSideEffectP = (ord(NoSideEffectTagId), "noSideEffect")  ## `noSideEffect` pragma
    NodestroyP = (ord(NodestroyTagId), "nodestroy")  ## `nodestroy` pragma
    PluginP = (ord(PluginTagId), "plugin")  ## `plugin` pragma
    BycopyP = (ord(BycopyTagId), "bycopy")  ## `bycopy` pragma
    ByrefP = (ord(ByrefTagId), "byref")  ## `byref` pragma
    NoinitP = (ord(NoinitTagId), "noinit")  ## `noinit` pragma
    RequiresP = (ord(RequiresTagId), "requires")  ## `requires` pragma
    EnsuresP = (ord(EnsuresTagId), "ensures")  ## `ensures` pragma
    AssumeP = (ord(AssumeTagId), "assume")  ## `assume` pragma/annotation
    AssertP = (ord(AssertTagId), "assert")  ## `assert` pragma/annotation
    BuildP = (ord(BuildTagId), "build")  ## `build` pragma
    FeatureP = (ord(FeatureTagId), "feature")  ## `feature` pragma
    StringP = (ord(StringTagId), "string")  ## `string` pragma
    ViewP = (ord(ViewTagId), "view")  ## `view` pragma
    IncompleteStructP = (ord(IncompleteStructTagId), "incompleteStruct")  ## `incompleteStruct` pragma
    InjectP = (ord(InjectTagId), "inject")  ## `inject` pragma
    GensymP = (ord(GensymTagId), "gensym")  ## `gensym` pragma
    DirtyP = (ord(DirtyTagId), "dirty")  ## `dirty` pragma
    ErrorP = (ord(ErrorTagId), "error")  ## `error` pragma
    ReportP = (ord(ReportTagId), "report")  ## `report` pragma
    TagsP = (ord(TagsTagId), "tags")  ## `tags` effect annotation
    DeprecatedP = (ord(DeprecatedTagId), "deprecated")  ## `deprecated` pragma
    SideEffectP = (ord(SideEffectTagId), "sideEffect")  ## explicit `sideEffect` pragma
    KeepOverflowFlagP = (ord(KeepOverflowFlagTagId), "keepOverflowFlag")  ## keep overflow flag
    SemanticsP = (ord(SemanticsTagId), "semantics")  ## proc with builtin behavior for expreval
    InheritableP = (ord(InheritableTagId), "inheritable")  ## `inheritable` pragma
    BaseP = (ord(BaseTagId), "base")  ## `base` pragma (currently ignored)
    PureP = (ord(PureTagId), "pure")  ## `pure` pragma (currently ignored)
    FinalP = (ord(FinalTagId), "final")  ## `final` pragma
    AcyclicP = (ord(AcyclicTagId), "acyclic")  ## `acyclic` pragma (currently ignored)
    PragmaP = (ord(PragmaTagId), "pragma")  ## `pragma` pragma
    PackedP = (ord(PackedTagId), "packed")  ## `packed` pragma
    PassiveP = (ord(PassiveTagId), "passive")  ## `passive` pragma
    PushP = (ord(PushTagId), "push")  ## `push` pragma
    CallConvP = (ord(CallConvTagId), "callConv")  ## `callConv` pragma for setting calling convention
    PopP = (ord(PopTagId), "pop")  ## `pop` pragma
    PassLP = (ord(PassLTagId), "passL")  ## `passL` pragma adds options to the backend linker
    PassCP = (ord(PassCTagId), "passC")  ## `passC` pragma adds options to the backend compiler
    MethodsP = (ord(MethodsTagId), "methods")  ## `methods` pragma lists vtable methods for a type
    SizeP = (ord(SizeTagId), "size")  ## `size` pragma for setting the byte size of a type

proc rawTagIsNimonyPragma*(raw: TagEnum): bool {.inline.} =
  raw in {CastTagId, CursorTagId, EmitTagId, UnionTagId, InlineTagId, NoinlineTagId, ClosureTagId, VarargsTagId, SelectanyTagId, AlignTagId, BitsTagId, NodeclTagId, RaisesTagId, UntypedTagId, MagicTagId, ImportcTagId, ImportcppTagId, DynlibTagId, ExportcTagId, HeaderTagId, ThreadvarTagId, GlobalTagId, DiscardableTagId, NoreturnTagId, BorrowTagId, NoSideEffectTagId, NodestroyTagId, PluginTagId, BycopyTagId, ByrefTagId, NoinitTagId, RequiresTagId, EnsuresTagId, AssumeTagId, AssertTagId, BuildTagId, FeatureTagId, StringTagId, ViewTagId, IncompleteStructTagId, InjectTagId, GensymTagId, DirtyTagId, ErrorTagId, ReportTagId, TagsTagId, DeprecatedTagId, SideEffectTagId, KeepOverflowFlagTagId, SemanticsTagId, InheritableTagId, BaseTagId, PureTagId, FinalTagId, AcyclicTagId, PragmaTagId, PackedTagId, PassiveTagId, PushTagId, CallConvTagId, PopTagId, PassLTagId, PassCTagId, MethodsTagId, SizeTagId}

type
  NimonySym* = enum
    NoSym
    GvarY = (ord(GvarTagId), "gvar")  ## global variable declaration
    TvarY = (ord(TvarTagId), "tvar")  ## thread local variable declaration
    VarY = (ord(VarTagId), "var")  ## variable declaration; type slot may be omitted when inferred from initializer
    ParamY = (ord(ParamTagId), "param")  ## parameter declaration
    ConstY = (ord(ConstTagId), "const")  ## const variable declaration
    ResultY = (ord(ResultTagId), "result")  ## result variable declaration
    GletY = (ord(GletTagId), "glet")  ## global let variable declaration
    TletY = (ord(TletTagId), "tlet")  ## thread local let variable declaration
    LetY = (ord(LetTagId), "let")  ## let variable declaration; type is optional when used in `(unpackflat …)`
    CursorY = (ord(CursorTagId), "cursor")  ## cursor variable declaration
    PatternvarY = (ord(PatternvarTagId), "patternvar")  ## pattern variable declaration
    TypevarY = (ord(TypevarTagId), "typevar")  ## type variable declaration; constraint `.T` is optional
    EfldY = (ord(EfldTagId), "efld")  ## enum field declaration; slot 2 carries the export marker *or* the compile-time value (may be `.`)
    FldY = (ord(FldTagId), "fld")  ## field declaration
    ProcY = (ord(ProcTagId), "proc")  ## proc declaration
    FuncY = (ord(FuncTagId), "func")  ## function declaration
    IteratorY = (ord(IteratorTagId), "iterator")  ## iterator declaration
    ConverterY = (ord(ConverterTagId), "converter")  ## converter declaration
    MethodY = (ord(MethodTagId), "method")  ## method declaration
    MacroY = (ord(MacroTagId), "macro")  ## macro declaration
    TemplateY = (ord(TemplateTagId), "template")  ## template declaration
    TypeY = (ord(TypeTagId), "type")  ## type declaration
    BlockY = (ord(BlockTagId), "block")  ## block declaration
    ModuleY = (ord(ModuleTagId), "module")  ## module declaration
    CchoiceY = (ord(CchoiceTagId), "cchoice")  ## closed choice

proc rawTagIsNimonySym*(raw: TagEnum): bool {.inline.} =
  raw >= GvarTagId and raw <= CchoiceTagId

type
  HookKind* = enum
    NoHook
    DestroyH = (ord(DestroyTagId), "destroy")
    DupH = (ord(DupTagId), "dup")
    CopyH = (ord(CopyTagId), "copy")
    WasmovedH = (ord(WasmovedTagId), "wasmoved")
    SinkhH = (ord(SinkhTagId), "sinkh")
    TraceH = (ord(TraceTagId), "trace")

proc rawTagIsHookKind*(raw: TagEnum): bool {.inline.} =
  raw >= DestroyTagId and raw <= TraceTagId

type
  ControlFlowKind* = enum
    NoControlFlow
    IteF = (ord(IteTagId), "ite")  ## if-then-else followed by `join` information followed by an optional label
    GraphF = (ord(GraphTagId), "graph")  ## disjoint subgraph annotation
    ForbindF = (ord(ForbindTagId), "forbind")  ## bindings for a `for` loop but the loop itself is mapped to gotos
    KillF = (ord(KillTagId), "kill")  ## some.var is about to disappear (scope exit)

proc rawTagIsControlFlowKind*(raw: TagEnum): bool {.inline.} =
  raw in {IteTagId, GraphTagId, ForbindTagId, KillTagId}

