src/pylib/pysugar/stmt/decl

Source   Edit  

Literal[a, b] cannot be implemented in Nim's type system (i.e. via type Literal[...)

Types

DoXxx = untyped
Callable in form of proc (name, typ, val: NimNode): NimNode Source   Edit  

Procs

proc parseDeclWithType(def: NimNode): tuple[name, typ, val: NimNode] {.
    ...raises: [], tags: [], forbids: [].}
a: int -> a int <EmptyNode> a: int = 1 -> a int 1 Source   Edit  
proc rewriteDeclInStmtAux(variable, oriTyp, val: NimNode;
                          typId = oriTyp.ensureType): NimNode {....raises: [],
    tags: [], forbids: [].}
Source   Edit  

Templates

template rewriteDeclAux(variable, oriTyp, val: NimNode;
                        typId = oriTyp.ensureType;
                        doLiteral: DoXxx = newConstStmtWithType;
                        doFinal: DoXxx = nnkLetSection.newDecl;
                        doElse: DoXxx = nnkVarSection.newDecl): NimNode
defined as a template to simulate doXxx argument accepting Curried function Source   Edit