aboutsummaryrefslogtreecommitdiff
path: root/grammar.js
diff options
context:
space:
mode:
Diffstat (limited to 'grammar.js')
-rw-r--r--grammar.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/grammar.js b/grammar.js
index 2f0e67b..f3ce654 100644
--- a/grammar.js
+++ b/grammar.js
@@ -45,10 +45,10 @@ module.exports = grammar({
class_attr: $ => seq('.',
field('name', alias(token.immediate(IDENT), $.ident))),
- text: $ => repeat1(choice(
- /(\\[@}\\]|[^@}\\\p{Pattern_White_Space}])((\\[@}\\]|[^@}\\])*(\\[@}\\]|[^@}\\\p{Pattern_White_Space}]))?/u,
- seq('@', $._toplevel),
- )),
+ text: $ => repeat1(choice($.raw_text, $.inline_node)),
+ raw_text: $ => /(\\[@}\\]|[^@}\\\p{Pattern_White_Space}])((\\[@}\\]|[^@}\\])*(\\[@}\\]|[^@}\\\p{Pattern_White_Space}]))?/u,
+ inline_node: $ => seq('@', $._toplevel),
+
ident: $ => IDENT,
string: $ => /"(\\["\\]|[^"\\])+"/,
},