From 8c8e975bcd286b41e8308a6deab0f1d00849c681 Mon Sep 17 00:00:00 2001 From: apense Date: Mon, 15 Jun 2015 16:27:53 -0400 Subject: [PATCH] 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? --- doc/astspec.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doc/astspec.txt b/doc/astspec.txt index 6b64e5b918..ef0c91bb84 100644 --- a/doc/astspec.txt +++ b/doc/astspec.txt @@ -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 ---------------------