Added static types

I put this within the type section, but I'm not sure if it should go here. It has a broader use. Should it get its own section?
This commit is contained in:
apense
2015-06-15 16:27:53 -04:00
parent 3c9d655b88
commit 8c8e975bcd

View File

@@ -878,6 +878,26 @@ AST:
# ...
)
Static types, like ``static[int]``, use ``nnkIdent`` wrapped in
``nnkStaticTy``.
Concrete syntax:
.. code-block:: nim
type A[T: static[int]] = object
AST:
.. code-block:: nim
# ... within nnkGenericParams
nnkIdentDefs(
nnkIdent(!"T"),
nnkStaticTy(
nnkIdent(!"int")
),
nnkEmpty()
)
# ...
Procedure declaration
---------------------