Update nom_locate to 2.0.0
This commit is contained in:
parent
2c63dcaeba
commit
99b28d8f6e
@ -3,6 +3,7 @@
|
|||||||
## [Unreleased](https://github.com/dalance/sv-parser/compare/v0.6.4...Unreleased) - ReleaseDate
|
## [Unreleased](https://github.com/dalance/sv-parser/compare/v0.6.4...Unreleased) - ReleaseDate
|
||||||
|
|
||||||
* [Fixed] casting parse error [#8](https://github.com/dalance/sv-parser/issues/8)
|
* [Fixed] casting parse error [#8](https://github.com/dalance/sv-parser/issues/8)
|
||||||
|
* [Changed] update nom_locate to 2.0.0
|
||||||
|
|
||||||
## [v0.6.4](https://github.com/dalance/sv-parser/compare/v0.6.3...v0.6.4) - 2020-03-12
|
## [v0.6.4](https://github.com/dalance/sv-parser/compare/v0.6.3...v0.6.4) - 2020-03-12
|
||||||
|
|
||||||
|
@ -18,12 +18,12 @@ default = []
|
|||||||
trace = ["nom-tracable/trace"]
|
trace = ["nom-tracable/trace"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nom = "5.0.0"
|
nom = "5"
|
||||||
nom_locate = "1.0.0"
|
nom_locate = "2"
|
||||||
nom-greedyerror = "0.1.0"
|
nom-greedyerror = "0.2"
|
||||||
nom-packrat = "0.3.0"
|
nom-packrat = "0.4"
|
||||||
nom-recursive = {version = "0.1.1", features = ["tracer128"]}
|
nom-recursive = {version = "0.2", features = ["tracer128"]}
|
||||||
nom-tracable = "0.4.1"
|
nom-tracable = "0.5"
|
||||||
str-concat = "0.2.0"
|
str-concat = "0.2"
|
||||||
sv-parser-macros = {version = "^0.6.4", path = "../sv-parser-macros"}
|
sv-parser-macros = {version = "^0.6.4", path = "../sv-parser-macros"}
|
||||||
sv-parser-syntaxtree = {version = "^0.6.4", path = "../sv-parser-syntaxtree"}
|
sv-parser-syntaxtree = {version = "^0.6.4", path = "../sv-parser-syntaxtree"}
|
||||||
|
@ -54,7 +54,7 @@ pub struct SpanInfo {
|
|||||||
pub recursive_info: RecursiveInfo,
|
pub recursive_info: RecursiveInfo,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type Span<'a> = nom_locate::LocatedSpanEx<&'a str, SpanInfo>;
|
pub type Span<'a> = nom_locate::LocatedSpan<&'a str, SpanInfo>;
|
||||||
pub type IResult<T, U> = nom::IResult<T, U, GreedyError<T>>;
|
pub type IResult<T, U> = nom::IResult<T, U, GreedyError<T>>;
|
||||||
|
|
||||||
impl HasRecursiveInfo for SpanInfo {
|
impl HasRecursiveInfo for SpanInfo {
|
||||||
|
@ -427,14 +427,12 @@ pub(crate) fn current_version() -> Option<VersionSpecifier> {
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
pub(crate) fn concat<'a>(a: Span<'a>, b: Span<'a>) -> Option<Span<'a>> {
|
pub(crate) fn concat<'a>(a: Span<'a>, b: Span<'a>) -> Option<Span<'a>> {
|
||||||
let c = unsafe { str_concat::concat(a.fragment, b.fragment) };
|
let c = unsafe { str_concat::concat(a.fragment(), b.fragment()) };
|
||||||
if let Ok(c) = c {
|
if let Ok(c) = c {
|
||||||
Some(Span {
|
let ret = unsafe {
|
||||||
offset: a.offset,
|
Span::new_from_raw_offset(a.location_offset(), a.location_line(), c, a.extra)
|
||||||
line: a.line,
|
};
|
||||||
fragment: c,
|
Some(ret)
|
||||||
extra: a.extra,
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
@ -454,7 +452,7 @@ pub(crate) fn is_keyword(s: &Span) -> bool {
|
|||||||
None => KEYWORDS_1800_2017,
|
None => KEYWORDS_1800_2017,
|
||||||
};
|
};
|
||||||
for k in keywords {
|
for k in keywords {
|
||||||
if &s.fragment == k {
|
if s.fragment() == k {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -463,8 +461,8 @@ pub(crate) fn is_keyword(s: &Span) -> bool {
|
|||||||
|
|
||||||
pub(crate) fn into_locate(s: Span) -> Locate {
|
pub(crate) fn into_locate(s: Span) -> Locate {
|
||||||
Locate {
|
Locate {
|
||||||
offset: s.offset,
|
offset: s.location_offset(),
|
||||||
line: s.line,
|
line: s.location_line(),
|
||||||
len: s.fragment.len(),
|
len: s.fragment().len(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,8 @@ default = []
|
|||||||
trace = ["sv-parser-parser/trace"]
|
trace = ["sv-parser-parser/trace"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nom = "5.0.0"
|
nom = "5"
|
||||||
nom-greedyerror = "0.1.0"
|
nom-greedyerror = "0.2"
|
||||||
sv-parser-error = {version = "^0.6.4", path = "../sv-parser-error"}
|
sv-parser-error = {version = "^0.6.4", path = "../sv-parser-error"}
|
||||||
sv-parser-parser = {version = "^0.6.4", path = "../sv-parser-parser"}
|
sv-parser-parser = {version = "^0.6.4", path = "../sv-parser-parser"}
|
||||||
sv-parser-syntaxtree = {version = "^0.6.4", path = "../sv-parser-syntaxtree"}
|
sv-parser-syntaxtree = {version = "^0.6.4", path = "../sv-parser-syntaxtree"}
|
||||||
|
@ -23,8 +23,8 @@ default = []
|
|||||||
trace = ["sv-parser-parser/trace"]
|
trace = ["sv-parser-parser/trace"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nom = "5.0.0"
|
nom = "5"
|
||||||
nom-greedyerror = "0.1.0"
|
nom-greedyerror = "0.2"
|
||||||
sv-parser-error = {version = "^0.6.4", path = "../sv-parser-error"}
|
sv-parser-error = {version = "^0.6.4", path = "../sv-parser-error"}
|
||||||
sv-parser-parser = {version = "^0.6.4", path = "../sv-parser-parser"}
|
sv-parser-parser = {version = "^0.6.4", path = "../sv-parser-parser"}
|
||||||
sv-parser-pp = {version = "^0.6.4", path = "../sv-parser-pp"}
|
sv-parser-pp = {version = "^0.6.4", path = "../sv-parser-pp"}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user