From 703fcb451dfadc1f7e5fd44912896ae43b090a70 Mon Sep 17 00:00:00 2001 From: rvcas Date: Thu, 26 Jan 2023 09:33:29 -0500 Subject: [PATCH] fix(parser,windows): capture carriage return properly --- crates/aiken-lang/src/parser/lexer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/aiken-lang/src/parser/lexer.rs b/crates/aiken-lang/src/parser/lexer.rs index 913e27d4..1349ae39 100644 --- a/crates/aiken-lang/src/parser/lexer.rs +++ b/crates/aiken-lang/src/parser/lexer.rs @@ -52,8 +52,8 @@ pub fn lexer() -> impl Parser, Error = ParseError> { just('|').to(Token::Vbar), just("&&").to(Token::AmperAmper), just('#').to(Token::Hash), - just("\n\n").to(Token::EmptyLine), - just("\n").to(Token::NewLine), + choice((just("\n\n"), just("\r\n\r\n"))).to(Token::EmptyLine), + choice((just("\n"), just("\r\n"))).to(Token::NewLine), )); let grouping = choice((