Commit Graph

454 Commits

Author SHA1 Message Date
Michael Hansen
0a54e40c8d Merge pull request #179 from dotjrich/debug-docs
Adds ability to control block and stack debug output via CMake
2020-10-19 22:02:20 -07:00
John Richards
0573318528 Renames options for BLOCK/STACK debugging and fixes indentation 2020-10-20 00:42:44 -04:00
John Richards
05c373b07a Adds ability to control block and stack debug output via CMake
Also updates README to detail how to enable various debug options.

A typo related to running tests has also been fixed.
2020-10-19 20:55:20 -04: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
Michael Hansen
9407b29451 Merge pull request #175 from dotjrich/issue-136
Handle NaN and infinity values
2020-10-15 19:19:55 -07:00
John Richards
ed11ba3fe4 Refactors how we handle NaN and infinity
The previous approach didn't work properly under MSVC. The wrong
output would be produced for NaN values.

This new approach will directly print out "nan" and "inf" with the
appropriate sign, rather than just wrapping the value in float('').
2020-10-15 21:35:19 -04:00
John Richards
870ecdc430 Handle NaN and infinity values
Right now, NaN/infinity values will produce "nan" and "inf", but
Python doesn't allow those in source code. This change will wrap
those values in float(''), which is allowed.

Tests for Python 2.7 and 3.8 have been added as well.

Fixes #136
2020-10-15 21:04:57 -04:00
Michael Hansen
36d93bd1a5 Add support for Python 3.9 in pymultic.
Also updates versions for several other Python releases.
2020-10-12 16:52:38 -07:00
Michael Hansen
8460d119fd Add bytecode support for Python 3.9 rc2 2020-09-29 09:28:15 -07:00
Michael Hansen
045b624f55 Merge pull request #171 from Almamu/fix-empty-stack-history
Fixed crash on stack_history being empty
2020-02-10 07:53:56 -08:00
Michael Hansen
e20e3b2f9f Merge pull request #170 from Almamu/fix-stringrefs-length0
Fixed a crash when a Stringref was an empty string (length 0)
2020-02-10 07:51:02 -08: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
Alexis Maiquez Murcia
5437c3294f Fixed a crash when a Stringref was an empty string (length 0)
Signed-off-by: Alexis Maiquez Murcia <almamu@almamu.com>
2020-02-10 10:40:17 +01:00
Michael Hansen
3d3719f844 GH Actions apparently use PowerShell by default now -- fix syntax error. 2020-01-03 14:38:36 -08:00
Michael Hansen
937520abcc Update pymultic python versions 2020-01-03 12:16:39 -08:00
Michael Hansen
428d11c4b5 Add bytecode and disassembly support for Python 3.8.
Also fixes running pymultic from outside of its source directory.
2019-10-14 14:48:26 -07:00
Michael Hansen
de78e1b882 Unmangle private names ('__' prefix) in class declarations.
Fixes #166.
2019-10-10 14:47:48 -07:00
Michael Hansen
375b8b0c68 Fix non-inplace matrix multiplication operator. 2019-10-10 11: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
c71d41efb6 Add MSVC-based CI build 2019-10-09 20:33:39 -07:00
Michael Hansen
96b5dd1d02 Modernize and simplify FastStack with a vector. 2019-10-09 15:39:37 -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
cbbffd28e6 Modernize ASTNode.h 2019-10-08 13:34:15 -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
66d6c190ac Make PycRef<T> movable 2019-10-08 08:42:33 -07:00
Michael Hansen
44af6a2c04 Finish removing old tests and old "test" framework. 2019-10-07 20:57:43 -07:00
Michael Hansen
391ba6502d Migrate additional tests which previously didn't have reference source to
the new test system, including new reference source.
2019-10-07 17:06:08 -07:00
Michael Hansen
9524099488 Migrate test_tuple_params to new test framework.
This test relies on some old syntax for tuples that may need to get
cleaned up before the test can pass on both old and new Pythons.
2019-10-07 13:54:46 -07:00
Michael Hansen
86b88091df Unify test_prettyprint variations and add to passing tests. 2019-10-07 13:42:39 -07:00
Michael Hansen
ab58fba23b Move more tests into the new framework, including current xfails. 2019-10-07 13:38:19 -07:00
Michael Hansen
0dc49b5872 Add support for expected test failures 2019-10-07 11:36:09 -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
892616b560 Add tests for unicode/bytes string literals 2019-10-06 13:50:53 -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
727da48ba5 Display the diff when a test doesn't match the expected output. 2019-10-04 14:57:59 -07:00
Michael Hansen
646213ef4f Add a test for unpack assignment 2019-10-04 14:33:38 -07:00
Michael Hansen
2e93d29233 Don't write parens around for loop value tuples 2019-10-04 14:08:47 -07:00
Michael Hansen
fc1cb06926 Add Github Actions CI build 2019-10-04 11:32:27 -07:00
Michael Hansen
154b80b2fe Migrate several more passing tests to new test framework 2019-10-04 11:05:52 -07:00
Michael Hansen
7cd576280e Move equivalent reference sources to the input directory 2019-10-03 22:08:44 -07:00
Michael Hansen
7a7b4623b6 Migrate a couple more passing tests, and handle end-of-line comments
in token_dump.
2019-10-03 20:56:52 -07:00