mirror of
https://github.com/swc-project/swc.git
synced 2024-10-04 12:18:08 +03:00
fix(common): Fix StringInput.end_pos
(#9362)
This commit is contained in:
parent
dd4b78248a
commit
5368e189ab
5
.changeset/pink-pianos-allow.md
Normal file
5
.changeset/pink-pianos-allow.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
swc_common: patch
|
||||
---
|
||||
|
||||
fix(common): Fix `StringInput.end_pos`
|
@ -15,6 +15,7 @@ pub struct StringInput<'a> {
|
||||
orig: &'a str,
|
||||
/// Original start position.
|
||||
orig_start: BytePos,
|
||||
orig_end: BytePos,
|
||||
}
|
||||
|
||||
impl<'a> StringInput<'a> {
|
||||
@ -34,6 +35,7 @@ impl<'a> StringInput<'a> {
|
||||
orig: src,
|
||||
iter: src.chars(),
|
||||
orig_start: start,
|
||||
orig_end: end,
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +57,7 @@ impl<'a> StringInput<'a> {
|
||||
}
|
||||
|
||||
pub fn end_pos(&self) -> BytePos {
|
||||
self.last_pos
|
||||
self.orig_end
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user