Fixed doc typo
This commit is contained in:
parent
39ffd0361a
commit
8a67ae946b
@ -883,7 +883,7 @@ it is to enclose one more more symbols in [ ] like this::
|
|||||||
if p.item is not None:
|
if p.item is not None:
|
||||||
print("item was given and has value", p.item)
|
print("item was given and has value", p.item)
|
||||||
else:
|
else:
|
||||||
print("item was not given"
|
print("item was not given")
|
||||||
|
|
||||||
@_('whatever')
|
@_('whatever')
|
||||||
def item(self, p):
|
def item(self, p):
|
||||||
@ -900,8 +900,9 @@ list of comma separated expressions. To parse that, you could write::
|
|||||||
return [p.expr0] + p.expr1
|
return [p.expr0] + p.expr1
|
||||||
|
|
||||||
In this example, the ``{ COMMA expr }`` represents zero or more repetitions
|
In this example, the ``{ COMMA expr }`` represents zero or more repetitions
|
||||||
of a rule. The value of all symbols inside is now a list. So, ``p.expr``
|
of a rule. The value of all symbols inside is now a list. So, ``p.expr1``
|
||||||
is a list of all expressions matched.
|
is a list of all expressions matched. Note, when duplicate symbol names
|
||||||
|
appear in a rule, they are distinguished by appending a numeric index as shown.
|
||||||
|
|
||||||
Dealing With Ambiguous Grammars
|
Dealing With Ambiguous Grammars
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Loading…
Reference in New Issue
Block a user