Add LF/CR+LF support
This commit is contained in:
parent
d03120fc7d
commit
a733e3b980
@ -2,6 +2,8 @@
|
||||
|
||||
## [Unreleased](https://github.com/dalance/sv-parser/compare/v0.3.4...Unreleased) - ReleaseDate
|
||||
|
||||
* [Added] LF/CR+LF support
|
||||
|
||||
## [v0.3.4](https://github.com/dalance/sv-parser/compare/v0.3.3...v0.3.4) - 2019-11-05
|
||||
|
||||
* [Fixed] define with string literal
|
||||
|
@ -204,7 +204,13 @@ pub(crate) fn text_macro_identifier_exact(s: Span) -> IResult<Span, TextMacroIde
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn macro_text(s: Span) -> IResult<Span, MacroText> {
|
||||
let (s, a) = many1(alt((tag("\\\n"), tag("\\"), is_not("\\\n"))))(s)?;
|
||||
let (s, a) = many1(alt((
|
||||
tag("\\\n"),
|
||||
tag("\\\r\n"),
|
||||
tag("\\\r"),
|
||||
tag("\\"),
|
||||
is_not("\\\r\n"),
|
||||
)))(s)?;
|
||||
|
||||
let mut ret = None;
|
||||
for x in a {
|
||||
|
@ -437,7 +437,9 @@ fn resolve_text_macro_usage<T: AsRef<Path>, U: AsRef<Path>>(
|
||||
.replace("``", "")
|
||||
.replace("`\\`\"", "\\\"")
|
||||
.replace("`\"", "\"")
|
||||
.replace("\\\n", ""),
|
||||
.replace("\\\n", "")
|
||||
.replace("\\\r\n", "")
|
||||
.replace("\\\r", ""),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user