cps/hooks

Source   Edit  

The idea is that you can reimplement one of a few procedures which we will perform a late binding to by name.

Procs

proc findColonLit(n: NimNode; s: string; T: typedesc): T:type
Source   Edit  
proc hook(hook: static[Hook]; a, b: NormNode): NormNode
execute the given hook with two arguments Source   Edit  
proc hook(hook: static[Hook]; n: NormNode): NormNode
execute the given hook on the given node Source   Edit  
proc initFrame(hook: Hook; fun: string; info: LineInfo): NimNode {....raises: [],
    tags: [], forbids: [].}
prepare a tracing frame constructor Source   Edit  
proc introduce(hook: Hook; n: NormNode) {....raises: [], tags: [], forbids: [].}
introduce a hook into the given scope whatfer later use therein Source   Edit  
proc introduce(n: NormNode; hooks: set[Hook]) {....raises: [], tags: [],
    forbids: [].}
convenience to introduce a set of hooks Source   Edit  
proc makeLineInfo(n: NimNode): LineInfo {....raises: [ValueError], tags: [],
    forbids: [].}
return a run-time LineInfo into a compile-time LineInfo object Source   Edit  
proc nameForNode(n: NimNode): string {....raises: [], tags: [], forbids: [].}
produce some kind of useful string that names a node Source   Edit  
proc sym(hook: Hook): Name {....raises: [], tags: [], forbids: [].}
produce a symbol|ident for the hook procedure Source   Edit  
proc updateLineInfoForContinuationStackFrame(c, n: NimNode): NimNode {.
    ...raises: [], tags: [], forbids: [].}
c holds the continuation symbol, while n is a node with info Source   Edit  

Templates

template makeLineInfo(n: LineInfo): NimNode
turn a compile-time LineInfo object into a runtime LineInfo object Source   Edit