gutomaia/pyNES — pull request #15 by danilobellini (2014-04-28 11:53:17+00:00)
Title: analyser using generators #11

- Solves issue #11 with generators
- Raises an `UnknownToken` instance with an useful error message, when it is the case (new class)
- String processing had some severe optimization (since strings are immutable) with a new line-based generator approach (new `code_line_generator` function)
- Both lexical and analyse now accepts both string (str or unicode) and file (StringIO, BytesIO or TextIOWrapper from io.open) as "code" input
- Tokenizing now is lazy (although syntax still doesn't use that for any optimization)

```
$ coverage run --branch setup.py test
[...]
----------------------------------------------------------------------
Ran 342 tests in 18.430s

OK (skipped=1)

$ coverage report pynes/analyzer.py
Name Stmts Miss Branch BrMiss Cover
--------------------------------------------------
pynes/analyzer 37 0 18 0 100%
```