mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-23 13:06:07 +00:00
Add symboltable scope for comprehensions. Add _ast module nodes for comprehensions.
This commit is contained in:
parent
efecef9d48
commit
024cf5db04
2 changed files with 34 additions and 1 deletions
|
@ -1782,6 +1782,7 @@ impl<O: OutputStream> Compiler<O> {
|
|||
line_number,
|
||||
name.clone(),
|
||||
));
|
||||
self.enter_scope();
|
||||
|
||||
// Create empty object of proper type:
|
||||
match kind {
|
||||
|
@ -1891,6 +1892,9 @@ impl<O: OutputStream> Compiler<O> {
|
|||
// Fetch code for listcomp function:
|
||||
let code = self.pop_code_object();
|
||||
|
||||
// Pop scope
|
||||
self.leave_scope();
|
||||
|
||||
// List comprehension code:
|
||||
self.emit(Instruction::LoadConst {
|
||||
value: bytecode::Constant::Code {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue