File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,14 @@ the characters `U+0022` (double-quote) (except when followed by at least as
208
208
many ` U+0023 ` (` # ` ) characters as were used to start the raw string literal) or
209
209
` U+005C ` (` \ ` ) do not have any special meaning.
210
210
211
+ ** Note that this is a _ context-sensitive_ grammar, as opposed to _ context-free_ .**
212
+ This is because strings like ` r###"I contain only 2 "##s so I'm ok"### ` require
213
+ a parser to properly count the number of opening #'s and compare that count to two
214
+ different values. In practical terms this is very easy for a parser to do, but
215
+ a context-free language can't because the only way to express "counting" is
216
+ as a destructive operation which forces you to forget the count. This allows
217
+ for the "comparison" of two counts (such (as (balanced) (parens))) but not 3+.
218
+
211
219
Examples for string literals:
212
220
213
221
``` rust
You can’t perform that action at this time.
0 commit comments