[pypy-svn] r11467 - pypy/dist/pypy/module/recparser
ludal at codespeak.net
ludal at codespeak.net
Tue Apr 26 13:09:42 CEST 2005
Author: ludal
Date: Tue Apr 26 13:09:42 2005
New Revision: 11467
Removed:
pypy/dist/pypy/module/recparser/tokenize.py
Modified:
pypy/dist/pypy/module/recparser/pythonlexer.py
Log:
* move tokenize.py as pythonlexer.py::main
* more import fixes
Modified: pypy/dist/pypy/module/recparser/pythonlexer.py
==============================================================================
--- pypy/dist/pypy/module/recparser/pythonlexer.py (original)
+++ pypy/dist/pypy/module/recparser/pythonlexer.py Tue Apr 26 13:09:42 2005
@@ -392,3 +392,16 @@
## return punct, None
## raise SyntaxError("Unrecognized token '%s'" % inp[pos:pos+20] )
+
+
+def tokenize_file(filename):
+ f = file(filename).read()
+ src = PythonSource(f)
+ token = src.next()
+ while token!=("ENDMARKER",None) and token!=(None,None):
+ print token
+ token = src.next()
+
+if __name__ == '__main__':
+ import sys
+ tokenize_file(sys.argv[1])
Deleted: /pypy/dist/pypy/module/recparser/tokenize.py
==============================================================================
--- /pypy/dist/pypy/module/recparser/tokenize.py Tue Apr 26 13:09:42 2005
+++ (empty file)
@@ -1,15 +0,0 @@
-
-import sys
-from python.lexer import PythonSource
-
-
-def parse_file(filename):
- f = file(filename).read()
- src = PythonSource(f)
- token = src.next()
- while token!=("ENDMARKER",None) and token!=(None,None):
- print token
- token = src.next()
-
-if __name__ == '__main__':
- parse_file(sys.argv[1])
More information about the Pypy-commit
mailing list