summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-01-23 17:19:12 +0100
committerAraq <rumpf_a@web.de>2014-01-23 17:19:12 +0100
commit3e5cb6644f4df51c3f3131108fc7836c431b53c2 (patch)
tree959af7b93494a4f49a7f30212b62e596550d3911 /doc
parent556efb51588b97e18373b9fea4bd1bb667a8481c (diff)
downloadNim-3e5cb6644f4df51c3f3131108fc7836c431b53c2.tar.gz
typeClasses now documented in grammar.txt
Diffstat (limited to 'doc')
-rw-r--r--doc/grammar.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/grammar.txt b/doc/grammar.txt
index b002747fa..54c2217d8 100644
--- a/doc/grammar.txt
+++ b/doc/grammar.txt
@@ -97,6 +97,7 @@ primary = typeKeyw typeDescK
         / 'bind' primary
 typeDesc = simpleExpr
 typeDefAux = simpleExpr
+           | 'generic' typeClass
 macroColon = ':' stmt? ( IND{=} 'of' exprList ':' stmt 
                        | IND{=} 'elif' expr ':' stmt
                        | IND{=} 'except' exprList ':' stmt
@@ -163,6 +164,9 @@ objectCase = 'case' identWithPragma ':' typeDesc ':'? COMMENT?
 objectPart = IND{>} objectPart^+IND{=} DED
            / objectWhen / objectCase / 'nil' / declColonEquals
 object = 'object' pragma? ('of' typeDesc)? COMMENT? objectPart
+typeClassParam = ('var')? symbol
+typeClass = typeClassParam ^* ',' (pragma)? ('of' typeDesc ^* ',')?
+              &IND{>} stmt
 distinct = 'distinct' optInd typeDesc
 typeDef = identWithPragma genericParamList? '=' optInd typeDefAux
             indAndComment?