Source

pypy / pypy / interpreter / pyparser / parsestring.py

Author Commit Message Labels Comments Date
wlav
merge default into branch
Branches
reflex-support
Armin Rigo
Also accept the encoding "utf8" in addition to "utf-8" to trigger the fast path.
Armin Rigo
Test and fix for issue1159: the logic in parsestring.py was subtly broken by 6f5ea64c8b8d. Fix it by reverting the use of append_slice().
wlav
o) merge default into branch o) fix on my side the problems due to changes in array
Branches
reflex-support
wlav
rollback (translation fails in array)
Branches
reflex-support
Amaury Forgeot d'Arc
Remove dead code. Q: Where does it come from? A: from CPython: Python/ast.c Q: Why this code in CPython? A: In file Grammar/Grammar, keywords and operators are enclosed in quotes ('def', '+='); grammar.c contains logic to create the various tokens, and separate keywords from operators; probably in old ages the same code was used to parse the Python language as well.
Amaury Forgeot d'Arc
Improve documentation of parsestr()
Justin Peel
move import to top...
Justin Peel
move import outside of function
Justin Peel
Try to speed up string's decode escape by using a string builder and appending unescaped text in slices
Branches
faster-str-decode-escape
Dan Villiom Podlaski Christiansen
No-op merge to register the merge done in 0e3099e3cc33 with Mercurial.
Branches
fast-forward
Amaury Forgeot d'Arc
Fixed issue531: CPython oddities when parsing octal escapes in string literals '\9' == ('\\' + '9'), '\400' == chr(0) Noticed by santagada.
Amaury Forgeot d'Arc
Merge branch/interplevel-codecs: Rewrite all encodings implemented at applevel, move most of them to rlib.runicode where they may be useful for RPython programs. - This fixes translation with -O0: this option disables geninterp, and uses the pypy compiler instead to compile applevel code. But unicode literals need to be decoded with the codec module... - This also removes some huge geninterp'd code: app_codecs.py used to contain 3 or 4 functions each rendered with 20000 lines of C code! + use StringBuilder everywhere
Benjamin Peterson
merge from trunk
Branches
fast-forward
Benjamin Peterson
add from __future__ import unicode_literals support
Branches
fast-forward
Benjamin Peterson
alias bytes to str and implement b<str> syntax
Branches
fast-forward
Armin Rigo
Translation fix.
Jared Grubb
parsestring: simplify the octal parsing a bit regexparse: simplify the unescape() function test_pcre_regtest: preprocesses the testoutput1 file and runs most of the tests
Anders Chrigström
Fix bad quote quoting.
Armin Rigo
Oups! Not only bugs related to invalid escape sequences crashing parsestring(), but also a genuine problem discovered by the test: in the escape sequence '\123', the last 3 was incorrectly re-inserted into the resulting string.
Niklaus Haldimann
fixed typo (?) that caused _stablecompiler (and thus translated pypy) to interpret the string "\b" as "'".
Samuele Pedroni
new test, doesn't work right now failing somewhere from app_codecs. parsestr itself is correct because encoding through cheating passes the test the problem need to be tracked and fixed
Armin Rigo
Some asserts to help convince the annotator that the slice indices are not negative.
Samuele Pedroni
- fix in decode_utf8 - involved test to exercise it - _codecs should export 'encode' and 'decode'
Armin Rigo
! (arigo, pedronis)
Armin Rigo
str.isalpha() is not RPython.
Armin Rigo
Typo.
Carl Friedrich Bolz
(samuele, cfbolz): added missing hexbyte
Carl Friedrich Bolz
(arigo) * Intergrated parsestr() with the app-level _stablecompiler. * Fix in parsestr().
Christian Tismer
Samuele & Chris: added parsestring.py, which parses a Python string literal. Seems to work basically. No intense testing of unicode cases, yet. please review the interface. Right now we accept native argument, but return and raise wrapped results.