Nimrod renamed to Nim
This commit is contained in:
parent
c95e47216f
commit
3ea6446900
30 changed files with 379 additions and 379 deletions
|
|
@ -171,7 +171,7 @@ The PEG parser implements this grammar (written in PEG syntax)::
|
|||
expression, identifiers are not interpreted as non-terminals, but are
|
||||
interpreted as verbatim string:
|
||||
|
||||
.. code-block:: nimrod
|
||||
.. code-block:: nim
|
||||
abc =~ peg"abc" # is true
|
||||
|
||||
So it is not necessary to write ``peg" 'abc' "`` in the above example.
|
||||
|
|
@ -182,17 +182,17 @@ Examples
|
|||
|
||||
Check if `s` matches Nim's "while" keyword:
|
||||
|
||||
.. code-block:: nimrod
|
||||
.. code-block:: nim
|
||||
s =~ peg" y'while'"
|
||||
|
||||
Exchange (key, val)-pairs:
|
||||
|
||||
.. code-block:: nimrod
|
||||
.. code-block:: nim
|
||||
"key: val; key2: val2".replace(peg"{\ident} \s* ':' \s* {\ident}", "$2: $1")
|
||||
|
||||
Determine the ``#include``'ed files of a C file:
|
||||
|
||||
.. code-block:: nimrod
|
||||
.. code-block:: nim
|
||||
for line in lines("myfile.c"):
|
||||
if line =~ peg"""s <- ws '#include' ws '"' {[^"]+} '"' ws
|
||||
comment <- '/*' @ '*/' / '//' .*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue