diff --git a/sv-parser-parser/src/utils.rs b/sv-parser-parser/src/utils.rs index c94365e..902777c 100644 --- a/sv-parser-parser/src/utils.rs +++ b/sv-parser-parser/src/utils.rs @@ -314,9 +314,12 @@ pub(crate) fn white_space(s: Span) -> IResult { })(s) } else { alt(( - map(multispace1, |x: Span| { + map(space1, |x: Span| { WhiteSpace::Space(Box::new(into_locate(x))) }), + map(multispace1, |x: Span| { + WhiteSpace::Newline(Box::new(into_locate(x))) + }), map(preceded(peek(char('/')), comment), |x| { WhiteSpace::Comment(Box::new(x)) }), diff --git a/sv-parser-syntaxtree/src/special_node.rs b/sv-parser-syntaxtree/src/special_node.rs index 753824d..fd1b528 100644 --- a/sv-parser-syntaxtree/src/special_node.rs +++ b/sv-parser-syntaxtree/src/special_node.rs @@ -14,6 +14,7 @@ pub struct Keyword { #[derive(Clone, Debug, PartialEq, Node)] pub enum WhiteSpace { + Newline(Box), Space(Box), Comment(Box), CompilerDirective(Box),