Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/lib.rs')
-rw-r--r--crates/parser/src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs
index 3e0e0d4c42..5900d7cfed 100644
--- a/crates/parser/src/lib.rs
+++ b/crates/parser/src/lib.rs
@@ -56,6 +56,13 @@ pub use crate::{
syntax_kind::SyntaxKind,
};
+/// True if `c` is whitespace in Rust source (Unicode Pattern_White_Space as in the language reference).
+///
+/// See <https://doc.rust-lang.org/reference/whitespace.html>.
+pub fn is_rust_whitespace(c: char) -> bool {
+ frontmatter::is_whitespace(c)
+}
+
/// Parse the whole of the input as a given syntactic construct.
///
/// This covers two main use-cases: