Author: Richard Plangger <[email protected]>
Branch: py3.5-async
Changeset: r86018:d108f2d1bd0d
Date: 2016-08-04 18:07 +0200
http://bitbucket.org/pypy/pypy/changeset/d108f2d1bd0d/
Log: translation fixes batch 1
diff --git a/pypy/interpreter/astcompiler/assemble.py
b/pypy/interpreter/astcompiler/assemble.py
--- a/pypy/interpreter/astcompiler/assemble.py
+++ b/pypy/interpreter/astcompiler/assemble.py
@@ -668,6 +668,8 @@
# TODO
ops.BUILD_LIST_FROM_ARG: 1,
+ # TODO
+ ops.LOAD_CLASSDEREF: 1,
}
diff --git a/pypy/interpreter/pyparser/pytokenizer.py
b/pypy/interpreter/pyparser/pytokenizer.py
--- a/pypy/interpreter/pyparser/pytokenizer.py
+++ b/pypy/interpreter/pyparser/pytokenizer.py
@@ -273,17 +273,11 @@
elif token == 'async': # async token, look
ahead
#ahead token
if pos < max:
- as_pseudomatch = pseudoDFA.recognize(line, pos)
- as_start = whiteSpaceDFA.recognize(line, pos)
- if as_start < 0:
- as_start = pos
- as_end = as_pseudomatch
-
- if as_start == as_end:
- raise TokenError("Unknown character", line,
- lnum, as_start + 1,
token_list)
-
- ahead_token = line[as_start:as_end]
+ async_end = pseudoDFA.recognize(line, pos)
+ assert async_end >= 3
+ async_start = async_end - 3
+ assert async_start >= 0
+ ahead_token = line[async_start:async_end]
if ahead_token == 'def':
async_def = True
async_def_indent = indents[-1]
diff --git a/pypy/objspace/std/memoryobject.py
b/pypy/objspace/std/memoryobject.py
--- a/pypy/objspace/std/memoryobject.py
+++ b/pypy/objspace/std/memoryobject.py
@@ -226,10 +226,11 @@
size = rffi.sizeof(rffi.VOIDP)
return size
- def descr_cast(self, space, w_args, **w_kwds):
- self._check_released(space)
- newitemsize = self.get_native_fmtchar(w_args._val(w_args))
- mv = W_MemoryView(self.buf, w_args._val(w_args), newitemsize)
+ def descr_cast(self, space, w_args, w_kwds):
+ # XXX fixme. does not do anything near cpython (see memoryobjet.c
memory_cast)
+ #self._check_released(space)
+ #newitemsize = self.get_native_fmtchar(w_args._val(w_args))
+ return W_MemoryView(self.buf, self.format, self.itemsize)
return mv
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit