diff options
author | Andreas Rumpf <andreas@andreas-desktop> | 2009-11-12 19:34:21 +0100 |
---|---|---|
committer | Andreas Rumpf <andreas@andreas-desktop> | 2009-11-12 19:34:21 +0100 |
commit | ac421c37ba9a973155dc5600e38d7a40553d8de6 (patch) | |
tree | 5ede0dfe1c02aa547f788a39f070614a64a3b9ab /doc/astspec.txt | |
parent | d5acb88cccecf54bcc9a7c13f4fbaa095a8b37d4 (diff) | |
download | Nim-ac421c37ba9a973155dc5600e38d7a40553d8de6.tar.gz |
bind table
Diffstat (limited to 'doc/astspec.txt')
-rwxr-xr-x | doc/astspec.txt | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/doc/astspec.txt b/doc/astspec.txt index eec2808fd..01c1adba3 100755 --- a/doc/astspec.txt +++ b/doc/astspec.txt @@ -20,7 +20,7 @@ contains: PNimrodNode = ref TNimrodNode TNimrodNode {.final.} = object - case kind ## the node's kind + case kind: TNimrodNodeKind ## the node's kind of nnkNone, nnkEmpty, nnkNilLit: nil ## node contains no additional fields of nnkCharLit..nnkInt64Lit: @@ -43,6 +43,11 @@ To specify the AST for the different Nimrod constructs, the notation ``nodekind(son1, son2, ...)`` or ``nodekind(value)`` or ``nodekind(field=value)`` is used. +Some child may be missing. Then it is ``nil``. A nil child is equivalent to +a node of kind ``nnkEmpty``. This is more or less a (useful) artifact from +the implementation. (In the compiler's implementation ``nil`` is of course +not the same as ``nnkEmpty``!) + Leaf nodes/Atoms ================ @@ -72,8 +77,9 @@ Nimrod expression corresponding AST Identifiers are ``nnkIdent`` nodes. After the name lookup pass these nodes get transferred into ``nnkSym`` nodes. However, a macro receives an AST that has not been checked for semantics and thus the identifiers have not been -looked up. Thus macros deal with ``nnkIdent`` nodes. - +looked up. Macros should deal with ``nnkIdent`` nodes and do not need to deal +with ``nnkSym`` nodes. + Calls/expressions ================= |