mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 20:34:44 +00:00
Impl Location::RangePair
This commit is contained in:
parent
7573c0e128
commit
c2edad7556
2 changed files with 77 additions and 41 deletions
|
@ -407,7 +407,10 @@ pub trait Locational {
|
|||
|
||||
fn ln_begin(&self) -> Option<usize> {
|
||||
match self.loc() {
|
||||
Location::RangePair { ln_begin, .. }
|
||||
Location::RangePair {
|
||||
ln_first: (ln_begin, _),
|
||||
..
|
||||
}
|
||||
| Location::Range { ln_begin, .. }
|
||||
| Location::LineRange(ln_begin, _) => Some(ln_begin),
|
||||
Location::Line(lineno) => Some(lineno),
|
||||
|
@ -417,7 +420,10 @@ pub trait Locational {
|
|||
|
||||
fn ln_end(&self) -> Option<usize> {
|
||||
match self.loc() {
|
||||
Location::RangePair { ln_end, .. }
|
||||
Location::RangePair {
|
||||
ln_second: (_, ln_end),
|
||||
..
|
||||
}
|
||||
| Location::Range { ln_end, .. }
|
||||
| Location::LineRange(_, ln_end) => Some(ln_end),
|
||||
Location::Line(lineno) => Some(lineno),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue