fix: external pylib bugs

This commit is contained in:
Shunsuke Shibayama 2023-12-06 18:31:03 +09:00
parent 20935796fd
commit fb0248fdf1
7 changed files with 41 additions and 5 deletions

View file

@ -4406,6 +4406,18 @@ impl VarPattern {
}
}
pub fn escaped(&self) -> Option<Str> {
match self {
Self::Ident(ident) => {
let inspect = ident.inspect();
Some(Str::rc(
inspect.trim_end_matches('!').trim_start_matches('$'),
))
}
_ => None,
}
}
// _!(...) = ... is invalid
pub fn is_procedural(&self) -> bool {
match self {
@ -4502,6 +4514,10 @@ impl VarSignature {
self.pat.inspect()
}
pub fn escaped(&self) -> Option<Str> {
self.pat.escaped()
}
pub const fn vis(&self) -> &VisModifierSpec {
self.pat.vis()
}