mirror of https://github.com/mtshiba/pylyzer
Update convert.py
This commit is contained in:
parent
f13c6f7e37
commit
b473513ed8
|
|
@ -227,7 +227,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "erg_common"
|
||||
version = "0.6.0-beta.4"
|
||||
source = "git+https://github.com/erg-lang/erg?branch=main#bce00747af9b69191ba4e63f3db44afd51509b8b"
|
||||
source = "git+https://github.com/erg-lang/erg?branch=main#37a203e25421c8a9e8d231cc2486e7df9b2ce177"
|
||||
dependencies = [
|
||||
"hermit-abi",
|
||||
"libc",
|
||||
|
|
@ -237,7 +237,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "erg_compiler"
|
||||
version = "0.6.0-beta.4"
|
||||
source = "git+https://github.com/erg-lang/erg?branch=main#bce00747af9b69191ba4e63f3db44afd51509b8b"
|
||||
source = "git+https://github.com/erg-lang/erg?branch=main#37a203e25421c8a9e8d231cc2486e7df9b2ce177"
|
||||
dependencies = [
|
||||
"erg_common",
|
||||
"erg_parser",
|
||||
|
|
@ -246,7 +246,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "erg_parser"
|
||||
version = "0.6.0-beta.4"
|
||||
source = "git+https://github.com/erg-lang/erg?branch=main#bce00747af9b69191ba4e63f3db44afd51509b8b"
|
||||
source = "git+https://github.com/erg-lang/erg?branch=main#37a203e25421c8a9e8d231cc2486e7df9b2ce177"
|
||||
dependencies = [
|
||||
"erg_common",
|
||||
"unicode-xid 0.2.4",
|
||||
|
|
|
|||
|
|
@ -54,6 +54,26 @@ fn escape_name(name: String) -> String {
|
|||
"tuple" => "GenericTuple".into(),
|
||||
"type" => "Type".into(),
|
||||
"ModuleType" => "GeneticModule".into(),
|
||||
"Obj" => "Obj\0".into(),
|
||||
"Int" => "Int\0".into(),
|
||||
"Nat" => "Nat\0".into(),
|
||||
"Ratio" => "Ratio\0".into(),
|
||||
"Float" => "Float\0".into(),
|
||||
"Bool" => "Bool\0".into(),
|
||||
"Str" => "Str\0".into(),
|
||||
"NoneType" => "NoneType\0".into(),
|
||||
"Code" => "Code\0".into(),
|
||||
"Frame" => "Frame\0".into(),
|
||||
"Error" => "Error\0".into(),
|
||||
"Inf" => "Inf\0".into(),
|
||||
"NegInf" => "NegInf\0".into(),
|
||||
"Type" => "Type\0".into(),
|
||||
"ClassType" => "ClassType\0".into(),
|
||||
"TraitType" => "TraitType\0".into(),
|
||||
"Patch" => "Patch\0".into(),
|
||||
"NotImplemented" => "NotImplemented\0".into(),
|
||||
"Ellipsis" => "Ellipsis\0".into(),
|
||||
"Never" => "Never\0".into(),
|
||||
_ => name,
|
||||
}
|
||||
}
|
||||
|
|
@ -201,7 +221,8 @@ impl ASTConverter {
|
|||
fn param_pattern_to_var(pat: ParamPattern) -> VarPattern {
|
||||
match pat {
|
||||
ParamPattern::VarName(name) => VarPattern::Ident(Identifier::new(Some(DOT), name)),
|
||||
_ => todo!(),
|
||||
ParamPattern::Discard(token) => VarPattern::Discard(token),
|
||||
other => todo!("{other}"),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue