summaryrefslogtreecommitdiffstats
path: root/Tools/idle/PyParse.py
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of old IDLE. Lib/idlelib rules!Guido van Rossum2003-06-141-584/+0
|
* Apply diff2.txt from SF patch http://www.python.org/sf/572113Walter Dörwald2002-09-111-27/+22
| | | | | | | | (with one small bugfix in bgen/bgen/scantools.py) This replaces string module functions with string methods for the stuff in the Tools directory. Several uses of string.letters etc. are still remaining.
* Taught IDLE's autoident parser that "yield" is a keyword that begins aTim Peters2001-06-191-0/+1
| | | | | stmt. Along w/ the preceding change to keyword.py, making all this work w/ a future-stmt just looks harder and harder.
* Hack to make this still work with Python 1.5.2. ;-(Fred Drake2001-02-161-1/+6
|
* Fix for next iteration of SF bug 115690 (Unicode headaches in IDLE). TheTim Peters2000-10-061-0/+13
| | | | | | parsing functions in support of auto-indent weren't expecting Unicode strings, but text.get() can now return them (although it remains muddy as to exactly when or why that can happen). Fixed that with a Big Hammer.
* Tim Peters writes:Guido van Rossum2000-03-131-4/+5
| | | | | | | | | | Fix bad auto-indent I recently introduced when replacing the regexp that could cause re to blow up: if or_any_other_block_opener: # one indenting comment line ^ cursor ended up at the caret (the bug) ^ but belongs here (the post-patch behavior)
* Patch by Tim Peters:Guido van Rossum2000-03-031-9/+11
| | | | | | | | | | | | | | | | Changes the one regexp in PyParse capable of making the re module blow the C stack when passed unreasonable <0.9 wink> program text. Jeremy Hylton provoked this with a program of the form: x = (1, 2, ... # 9997 lines deleted here 10000, ) Programs "like this" will no longer (no matter how many lines they contain) trigger re death. OTOH, you can now make another class of unreasonable program that will take much longer to parse.
* Tim Peters:Guido van Rossum1999-06-071-19/+75
| | | | | | | | | | | | | | Smarter logic for finding a parse synch point. Does a half to a fifth the work in normal cases; don't notice the speedup, but makes more breathing room for other extensions. Speeds terrible cases by at least a factor of 10. "Terrible" == e.g. you put """ at the start of Tkinter.py, undo it, zoom to the bottom, and start typing in code. Used to take about 8 seconds for ENTER to respond, now some large fraction of a second. The new code gets indented correctly, despite that it all remains "string colored" until the colorizer catches up (after which, ENTER appears instantaneous again).
* New offerings by Tim Peters; he writes:Guido van Rossum1999-06-031-17/+28
| | | | | | | | | | IDLE is now the first Python editor in the Universe not confused by my doctest.py <wink>. As threatened, this defines IDLE's is_char_in_string function as a method of EditorWindow. You just need to define one similarly in whatever it is you pass as editwin to AutoIndent; looking at the EditorWindow.py part of the patch should make this clear.
* Tim Peters again:Guido van Rossum1999-06-011-99/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new version (attached) is fast enough all the time in every real module I have <whew!>. You can make it slow by, e.g., creating an open list with 5,000 90-character identifiers (+ trailing comma) each on its own line, then adding an item to the end -- but that still consumes less than a second on my P5-166. Response time in real code appears instantaneous. Fixed some bugs. New feature: when hitting ENTER and the cursor is beyond the line's leading indentation, whitespace is removed on both sides of the cursor; before whitespace was removed only on the left; e.g., assuming the cursor is between the comma and the space: def something(arg1, arg2): ^ cursor to the left of here, and hit ENTER arg2): # new line used to end up here arg2): # but now lines up the way you expect New hack: AutoIndent has grown a context_use_ps1 Boolean config option, defaulting to 0 (false) and set to 1 (only) by PyShell. Reason: handling the fancy stuff requires looking backward for a parsing synch point; ps1 lines are the only sensible thing to look for in a shell window, but are a bad thing to look for in a file window (ps1 lines show up in my module docstrings often). PythonWin's shell should set this true too. Persistent problem: strings containing def/class can still screw things up completely. No improvement. Simplest workaround is on the user's head, and consists of inserting e.g. def _(): pass (or any other def/class) after the end of the multiline string that's screwing them up. This is especially irksome because IDLE's syntax coloring is *not* confused, so when this happens the colors don't match the indentation behavior they see.
* New file by Tim Peters:Guido van Rossum1999-06-011-0/+470
One new file in the attached, PyParse.py. The LineStudier (whatever it was called <wink>) class was removed from AutoIndent; PyParse subsumes its functionality.