Fix user guide double backslashes in examples
This commit is contained in:
parent
9d686989ec
commit
5b94b03b04
@ -67,10 +67,10 @@ import std.math;
|
|||||||
ptype ulong;
|
ptype ulong;
|
||||||
|
|
||||||
# A few basic arithmetic operators.
|
# A few basic arithmetic operators.
|
||||||
token plus /\\+/;
|
token plus /\+/;
|
||||||
token times /\\*/;
|
token times /\*/;
|
||||||
token power /\\*\\*/;
|
token power /\*\*/;
|
||||||
token integer /\\d+/ <<
|
token integer /\d+/ <<
|
||||||
ulong v;
|
ulong v;
|
||||||
foreach (c; match)
|
foreach (c; match)
|
||||||
{
|
{
|
||||||
@ -79,10 +79,10 @@ token integer /\\d+/ <<
|
|||||||
}
|
}
|
||||||
$$ = v;
|
$$ = v;
|
||||||
>>
|
>>
|
||||||
token lparen /\\(/;
|
token lparen /\(/;
|
||||||
token rparen /\\)/;
|
token rparen /\)/;
|
||||||
# Drop whitespace.
|
# Drop whitespace.
|
||||||
drop /\\s+/;
|
drop /\s+/;
|
||||||
|
|
||||||
Start -> E1 << $$ = $1; >>
|
Start -> E1 << $$ = $1; >>
|
||||||
E1 -> E2 << $$ = $1; >>
|
E1 -> E2 << $$ = $1; >>
|
||||||
@ -155,7 +155,7 @@ Example:
|
|||||||
```
|
```
|
||||||
ptype ulong;
|
ptype ulong;
|
||||||
|
|
||||||
token integer /\\d+/ <<
|
token integer /\d+/ <<
|
||||||
ulong v;
|
ulong v;
|
||||||
foreach (c; match)
|
foreach (c; match)
|
||||||
{
|
{
|
||||||
@ -228,9 +228,9 @@ token two /2/;
|
|||||||
token comma /,/ <<
|
token comma /,/ <<
|
||||||
$$ = 42;
|
$$ = 42;
|
||||||
>>
|
>>
|
||||||
token lparen /\\(/;
|
token lparen /\(/;
|
||||||
token rparen /\\)/;
|
token rparen /\)/;
|
||||||
drop /\\s+/;
|
drop /\s+/;
|
||||||
|
|
||||||
Start -> Items;
|
Start -> Items;
|
||||||
|
|
||||||
@ -552,10 +552,10 @@ default, identonly: token ident /[a-z]+/ <<
|
|||||||
$mode(default);
|
$mode(default);
|
||||||
return $token(ident);
|
return $token(ident);
|
||||||
>>
|
>>
|
||||||
token dot /\\./ <<
|
token dot /\./ <<
|
||||||
$mode(identonly);
|
$mode(identonly);
|
||||||
>>
|
>>
|
||||||
default, identonly: drop /\\s+/;
|
default, identonly: drop /\s+/;
|
||||||
```
|
```
|
||||||
|
|
||||||
##> Specifying parser value types - the `ptype` statement
|
##> Specifying parser value types - the `ptype` statement
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user