Commit Graph
133 Commits
Author SHA1 Message Date
Jeong YunWon 9b3fa53f88 Merge pull request #1843 from RustPython/coolreader18/clippy-fixes
Fix some clippy lints that were previously 'allow'ed
2020-04-27 00:10:01 +09:00
Jeong YunWon 522034c84e Merge pull request #1880 from HyeockJinKim/issue1879
Remove unused variable
2020-04-26 00:12:26 +09:00
HyeockJinKim 2462e41703 Remove unused variable
Removed unused `is_param` variable for symbol.

Closes RustPython#1879
2020-04-25 13:59:54 +09:00
Noah d7842c79e3 Disable the unpack optimization 2020-04-24 15:14:58 -05:00
Noah d4bda6c02e Fix some clippy lints that were 'allow'ed 2020-04-05 14:55:51 -05:00
Noah f5de59a4bd Merge pull request #1834 from RustPython/coolreader18/jsontests
Add json output for CPython tests
2020-04-04 11:52:04 -05:00
Noah a8027ab48a Fix clippy lints 2020-04-03 12:34:01 -05:00
Noah f33e2d3b39 Remove incognito from vm 2020-04-03 12:34:00 -05:00
Noah be565d30ae Make incognito a CodeFlag bit 2020-04-03 12:34:00 -05:00
Noah 5b2cfb442d Make from __future__ imports a syntactic construct in the compiler 2020-04-03 12:34:00 -05:00
Noah 80f11466b3 Add "incognito" compilation 2020-04-03 12:34:00 -05:00
Noah 6553bf72d4 Move varargs information into CodeFlags 2020-04-02 09:02:18 -05:00
Noah 78f8f14003 Apply review comments 2020-03-21 00:37:13 -05:00
Noah af25fbed39 Fix syntax error tests 2020-03-21 00:35:36 -05:00
coolreader18 b83443cea9 Partially implement async generators 2020-03-21 00:33:46 -05:00
Noah 7031558065 Improve compiler error creation 2020-03-13 23:26:07 -05:00
Noah eecb097ae6 Make bytecode::Location Copy 2020-03-13 21:49:10 -05:00
Noah b6d155df8b Make Location Copy and remove all location.clone()s 2020-03-13 21:49:10 -05:00
Jeong YunWon aa1d20c388 positional only parameter support 2020-03-08 00:13:13 +09:00
Jeong YunWon 7d0d313aa5 &str::to_string -> &str::to_owned for variables 2020-02-05 22:55:34 +09:00
Jeong YunWon 1bac582921 &str::to_string -> &str::to_owned for literals 2020-02-05 22:55:33 +09:00
Aviv Palivoda 6a4c3da822 Fix clippy warning 2019-12-27 10:27:51 +02:00
Aviv Palivoda b394ad4e05 Parse FormattedValue spec in symboltable 2019-12-27 10:19:07 +02:00
Aviv Palivoda c3703f08d7 Support expression in f-strings spec 2019-12-27 10:19:07 +02:00
Jeong YunWon c1306726c4 Fix clippy warnings 2019-12-21 18:49:48 +09:00
Jeong YunWon 2e54f9a807 implement SyntaxError attributes 2019-12-16 00:08:16 +09:00
Aviv Palivoda 1279079e5f Fix caret diagnostics for mutiple lines 2019-11-29 11:32:45 +02:00
yanganto 7f45ed3cca Provide caret diagnostics for SyntaxError
visualize syntax error with caret diagnostics in shell, eval, exec,
when the error statement and error location are provided.
2019-11-22 09:17:50 +08:00
Noah 6ed5045809 Add a CompileContext 2019-11-07 00:04:51 -06:00
coolreader18 6bc33fbca2 Add async for 2019-11-07 00:04:51 -06:00
Noah 960e8def4a Deduplicate async/normal with compilation code 2019-11-07 00:04:51 -06:00
coolreader18 5c26a25522 Add async with, reorganize how with blocks work 2019-11-07 00:04:51 -06:00
coolreader18 577cea92fe Add coroutines, async/await functionality, and gen.close() 2019-11-07 00:04:50 -06:00
Aviv Palivoda 72989cdfd1 Merge pull request #1580 from seeeturtle/doc-f
Set docstring of function as None if not declared
2019-11-02 19:18:11 +02:00
joshua1b 538181791b Set docstring of function as None if not declared
In cpython, if there is no docstring declared in function definition,
the `__doc__` attribute of the function is None.
So this implements the behavior.

Fix #1523
2019-11-02 23:47:44 +09:00
ichyo 74c02d416e Fix wrong const optimization for "1.0 / 0.0" case
In cpython, "1.0 / 0.0" raises ZeroDivisionError
```
>>> 1.0 / 0.0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ZeroDivisionError: float division by zer
```

but RustPython doesn't
```
>>>>> 1.0 / 0.0
inf
```

This is because they emits different byte codes.

```
$ echo "1.0 / 0.0" > zero-div.py

$ python -m dis zero-div.py
  1           0 LOAD_CONST               0 (1.0)
              2 LOAD_CONST               1 (0.0)
              4 BINARY_TRUE_DIVIDE
              6 POP_TOP
              8 LOAD_CONST               2 (None)
             10 RETURN_VALUE

$ cargo run --example dis zero-div.py
zero-div.py:
                 0 LoadConst            (inf)
                 1 Pop
                 2 LoadConst            (None)
                 3 ReturnValue
```

This commit stops optimization for zero division case
to generate same byte codes.
2019-10-24 00:26:02 +09:00
coolreader18 c08f11ad1b Change FunctionOpArg to CodeFlags, stored in CodeObject 2019-10-14 20:20:52 +00:00
ChJR ad18dfdfe1 Add build compatibility with rustc 1.36.0 since #1318 merged 2019-10-13 15:53:49 +09:00
Windel Bouwman 336364c80d Merge pull request #1318 from youknowone/ast-module
ast module
2019-10-12 12:51:26 +02:00
Seo Sanghyeon 7caeee7810 Shut up Clippy 2019-10-12 18:18:45 +09:00
Jeong YunWon 2f1fb16da1 Add mode to ast::parse 2019-10-12 18:12:36 +09:00
Seo Sanghyeon e76edde38e Implement IndentationError 2019-10-12 02:24:12 +09:00
Chris West (Faux) 60bb597dc0 upgrade low-risk deps 2019-10-10 21:07:26 +01:00
Seo Sanghyeon f2e04c0e2f Implement TabError 2019-10-05 10:12:02 +09:00
Seo Sanghyeon a17456dba5 Raise TypeError for duplicate keyword arguments 2019-10-04 19:29:57 +09:00
Seo Sanghyeon e4ec430896 Optimize BuildMap bytecode emission 2019-10-03 00:03:08 +09:00
coolreader18 d0f7b5f347 Invert the inverted boolean 2019-09-28 00:41:41 -05:00
Noah 499bf146bd Only overwrite the locals in __build_class__ if it's a class 2019-09-28 00:41:41 -05:00
Noah d88167bb73 Bump crate versions 2019-09-25 11:57:38 -05:00
HyeockJinKim 1b141f3022 Fix global declaration error in the function
Fix Global symbol to prevent syntax error
when global declaration for same variable in function.

Fixes #1353
2019-09-18 01:57:06 +09:00