Skip to content

Commit

Permalink
Remove token tree from hello world example.
Browse files Browse the repository at this point in the history
  • Loading branch information
eerimoq committed Jul 30, 2018
1 parent a6034ea commit 5866b42
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
14 changes: 0 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ The script:

.. code-block:: python
from pprint import pprint
import textparser
from textparser import Sequence
Expand All @@ -57,12 +55,8 @@ The script:
tree = Parser().parse('Hello, World!')
token_tree = Parser().parse('Hello, World!', token_tree=True)
print('Tree:', tree)
print()
print('Token tree:')
pprint(token_tree)
Script execution:

Expand All @@ -71,14 +65,6 @@ Script execution:
$ env PYTHONPATH=. python3 examples/hello_world.py
Tree: ['Hello', ',', 'World', '!']
Token tree:
[Token(kind='WORD', value='Hello', offset=0),
Token(kind=',', value=',', offset=5),
Token(kind='WORD', value='World', offset=7),
Token(kind='!', value='!', offset=12)]
.. _pretty fast:

Benchmark
=========

Expand Down
12 changes: 0 additions & 12 deletions examples/hello_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
# $ env PYTHONPATH=.. python3 hello_world.py
# Tree: ['Hello', ',', 'World', '!']
#
# Token tree:
# [Token(kind='WORD', value='Hello', offset=0),
# Token(kind=',', value=',', offset=5),
# Token(kind='WORD', value='World', offset=7),
# Token(kind='!', value='!', offset=12)]
#

from pprint import pprint

import textparser
from textparser import Sequence
Expand All @@ -32,9 +24,5 @@ def grammar(self):


tree = Parser().parse('Hello, World!')
token_tree = Parser().parse('Hello, World!', token_tree=True)

print('Tree:', tree)
print()
print('Token tree:')
pprint(token_tree)

0 comments on commit 5866b42

Please sign in to comment.