Types
Matcher = proc (n: NimNode): bool
- A proc that returns whether a NimNode should be replaced Source Edit
NodeFilter = proc (n: NimNode): NimNode
- Source Edit
NormalizingFilter = proc (n: NimNode): NormNode
- variant of NodeFilter but normalizes the node Source Edit
NormFilter = proc (n: NormNode): NormNode
- variant of NodeFilter but normalizes the node Source Edit
NormMatcher = proc (n: NormNode): bool {.noSideEffect.}
- A proc that returns whether a NimNode should be replaced Source Edit
Consts
NormalCallNodes = {nnkCommand..nnkPostfix}
- Source Edit
Procs
proc addInitializationToDefault(n: NimNode): NimNode {....raises: [], tags: [], forbids: [].}
- Turn an IdentDefs as in var x: Foo into var x: Foo = default Foo; this ensures a reset of the field in the environment occurs when the scope is re-entrant for any reason. Source Edit
proc childCallToRecoverResult(n, sym, field: NormNode): NormNode {.borrow, ...raises: [Exception], tags: [RootEffect], forbids: [].}
- this is used to rewrite continuation calls into their results Source Edit
proc childCallToRecoverResult(n: NimNode; sym: NimNode; field: NimNode): NimNode {. ...raises: [Exception], tags: [RootEffect], forbids: [].}
- this is used to rewrite continuation calls into their results Source Edit
proc filter(n: NimNode; f: NodeFilter): NimNode {....raises: [Exception], tags: [RootEffect], forbids: [].}
- rewrites a node and its children by passing each node to the filter; if the filter yields nil, the node is simply copied. otherwise, the node is replaced. Source Edit
proc filter(n: NimNode; f: NormalizingFilter): NormNode {....raises: [Exception], tags: [RootEffect], forbids: [].}
- rewrites a node and its children by passing each node to the filter; if the filter yields nil, the node is simply copied. otherwise, the node is replaced. Source Edit
proc multiReplace(n: NimNode; replacements: varargs[(Matcher, NimNode)]): NimNode {. ...raises: [Exception], tags: [RootEffect], forbids: [].}
- Replace any node in n that is matched by a matcher in replacements with a copy of the accompanying NimNode. Source Edit
proc multiReplace(n: NormNode; replacements: varargs[(Matcher, NormNode)]): NormNode {. ...raises: [Exception], tags: [RootEffect], forbids: [].}
- Replace any node in n that is matched by a matcher in replacements with a copy of the accompanying NimNode. Source Edit
proc multiReplace(n: NormNode; replacements: varargs[(NormMatcher, NormNode)]): NormNode {. ...raises: [Exception], tags: [RootEffect], forbids: [].}
- Replace any node in n that is matched by a matcher in replacements with a copy of the accompanying NimNode. Source Edit
proc normalizingRewrites(n: NimNode): NormNode {....raises: [Exception], tags: [RootEffect], forbids: [].}
- Rewrite AST into a safe form for manipulation without removing semantic data. Source Edit
proc replacedSymsWithIdents(n: NimNode): NimNode {....raises: [Exception], tags: [RootEffect], forbids: [].}
- Source Edit
proc workaroundRewrites(n: NormNode): NormNode {....raises: [Exception], tags: [RootEffect], forbids: [].}
- Source Edit