mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-01 05:11:09 +00:00
Fix Block::loc
This commit is contained in:
parent
e1c8bb415b
commit
bb03ca6097
2 changed files with 10 additions and 2 deletions
|
@ -1466,9 +1466,13 @@ impl_stream_for_wrapper!(Block, Expr);
|
|||
|
||||
impl Locational for Block {
|
||||
fn loc(&self) -> Location {
|
||||
if self.0.is_empty() {
|
||||
Location::Unknown
|
||||
} else {
|
||||
Location::concat(self.0.first().unwrap(), self.0.last().unwrap())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct VarSignature {
|
||||
|
|
|
@ -1156,9 +1156,13 @@ impl_display_from_nested!(Block);
|
|||
|
||||
impl Locational for Block {
|
||||
fn loc(&self) -> Location {
|
||||
if self.0.is_empty() {
|
||||
Location::Unknown
|
||||
} else {
|
||||
Location::concat(self.0.first().unwrap(), self.0.last().unwrap())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl_stream_for_wrapper!(Block, Expr);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue