Skip to content

Commit 6fc1b6c

Browse files
committed
fix(parser): window-specific crap in #45
1 parent 48e6b43 commit 6fc1b6c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

crates/rowan/build.rs

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ fn main() {
55

66
let ungram = std::fs::read_to_string("src/ast/rhai.ungram").unwrap();
77

8+
let ungram = if cfg!(windows) {
9+
ungram.replace("\r\n", "\n")
10+
} else {
11+
ungram
12+
};
13+
814
let generated = rhai_sourcegen::syntax::generate_syntax(&ungram).unwrap();
915

1016
let syntax_file = std::fs::read_to_string("src/syntax.rs").unwrap();

crates/rowan/src/syntax.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ pub enum SyntaxKind {
329329
#[token("/**", lex_multi_line_comment)]
330330
COMMENT_BLOCK_DOC,
331331

332-
#[regex(r"[ \t\n\f]+")]
332+
#[regex(r"[ \t\r\n\f]+")]
333333
WHITESPACE,
334334
#[error]
335335
ERROR,

0 commit comments

Comments
 (0)