Commit graph

154 commits

Author SHA1 Message Date
Jeong Yunwon
5e94f56ae4 compile_impl! => compile_impl 2022-05-02 10:37:47 +09:00
Jeong Yunwon
753c0337bc compile_single checks last expr out of loop 2022-05-02 10:37:45 +09:00
Jeong Yunwon
bedb508667 clean up imports and useless allow attributes 2022-04-15 23:58:20 +09:00
Noa
a4f34f64e9 Split Rotate into Rotate2 & Rotate3 2022-03-11 22:01:05 -06:00
Noa
e5eb2739b7 Fix augassign double-loading the container of the target 2022-03-10 13:27:38 -06:00
Noa
d9653b4895 Fix clippy warnings with 1.58 & convert some format strings to capture-args 2022-01-13 23:53:25 -06:00
Noa
4c3c5c5ed1 Add the __future__.annotations feature 2021-10-17 21:55:28 -05:00
jfh
6a19201eb4 Fix warnings for doc build. 2021-10-07 17:37:24 +03:00
Alex Muscar
e038799297 Consolidate error handling for builtin "constants" mutations
Co-authored-by: Jeong YunWon <youknowone@users.noreply.github.com>
2021-10-05 09:11:42 +01:00
Alex Muscar
be92bc5243 fix: forbid stores to the __debug__ builtin #3203
According to [the docs][1], `__debug__` is treated as a constant by the
interpreter.

This patch adds some checks to bring RustPython's behaviour in line with
cpython's.

[1]: https://docs.python.org/3/library/constants.html#built-in-constants
2021-10-05 09:11:42 +01:00
Jeong YunWon
d0c436949e Derive Default for CompileOpts 2021-09-30 03:59:18 +09:00
Padraic Fanning
ae122c6478 Replace master with main
Fixes #3067
2021-09-15 17:54:54 -04:00
Jeong YunWon
05fcfa8aa1 Merge pull request #2980 from HyeockJinKim/debug_value
Raise syntax error when saving a value to __debug__.
2021-09-06 01:58:36 +09:00
HyeockJinKim
91ecc3df9a remove unnecessary mut in compiler.rs 2021-09-05 17:50:08 +09:00
HyeockJinKim
94e77ef8a6 Raise syntax error when saving a value to __debug__. 2021-08-27 23:48:14 +09:00
Jeong YunWon
acd73d21fe Compiler::qualified_name as vec 2021-08-27 23:45:47 +09:00
Jeong YunWon
88321d9319 clean up Compiler::create_qualified_name 2021-08-27 23:29:34 +09:00
Lee Dogeon
ca37219aff Fix __repr__, __qualname__ (#2977) 2021-08-27 17:07:10 +03:00
Jeong YunWon
9b0a82aed3 Fix unnessessary borrow 2021-07-30 02:32:16 +09:00
Noah
ab1dd4e2a4 Fix async for compilation 2021-04-11 17:38:44 -05:00
Noah
ee0af406e2 Add LoadMethod and CallMethod* opcodes 2021-03-15 09:45:07 -05:00
Noah
da0c85d2ac Impl Eq+Hash for ConstantData, make CodeInfo.constants an IndexSet 2021-03-11 09:58:25 -06:00
Noah
89c08246ba Fix SetupAsyncWith stack level handling 2021-02-20 21:04:30 -06:00
Noah
5d1beacefa Handle splat args in bases/kwargs for __build_class__ 2021-02-15 21:39:43 -06:00
Noah
8348417274 Implement name mangling 2021-01-26 09:59:16 -06:00
Noah
f1970bfbf9 Misc fixes 2021-01-14 12:37:37 -06:00
Noah
dc8b93a417 Update the compiler to use the new asdl ast types 2021-01-14 12:37:37 -06:00
Noah
a0790d4906 Use ahash in the compiler 2021-01-08 17:00:23 -06:00
Noah
64fa9ccba9 Don't push something on the stack when starting a generator 2020-12-23 17:40:33 -06:00
Noah
a2c0db23f6 Don't keep a separate blockorder vec 2020-12-21 18:49:00 -06:00
Noah
d567f967e8 Use boxvec for frame.stack 2020-12-21 18:48:56 -06:00
Noah
596e338c51 Have a block-based IR for compiling, calculate max stack size 2020-12-21 18:47:58 -06:00
Noah
db041c0f6c Update other stuff to use the root of rustpython_bytecode 2020-12-19 14:59:07 -06:00
Noah
b9875ff9bf Make Instruction only 8 bytes 2020-12-14 15:55:47 -06:00
Noah
1575382577 Add flags to the MakeFunction instruction 2020-12-14 14:35:17 -06:00
Noah
86aa00c473 Add label_arg{,_mut} methods 2020-12-14 14:25:20 -06:00
Noah
74a917a72e Make Continue have the target it's continuing to 2020-12-14 14:25:19 -06:00
Noah
48ca658ba0 Optimize the size of Instruction 2020-12-14 14:25:19 -06:00
Noah
281e955663 Import ConstantData in compile.rs 2020-12-14 14:25:19 -06:00
Noah
ff8512cd54 Apply review suggestions 2020-12-05 16:36:38 -06:00
Noah
9305316f69 Use a boxed slice for codeobject fields 2020-12-05 16:36:37 -06:00
Noah
8458e13e35 Fast locals part 3 2020-12-05 16:36:35 -06:00
Noah
e18275566a Fast locals part 2 2020-12-05 16:36:00 -06:00
Noah
410bd76f38 Fast locals part 1 2020-12-05 16:36:00 -06:00
Noah
df41efed8a Don't use a wildcard to prevent future mistakes 2020-11-24 11:57:14 -06:00
Noah
38c4c14ee3 Remove the need for a label_map in CodeObject 2020-11-23 14:41:56 -06:00
Noah
e37a55e74c Implement string interning for variable names 2020-11-09 15:51:57 -06:00
Noah
e9095a741d Split the ast from the parser, remove compiler dep on parser 2020-11-07 15:43:23 -06:00
Noah
4afbc082ed Use disassembly for snapshot testing 2020-10-19 23:55:56 -05:00
Noah
3f9dd3dd4c Remove optimization unit test 2020-10-19 23:55:56 -05:00