Skip to content

implementation notes

Timothee Cour edited this page Mar 23, 2020 · 2 revisions

parser

semantic phase

  • example showing using a regular nim callback to implement a compiler semExpr
if b[1][0].whichPragma == wByAddr3:
  if n.len == 1:
    result = newTree(nkCall)
    result.add newIdentNode(getIdent(c.cache, "byAddr3Impl"), n.info)
    result.add b[0]
    result.add a[2]
    result = semExprNoType(c, result)

(extracted from https://github.com/nim-lang/Nim/pull/13508)

Clone this wiki locally