Aralox
abf8501ccf
CRAs
2020-10-22 10:57:49 +11:00
Aralox
e80aa996fa
Only initialize the async for once.
2020-10-22 09:11:51 +11:00
Aralox
5bdc0b5baf
Merge remote-tracking branch 'upstream/master' into Issue-124-handle-async-for-GET_AITER_GET_ANEXT
...
Conflicts:
ASTree.cpp
2020-10-21 19:34:37 +11:00
Aralox
91a23f914d
Implement better handling for async for.
...
Instead of ignoring boilerplate when decompiling `async for`, build the loop semantically by deconstructing the BLK_WHILE -> BLK_CONTAINER -> BLK_TRY that python generates when compiling an `async for` (see https://www.python.org/dev/peps/pep-0492/#asynchronous-iterators-and-async-for ).
When reading GET_AITER, convert the BLK_WHILE into a BLK_ASYNCFOR in the same way as a `for` loop.
Ignore GET_ANEXT.
Use END_FINALLY as the trigger to finish building the BLK_ASYNCFOR:
-> Extract the loop variable from the contents of the BLK_TRY.
-> Throw away the BLK_TRY and BLK_CONTAINER, leave the BLK_ASYNCFOR on top of the stack.
2020-10-21 19:32:20 +11:00
Michael Hansen
d3a46f711f
Merge remote-tracking branch 'dotjrich/issue-172' into master
2020-10-20 21:10:55 -07:00
Michael Hansen
568867c80a
Minor style adjustments
2020-10-20 21:08:02 -07:00
John Richards
50dea39975
Addresses a couple performance related comments
2020-10-20 18:07:39 -04:00
Aralox
8933c9a4a9
Add support for async for. Issue #124
...
Ignore 'boilerplate' opcodes that set up the async iteration logic internally (https://www.python.org/dev/peps/pep-0492/#asynchronous-iterators-and-async-for ) - We don’t need any of this as GET_AITER is enough to tell us that we are in an `async for`.
2020-10-20 20:39:23 +11:00
John Richards
5b819fa23e
Adds support for BUILD_CONST_KEY_MAP opcode
...
Tests have also been added.
Fixes #172
2020-10-20 01:46:38 -04:00
Aralox
7af40a779f
CRAs
2020-10-20 16:42:19 +11:00
Aralox
1f07a24451
Fix up some dodgy spacing
2020-10-17 21:04:39 +11:00
Aralox
0c9fbd9caf
Issue-165 Added support for f-strings (literal string interpolation https://www.python.org/dev/peps/pep-0498/ )
...
Opcodes handled: FORMAT_VALUE, BUILD_STRING.
Added AST node classes for FormattedValue and JoinedStr.
2020-10-17 20:52:57 +11:00
Alexis Maiquez Murcia
eae19d7a81
Fixed crash on stack_history being empty
...
Signed-off-by: Alexis Maiquez Murcia <almamu@almamu.com>
2020-02-10 11:02:26 +01:00
Michael Hansen
de78e1b882
Unmangle private names ('__' prefix) in class declarations.
...
Fixes #166 .
2019-10-10 14:47:48 -07:00
Michael Hansen
de3f7982c3
Support 'yield from' (Python 3.3) and await (Python 3.5) expressions.
...
Currently unsupported are yield from in newer Python versions, and
yield/yield from into an assignment expression.
2019-10-10 10:59:10 -07:00
Michael Hansen
881a200ab0
Change handling of POP_TOP to explicitly mark already-processed nodes.
2019-10-10 10:55:28 -07:00
Michael Hansen
13397c940e
Don't emit statements for null values on the stack.
...
Fixes several test cases with extraneous None lines.
2019-10-10 10:26:19 -07:00
Michael Hansen
15da179173
Merge print nodes in the AST rather than attempting to manage it during
...
print statement output. Fixes numerous bugs with mangled print statements.
2019-10-09 14:20:46 -07:00
Michael Hansen
8713b3b05f
Merge 'pass' node into existing ASTKeyword node type
2019-10-08 13:12:31 -07:00
Michael Hansen
c928df906b
Fix applyEquiv test by writing the correct name from the call object.
2019-10-08 11:44:52 -07:00
Michael Hansen
9309effba9
Support Python 3.x kw-only arguments.
2019-10-08 11:36:12 -07:00
Michael Hansen
3e379c114e
Don't emit a 'pass' statement on an empty top-level module code object
...
Fixes test_empty test case.
2019-10-08 09:04:41 -07:00
Michael Hansen
3009ea38d2
Handle Python 3.3's automatic __qualname__ assignment.
...
Fixes loadbuild_class.py test.
2019-10-08 08:53:53 -07:00
Michael Hansen
8014ac2b14
Print unicode as default in Python 2.x when CO_FUTURE_UNICODE_LITERALS
...
is set.
Fixes #141 .
2019-10-06 14:34:24 -07:00
Michael Hansen
b5696c8398
Port Python 2.7 list comprehension fixes by @ReDucTor from #78
2019-10-04 16:35:58 -07:00
Michael Hansen
314f4a1a0d
Fix several cases of name shadowing, and greatly simplify some
...
unnecessary stack operations with tuple appending.
2019-10-04 16:16:10 -07:00
Michael Hansen
5c896fa743
Clean up some loops with range-based for.
2019-10-04 15:56:24 -07:00
Michael Hansen
2e93d29233
Don't write parens around for loop value tuples
2019-10-04 14:08:47 -07:00
Michael Hansen
0c0a0231a9
Fix dict literals in Python 3.5+ to make the new test case pass.
2019-10-03 15:48:44 -07:00
Michael Hansen
bf60a5831b
Fix several undefined behavior issues identified by @nrathaus.
...
Fixes #147 .
2018-01-28 15:37:44 -08:00
Michael Hansen
a9a362254e
Use fputs instead of fprintf when no formatting is required
2018-01-28 15:37:44 -08:00
Michael Hansen
b9dd99d518
Don't create special objects for NULL, just use NULL directly.
...
Also move null check into PycRef for nullable references.
2017-07-05 16:36:04 -07:00
Michael Hansen
1329626215
Add missing break
2017-07-05 16:10:59 -07:00
Michael Hansen
ed2c21cd66
Handle NOP instruction in decompyle ( fixes #96 )
2016-10-24 09:44:06 -07:00
Michael Hansen
05a32e7bf5
Add more reference source for Python 2.2 tests, and fix some inconsistent names
2016-09-07 18:21:51 -07:00
Michael Hansen
cffb4c5f5f
squish tab
2016-07-10 09:46:39 -07:00
Fabien Siron
f378a777a2
Fix lambda call
2016-07-09 15:20:39 +00:00
Michael Hansen
9f2930ccaa
Add async keyword to native coroutines (Python 3.5)
2015-11-13 15:22:47 -08:00
Michael Hansen
badd17bd21
Support @ operator
2015-10-01 17:03:41 -07:00
Eximius
c1a120ac6e
Fix SEGFAULT due to defblock being changed.
2015-08-16 14:34:54 +03:00
mancoast
58edafd872
Add support for LOAD_BUILD_CLASS op-code
...
Issue #39
2015-04-20 17:38:36 -04:00
Michael Hansen
69a757210a
Fix compile error on ARM
2015-04-17 19:52:35 -07:00
Michael Hansen
bbed2dc0fd
Merge remote-tracking branch 'gurnec/docstrings'
2015-04-17 18:39:34 -07:00
Michael Hansen
486629dda0
Tabs -> spaces
2015-04-17 18:37:37 -07:00
mancoast
eb04199d98
Test for qualified name of function
2015-04-17 09:51:00 -04:00
Christopher Gurnee
b2e5e77c48
Support function docstrings
2015-01-28 14:35:18 -05:00
Christopher Gurnee
7e03be30a4
Fixes for module and class docstrings
2015-01-28 13:35:17 -05:00
Michael Hansen
820397f9bf
Interned strings and ASCII literals are always in the native format
2014-01-21 00:47:11 -08:00
Michael Hansen
176a049a68
Support new marshal types from Python 3.4
2014-01-21 00:42:37 -08:00
charlietang98
7d8fad3cc7
Update ASTree.cpp
...
trim whitespace from blank line
2013-07-23 13:16:49 -04:00