Skip to content

Commit bdb0c8f

Browse files
authored
Add parser support for PEP 695 (RustPython#5026)
* Add generated content for PEP 695 ASDL * Bump RustPython/Parser to RustPython/Parser@704eb40 * Add stubs for type aliases and parameters
1 parent c28cb39 commit bdb0c8f

File tree

5 files changed

+294
-12
lines changed

5 files changed

+294
-12
lines changed

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ rustpython-pylib = { path = "pylib" }
2929
rustpython-stdlib = { path = "stdlib" }
3030
rustpython-doc = { git = "https://github.com/RustPython/__doc__", branch = "main" }
3131

32-
rustpython-literal = { git = "https://github.com/RustPython/Parser.git", rev = "69d27d924c877b6f2fa5dc75c9589ab505d5b3f1" }
33-
rustpython-parser-core = { git = "https://github.com/RustPython/Parser.git", rev = "69d27d924c877b6f2fa5dc75c9589ab505d5b3f1" }
34-
rustpython-parser = { git = "https://github.com/RustPython/Parser.git", rev = "69d27d924c877b6f2fa5dc75c9589ab505d5b3f1" }
35-
rustpython-ast = { git = "https://github.com/RustPython/Parser.git", rev = "69d27d924c877b6f2fa5dc75c9589ab505d5b3f1" }
36-
rustpython-format = { git = "https://github.com/RustPython/Parser.git", rev = "69d27d924c877b6f2fa5dc75c9589ab505d5b3f1" }
32+
rustpython-literal = { git = "https://github.com/RustPython/Parser.git", rev = "704eb40108239a8faf9bd1d4217e8dad0ac7edb3" }
33+
rustpython-parser-core = { git = "https://github.com/RustPython/Parser.git", rev = "704eb40108239a8faf9bd1d4217e8dad0ac7edb3" }
34+
rustpython-parser = { git = "https://github.com/RustPython/Parser.git", rev = "704eb40108239a8faf9bd1d4217e8dad0ac7edb3" }
35+
rustpython-ast = { git = "https://github.com/RustPython/Parser.git", rev = "704eb40108239a8faf9bd1d4217e8dad0ac7edb3" }
36+
rustpython-format = { git = "https://github.com/RustPython/Parser.git", rev = "704eb40108239a8faf9bd1d4217e8dad0ac7edb3" }
3737
# rustpython-literal = { path = "../RustPython-parser/literal" }
3838
# rustpython-parser-core = { path = "../RustPython-parser/core" }
3939
# rustpython-parser = { path = "../RustPython-parser/parser" }

compiler/codegen/src/compile.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,7 @@ impl Compiler {
888888
Stmt::Pass(_) => {
889889
// No need to emit any code here :)
890890
}
891+
Stmt::TypeAlias(_) => {}
891892
}
892893
Ok(())
893894
}

compiler/codegen/src/symboltable.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@ impl SymbolTableBuilder {
686686
bases,
687687
keywords,
688688
decorator_list,
689+
type_params: _,
689690
range,
690691
}) => {
691692
self.enter_scope(name.as_str(), SymbolTableType::Class, range.start.row.get());
@@ -863,6 +864,7 @@ impl SymbolTableBuilder {
863864
self.scan_expression(expression, ExpressionContext::Load)?;
864865
}
865866
}
867+
Stmt::TypeAlias(StmtTypeAlias { .. }) => {}
866868
}
867869
Ok(())
868870
}

0 commit comments

Comments
 (0)