OPA Conformance: Do not interpret # within regular string (#216)

fixes #213

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2024-04-25 23:51:52 -07:00
committed by GitHub
parent 7fde3382f6
commit 744dad6126
2 changed files with 4 additions and 6 deletions

View File

@@ -455,7 +455,7 @@ impl<'source> Lexer<'source> {
let (offset, ch) = self.peek();
let col = self.col + (offset - start) as u16;
match ch {
'"' | '#' | '\x00' => {
'"' | '\x00' => {
break;
}
'\\' => {

View File

@@ -56,11 +56,9 @@ cases:
- note: comments-within-rstring
rego: |
#Comments aren't allowed within strings,
"#This is not a comment
"#c
tokens:
error: unmatched "
#Comments aren't lexed within raw strings.
"#This is not a comment"#c
tokens: ["#This is not a comment", ""]
- note: comment-integer-break
rego: |