| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Now that COMMENT tokens are reliably followed by NL or NEWLINE,
there is never a need to add extra newlines in untokenize.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Small: Always generate a NL or NEWLINE token following
a COMMENT token. The old code did not generate an NL token if
the comment was on a line by itself.
Large: The output of untokenize() will now match the
input exactly if it is passed the full token sequence. The
old, crufty output is still generated if a limited input
sequence is provided, where limited means that it does not
include position information for tokens.
Remaining bug: There is no CONTINUATION token (\) so there is no way
for untokenize() to handle such code.
Also, expanded the number of doctests in hopes of eventually removing
the old-style tests that compare against a golden file.
Bug fix candidate for Python 2.5.1. (Sigh.)
|
|
|
|
|
| |
Add a test to test_inspect to make sure indented source
is recognized correctly. (fixes #1224621)
|
| |
|
| |
|
|
|
|
|
|
| |
Should significantly enhance the utility of the module by supporting
the creation of tools that modify the token stream and writeback the
modified result.
|
|
|
|
|
| |
"@ seems the syntax that everybody can hate equally"
Implementation by Mark Russell, from SF #979728.
|
| |
|
| |
|
|
|
|
|
| |
a dict instead. (Alas, using a Set would be slower instead of
faster.)
|
| |
|
|
|
|
| |
Closes patch 556161.
|
|
|
|
|
| |
I left the email pkg alone; I'm not sure how Barry would like to handle
that.
|
| |
|
|
|
|
| |
Consequences for Jython still unknown (but raised on Jython-Dev).
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
the yield statement. I figure we have to have this in before I can
release 2.2a1 on Wednesday.
Note: test_generators is currently broken, I'm counting on Tim to fix
this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
committed.
tokenize.py: I like these changes, and have tested them extensively
without even realizing it, so I just updated the docstring and the docs.
tabnanny.py: Also liked this, but did a little code fiddling. I should
really rewrite this to *exploit* generators, but that's near the bottom
of my effort/benefit scale so doubt I'll get to it anytime soon (it
would be most useful as a non-trivial example of ideal use of generators;
but test_generators.py has already grown plenty of food-for-thought
examples).
inspect.py: I'm sure Ping intended for this to continue running even
under 1.5.2, so I reverted this to the last pre-gen-branch version. The
"bugfix" I checked in in-between was actually repairing a bug *introduced*
by the conversion to generators, so it's OK that the reverted version
doesn't reflect that checkin.
|
|
|
|
|
| |
Bugfix candidate in inspect.py: it was referencing "self" outside of
a method.
|
| |
|
| |
|
| |
|
|
|
|
| |
giving it a slight facelift
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
tokenize.py has always used naive regexps for matching string literals,
and that appears to trigger the sre recursion limit on Skip's platform (he
has very long single-line string literals). Replaced all of tokenize.py's
string regexps with the "unrolled" forms used in IDLE, where they're known to
handle even absurd (multi-megabyte!) string literals without trouble. See
Friedl's book for explanation (at heart, the naive regexps create a backtracking
choice point for each character in the literal, while the unrolled forms create
none).
|
| |
|
| |
|
|
|
|
| |
(a newline that the grammar ignores).
|
| |
|
|
|
|
| |
for r"..." raw strings. (And R"..." string support added by Guido.)
|
| |
|
|
|
|
| |
#backslashes, and other stuff I don't know.
|
|
|
|
|
|
| |
# Ignore now accepts \f as whitespace. Operator now includes '**'.
# Ignore and Special now accept \n or \r\n at the end of a line.
# Imagnumber is new. Expfloat is corrected to reject '0e4'.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* test_grammar.py, testall.out: added test for funny things in string literals
* token.py, symbol.py: definitions used with built-in parser module.
* tokenize.py: added double-quote recognition
|
|
|
|
|
| |
so it will correctly recognize floats.
Fix the test program so it works again.
|
|
|