diff options
author | Araq <rumpf_a@web.de> | 2012-03-13 02:01:56 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-03-13 02:01:56 +0100 |
commit | c25ffbf2622a197c15a4a3bd790b1bc788db2c7f (patch) | |
tree | d1a23e97a11a92bc83286fd77ba4e4a953d753fa /doc/grammar.txt | |
parent | 1d8ff40f5679d3ddfa10a89b0333a0132ee1e1b2 (diff) | |
download | Nim-c25ffbf2622a197c15a4a3bd790b1bc788db2c7f.tar.gz |
first steps for cleaner static/const distinction
Diffstat (limited to 'doc/grammar.txt')
-rwxr-xr-x | doc/grammar.txt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/grammar.txt b/doc/grammar.txt index 325a29ad5..4fb18024d 100755 --- a/doc/grammar.txt +++ b/doc/grammar.txt @@ -26,6 +26,7 @@ indexExpr ::= expr castExpr ::= 'cast' '[' optInd typeDesc optPar ']' '(' optInd expr optPar ')' addrExpr ::= 'addr' '(' optInd expr optPar ')' +staticExpr ::= 'static' '(' optInd expr optPar ')' symbol ::= '`' (KEYWORD | IDENT | operator | '(' ')' | '[' ']' | '{' '}' | '=' | literal)+ '`' | IDENT @@ -37,7 +38,7 @@ primarySuffix ::= '.' optInd symbol [generalizedLit] | '{' optInd [indexExpr (comma indexExpr)* [comma]] optPar '}' primary ::= primaryPrefix* (symbol [generalizedLit] | - constructor | castExpr | addrExpr) + constructor | castExpr | addrExpr | staticExpr) primarySuffix* generalizedLit ::= GENERALIZED_STR_LIT | GENERALIZED_TRIPLESTR_LIT @@ -97,7 +98,7 @@ simpleStmt ::= returnStmt | includeStmt | exprStmt complexStmt ::= ifStmt | whileStmt | caseStmt | tryStmt | forStmt - | blockStmt | asmStmt + | blockStmt | staticStmt | asmStmt | procDecl | iteratorDecl | macroDecl | templateDecl | methodDecl | constSection | letSection | varSection | typeSection | whenStmt | bindStmt @@ -131,6 +132,7 @@ tryStmt ::= 'try' ':' stmt ['finally' ':' stmt] asmStmt ::= 'asm' [pragma] (STR_LIT | RSTR_LIT | TRIPLESTR_LIT) blockStmt ::= 'block' [symbol] ':' stmt +staticStmt ::= 'static' ':' stmt filename ::= symbol | STR_LIT | RSTR_LIT | TRIPLESTR_LIT importStmt ::= 'import' filename (comma filename)* includeStmt ::= 'include' filename (comma filename)* |