Commit graph

530 commits

Author SHA1 Message Date
HyeockJinKim
c852c5d272 nonlocal generate syntax error
If the scope depth is less than 2,
a syntax error occurs in nonlocal.

Fixes #1360
2019-09-12 01:13:47 +09:00
coolreader18
5919a1e1ba Don't clone SymbolTables when analyzing 2019-09-07 18:12:02 -05: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
f98d54f09f Merge pull request #1336 from RustPython/comprehension-scope
Add symboltable scope for comprehensions.
2019-09-04 15:45:55 +02:00
Adam
4ae902f788 Merge pull request #1332 from RustPython/load_global_loading_local
load_global shouldn't load outermost locals.
2019-09-02 10:13:19 +01:00
Adam Kelly
f3ecba02b1 Be somewhat less conservative about declaring things global. 2019-09-02 09:35:29 +01:00
Windel Bouwman
024cf5db04 Add symboltable scope for comprehensions. Add _ast module nodes for comprehensions. 2019-09-01 22:31:16 +02:00
Adam Kelly
9c17d982ff Be extremely conservative about guessing scopes when we don't know. 2019-08-31 16:39:27 +01:00
Jeong YunWon
efecef9d48 Remove duplicated contains_key test 2019-08-31 00:25:16 +09:00
Jeong YunWon
a02ba6104f Fix scan_expression not to mark sequence as Load 2019-08-31 00:25:16 +09:00
Windel Bouwman
ca09cc215d Merge pull request #1325 from RustPython/scoping
Add scope type and other symboltable properties.
2019-08-30 07:08:49 +02:00
Windel Bouwman
a0dcfdd57f Add scope type and other symboltable properties. 2019-08-29 19:16:45 +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
Windel Bouwman
9b1771b483 Fix clippy warnings. Add proper names to symboltables. 2019-08-18 10:03:00 +02:00
Windel Bouwman
99b3532cae Merge pull request #1251 from RustPython/scope-detection
Extend AST python module. Add idea for scope detection.
2019-08-18 09:14:20 +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
e0c3755777 Extend AST python module. Add idea for scope detection. 2019-08-14 20:43:23 +02: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
Windel Bouwman
da7a5437ba Merge pull request #1234 from RustPython/short-circuit-evaluation
Improve the situation regarding boolean operations.
2019-08-12 07:30:28 +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
4cb8cc34e4 Add tuple unpacking optimization 2019-08-04 01:22:51 -05:00
coolreader18
347d6c006a Fix label issue 2019-08-03 23:58:59 -05:00
coolreader18
a01853fad5 Add constant optimization test 2019-08-03 22:44:36 -05:00
coolreader18
e9ad1f64ee Make peephole optimizer a stream processor 2019-08-03 22:02:29 -05:00
coolreader18
8d1da0920d Add basic constant optimization to the compiler 2019-08-02 23:53:46 -05:00
Windel Bouwman
7e9b3ddc1f Implement review comments and improve parsing a bit. 2019-07-25 23:54:31 +02:00
Windel Bouwman
9f7ef2050e Add location to expressions. Change symboltable to use flags for symbols. 2019-07-20 20:44:38 +02:00
Windel Bouwman
9c9eadbd9e Merge pull request #1153 from RustPython/ast-module
Add initial draft of symtable module.
2019-07-20 09:07:05 +02:00
Windel Bouwman
eab3b357dd Extend symtable module. 2019-07-19 22:05:35 +02:00
Windel Bouwman
91b43d47fb Fix panic on import statement with levels but no module name. 2019-07-19 17:31:57 +02:00