Files
regorus/tests/lexer/cases/comment.yaml
Anand Krishnamoorthi 744dad6126 OPA Conformance: Do not interpret # within regular string (#216)
fixes #213

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-04-25 23:51:52 -07:00

70 lines
1.3 KiB
YAML

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
cases:
- note: comments-immediately-following/1
rego: |
#This is a comment #Nested comment
ident#a
123.4e5#c
6#c
+#c
-#c
*#c
/#c
&#c
|#c
[#c
]#c
(#c
)#c
{#c
}#c
,#c
;#c
.#c
:#c
<#c
<=#c
>#c
>=#c
=#c
==#c
# Ensure that <, =, > are read separately.
<#c
=#c
>#c
=#c
=#c
tokens: ["ident", "123.4e5", "6", "+", "-", "*", "/", "&", "|",
"[", "]", "(", ")", "{", "}", ",", ";", ".", ":",
"<", "<=", ">", ">=", "=", "==",
"<", "=", ">", "=", "=",
""]
# Non-ascii chars can appear in comments.
- note: comments-non-ascii
rego: # சிக்கி
tokens: [""]
- note: comments-within-raw-string
rego: |
#Comments aren't lexed within raw strings.
`raw#This is not a comment
string`#c
tokens: ["raw#This is not a comment\nstring", ""]
- note: comments-within-rstring
rego: |
#Comments aren't lexed within raw strings.
"#This is not a comment"#c
tokens: ["#This is not a comment", ""]
- note: comment-integer-break
rego: |
12#
.3
tokens:
error: invalid number