From 0e44d137f97a8206af1f2747391615e2f237f000 Mon Sep 17 00:00:00 2001
From: Andrey Makarov Note: Assignments, moves, and destruction are specified in the destructors document. The language constructs are explained using an extended BNF, in which (a)* means 0 or more a's, a+ means 1 or more a's, and (a)? means an optional a. Parentheses may be used to group elements. & is the lookahead operator; &a means that an a is expected but not consumed. It will be consumed in the following rule. Non-terminals start with a lowercase letter, abstract terminal symbols are in UPPERCASE. Verbatim terminal symbols (including keywords) are quoted with '. An example: Non-terminals start with a lowercase letter, abstract terminal symbols are in UPPERCASE. Verbatim terminal symbols (including keywords) are quoted with '. An example:$1
\n",
- "\n\n\\begin{rstpre}\n$2\n$1\n\\end{rstpre}\n\n", result)
+ "\n\n$2\\begin{rstpre}\n$1\n\\end{rstpre}\n\n", result)
of rnQuotedLiteralBlock:
doAssert false, "renderRstToOut"
of rnLineBlock:
diff --git a/nimdoc/rst2html/expected/rst_examples.html b/nimdoc/rst2html/expected/rst_examples.html
index 68b796be7..1df91ff1f 100644
--- a/nimdoc/rst2html/expected/rst_examples.html
+++ b/nimdoc/rst2html/expected/rst_examples.html
@@ -133,8 +133,7 @@ window.addEventListener('DOMContentLoaded', main);
-ifStmt = 'if' expr ':' stmts ('elif' expr ':' stmts)* ('else' stmts)?
+ifStmt = 'if' expr ':' stmts ('elif' expr ':' stmts)* ('else' stmts)?
In a typical Nim program, most of the code is compiled into the executable. However, some of the code may be executed at compile-time. This can include constant expressions, macro definitions, and Nim procedures used by macro definitions. Most of the Nim language is supported at compile-time, but there are some restrictions -- see Restrictions on Compile-Time Execution for details. We use the term runtime to cover both compile-time execution and code execution in the executable.
var a: array[0..1, char] @@ -146,8 +145,7 @@ ifStmt = 'if' expr ':' stmts ('elif' expr ':' stmts)* ('else' stmts)?
All Nim source files are in the UTF-8 encoding (or its ASCII subset). Other encodings are not supported. Any of the standard platform line termination sequences can be used - the Unix form using ASCII LF (linefeed), the Windows form using the ASCII sequence CR LF (return followed by linefeed), or the old Macintosh form using the ASCII CR (return) character. All of these forms can be used equally, regardless of the platform.
Nim's standard grammar describes an indentation sensitive language. This means that all the control structures are recognized by indentation. Indentation consists only of spaces; tabulators are not allowed.
-With this notation we can now easily define the core of the grammar: A block of statements (simplified example):
-ifStmt = 'if' expr ':' stmt +With this notation we can now easily define the core of the grammar: A block of statements (simplified example):
ifStmt = 'if' expr ':' stmt (IND{=} 'elif' expr ':' stmt)* (IND{=} 'else' ':' stmt)? @@ -174,18 +172,15 @@ stmt = IND{>} stmt ^+ IND{=} DED # list of statements\x HH character with hex value HH; exactly two hex digits are allowed \u HHHH unicode codepoint with hex value HHHH; exactly four hex digits are allowed - \u {H+} unicode codepoint; all hex digits enclosed in {} are used for the codepoint """"long string within quotes""""Produces:
-"long string within quotes"+""""long string within quotes""""Produces:
"long string within quotes"-Operators
Nim allows user defined operators. An operator is any combination of the following characters:
-= + - * / < > +Operators
Nim allows user defined operators. An operator is any combination of the following characters:
= + - * / < > @ $ ~ & % | ! ? ^ . : \(The grammar uses the terminal OPR to refer to operator symbols as defined here.)
-The following strings denote other tokens:
-` ( ) { } [ ] , ; [. .] {. .} (. .) [:+The following strings denote other tokens:
` ( ) { } [ ] , ; [. .] {. .} (. .) [:Otherwise, precedence is determined by the first character.
| Precedence level | Operators | First character | Terminal symbol |
|---|