[pypy-commit] pypy no-class-specialize: Don't use specialize:ctr_location in rpython.rlib.parsing
rlamy
noreply at buildbot.pypy.org
Tue Oct 13 16:53:04 CEST 2015
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: no-class-specialize
Changeset: r80160:8761f11122e3
Date: 2015-10-13 07:15 +0100
http://bitbucket.org/pypy/pypy/changeset/8761f11122e3/
Log: Don't use specialize:ctr_location in rpython.rlib.parsing
Surprisingly, all the tests still seem to pass.
diff --git a/rpython/rlib/parsing/makepackrat.py b/rpython/rlib/parsing/makepackrat.py
--- a/rpython/rlib/parsing/makepackrat.py
+++ b/rpython/rlib/parsing/makepackrat.py
@@ -54,7 +54,7 @@
newline:
COMMENT
| `( *\n *)*`;
-
+
REGEX:
r = `\`[^\\\`]*(\\.[^\\\`]*)*\``
@@ -109,8 +109,8 @@
IGNORE*
return {Nonterminal('productionargs', args + [arg])}
| return {Nonterminal('productionargs', [])};
-
-
+
+
or_:
l = (commands ['|' IGNORE*])+
last = commands
@@ -222,7 +222,7 @@
call | REGEX [IGNORE*] | QUOTE [IGNORE*];
call:
- x = NAME
+ x = NAME
args = arguments
IGNORE*
return {Nonterminal("call", [x, args])};
@@ -288,8 +288,7 @@
INPROGRESS = 2
LEFTRECURSION = 3
SOMESOLUTIONS = 4
-
- _annspecialcase_ = 'specialize:ctr_location' # polymorphic
+
def __repr__(self):
return "Status(%s, %s, %s, %s)" % (self.pos, self.result, self.error,
self.status)
@@ -300,6 +299,7 @@
self.status = self.INPROGRESS
self.result = None
+
class ParserBuilder(RPythonVisitor, Codebuilder):
def __init__(self):
Codebuilder.__init__(self)
@@ -594,7 +594,7 @@
r = t.additional_info[1:-1].replace('\\`', '`')
matcher = self.get_regex(r)
self.emit("_result = self._regex%s()" % (abs(hash(r)), ))
-
+
def visit_QUOTE(self, t):
self.emit("_result = self.__chars__(%r)" % (
str(t.additional_info[1:-1]), ))
More information about the pypy-commit
mailing list