Commit graph

169 commits

Author SHA1 Message Date
Jeong YunWon
04c29f384e &str::to_string -> &str::to_owned for variables 2020-02-05 22:55:34 +09:00
Jeong YunWon
7860fc877d &str::to_string -> &str::to_owned for literals 2020-02-05 22:55:33 +09:00
Aviv Palivoda
de7f9efd54 Support expression in f-strings spec 2019-12-27 10:19:07 +02:00
Jeong YunWon
8adb8b5105 Fix clippy warnings 2019-12-21 18:49:48 +09:00
Jeong YunWon
23993c2833 implement SyntaxError attributes 2019-12-16 00:08:16 +09:00
yanganto
28fbdffdc8 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
a51a3e0e4b Add a CompileContext 2019-11-07 00:04:51 -06:00
coolreader18
c39e0baab7 Add async for 2019-11-07 00:04:51 -06:00
Noah
19f62b97a3 Deduplicate async/normal with compilation code 2019-11-07 00:04:51 -06:00
coolreader18
ae825125a5 Add async with, reorganize how with blocks work 2019-11-07 00:04:51 -06:00
coolreader18
3638591cde Add coroutines, async/await functionality, and gen.close() 2019-11-07 00:04:50 -06:00
joshua1b
30ab196fdc 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
coolreader18
0fd098569e Change FunctionOpArg to CodeFlags, stored in CodeObject 2019-10-14 20:20:52 +00:00
Jeong YunWon
f2b696a75b Add mode to ast::parse 2019-10-12 18:12:36 +09:00
Seo Sanghyeon
fe4f8237ad Raise TypeError for duplicate keyword arguments 2019-10-04 19:29:57 +09:00
Seo Sanghyeon
6c88f6af3d Optimize BuildMap bytecode emission 2019-10-03 00:03:08 +09:00
coolreader18
0c3482e03a Invert the inverted boolean 2019-09-28 00:41:41 -05:00
Noah
fee1b6f2c7 Only overwrite the locals in __build_class__ if it's a class 2019-09-28 00:41:41 -05:00
coolreader18
bff58fd626 Remove useless_const optimization
There could be jump depending on the Pop being there, and then it
breaks.
2019-09-17 08:04:11 +02:00
coolreader18
b8726f03df Don't emit None, ReturnValue if the last statement in a function is a return 2019-09-17 08:04:11 +02:00
j30ng
df4be1f9ce Remove Enum Instruction::Unpack 2019-09-12 16:30:03 +09:00
j30ng
3b99c07a1e Format Code with rustfmt 2019-09-12 04:36:31 +09:00
j30ng
5ce3f2c056 Return SyntaxError on Invalid Star Expression 2019-09-12 04:04:27 +09:00
coolreader18
d7f99dc7b1 Fix class scopes by modifying symboltable 2019-09-07 01:29:11 -05:00
coolreader18
acce23b79b Fix class vs method scopes 2019-09-05 00:27:16 -05:00
Windel Bouwman
024cf5db04 Add symboltable scope for comprehensions. Add _ast module nodes for comprehensions. 2019-09-01 22:31:16 +02:00
Windel Bouwman
dac20eeb59 Make subscript its own bytecode. Remove pass bytecode. Move complex bytecodes into seperate functions to reduce complexity of dispatch function. 2019-08-28 12:06:46 +02:00
Noah
e0a52c15f6 Make bytecode::Label its own struct 2019-08-27 21:19:18 +00:00
Windel Bouwman
e37f117035 Implement execution of finally block. Fixes #1306. 2019-08-27 21:16:59 +02:00
Windel Bouwman
e8db01a09a Refactor block stack unwinding to enable finally execution. 2019-08-27 19:40:00 +02:00
Windel Bouwman
39c095d12c Add Free enum variant to the symbol scope to be able to distuingish between true local and free variables. 2019-08-18 12:12:27 +02:00
coolreader18
866defbcf3 Compile docstrings for modules 2019-08-15 22:25:30 -05:00
coolreader18
623472c366 Address feedback, simplify compilation code 2019-08-15 15:52:30 -05:00
coolreader18
7aac5b634f Fix weirdness with import submodules 2019-08-15 15:30:14 -05:00
Windel Bouwman
48005efef3 Merge pull request #1245 from RustPython/symbol-context
Improve symbol table processing.
2019-08-14 17:47:40 +02:00
coolreader18
f4ee74dbd4 Fix errors 2019-08-13 23:04:32 -05:00
Windel Bouwman
3b876205e5 Improve symbol table processing. 2019-08-13 21:13:16 +02:00
coolreader18
240c3c417c impl std::str::FromStr for compile::Mode 2019-08-13 12:35:07 -05:00
coolreader18
11f4dc24dc Change compile::compile() to take a Mode instead of an &Mode 2019-08-13 12:34:39 -05:00
Windel Bouwman
6128b2b46e Merge pull request #1232 from corona10/gh-1212
gh-1212: Fix scope_for_name to catch NameError properly
2019-08-12 07:32:02 +02:00
Dong-hee Na
5135c696e7 Fix scope_for_name to catch NameError properly 2019-08-12 10:19:31 +09:00
Windel Bouwman
4f9f9252e4 Improve the situation regarding boolean operations. 2019-08-11 20:20:15 +02:00
Noah
fde382409c Revert "Fix compilation of nested boolean operations" 2019-08-11 12:29:10 -05:00
coolreader18
5c1bc6756c Fix compilation of nested boolean operations 2019-08-09 21:36:42 -05:00
Windel Bouwman
dd53fe8f89 Merge pull request #1215 from RustPython/syntax-fixes
Add variable annotation syntax.
2019-08-09 11:22:55 +02:00
coolreader18
70c5c240e7 Address comments 2019-08-07 14:40:16 -05:00
Windel Bouwman
69b709e2b1 Add parser support for async for loop. Add yield expression inside parentheses. 2019-08-07 20:11:27 +02:00
Windel Bouwman
b6dd92daf6 Properly fill the __annotations__ dictionary. 2019-08-07 16:13:12 +02:00
Windel Bouwman
b22698a6f1 Add variable annotation syntax. Simplify grammar for comprehensions. Add capital J suffix for complex numbers. 2019-08-07 15:31:24 +02:00
coolreader18
a01853fad5 Add constant optimization test 2019-08-03 22:44:36 -05:00