diff options
author | Clay Sweetser <clay.sweetser@gmail.com> | 2014-08-09 16:40:58 -0400 |
---|---|---|
committer | Clay Sweetser <clay.sweetser@gmail.com> | 2014-08-09 16:40:58 -0400 |
commit | f8ea5f1a37de1d86e494477a8ac95165a3c81310 (patch) | |
tree | 8f978e1c65c5845d336eac841b8ddcd2c7b02d52 /compiler/ast.nim | |
parent | e46a735bb5a6720851fef4630cea1adeff9ae1fd (diff) | |
download | Nim-f8ea5f1a37de1d86e494477a8ac95165a3c81310.tar.gz |
Adds documentation on skipTypes and mapType
Diffstat (limited to 'compiler/ast.nim')
-rw-r--r-- | compiler/ast.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim index 51319127c..7ad294695 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -1313,6 +1313,10 @@ proc newSons(father: PNode, length: int) = setLen(father.sons, length) proc skipTypes*(t: PType, kinds: TTypeKinds): PType = + ## Used throughout the compiler code to test whether a type tree contains or + ## doesn't contain a specific type/types - it is often the case that only the + ## last child nodes of a type tree need to be searched. This is a really hot + ## path within the compiler! result = t while result.kind in kinds: result = lastSon(result) |