From 2ae677162fb06d50f396144139cc5ec98f034417 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Sun, 14 Sep 2025 15:47:23 -0400 Subject: [PATCH] docs: clarify that only the whitespace character class is simplfied --- docs/src/creating-parsers/3-writing-the-grammar.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/src/creating-parsers/3-writing-the-grammar.md b/docs/src/creating-parsers/3-writing-the-grammar.md index 0052198b..cb6ec3d4 100644 --- a/docs/src/creating-parsers/3-writing-the-grammar.md +++ b/docs/src/creating-parsers/3-writing-the-grammar.md @@ -471,9 +471,8 @@ module.exports = grammar({ ``` ```admonish note -Tree-sitter intentionally simplifies some common regex patterns, both as a performance optimization and for simplicity, -typically in ways that don't affect the meaning of the pattern. For example, `\w` is simplified to `[a-zA-Z0-9_]`, `\s` -to `[ \t\n\r]`, and `\d` to `[0-9]`. If you need more complex behavior, you can always use a more explicit regex. +Tree-sitter intentionally simplifies the whitespace character class, `\s`, to `[ \t\n\r]` as a performance +optimization. This is because typically users do not require the full Unicode definition of whitespace. ``` ## Using Supertypes