mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
feat: Safeguard against panics in parser
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
@@ -163,6 +163,12 @@ cases:
|
||||
num_statements: 0
|
||||
want_result: {}
|
||||
|
||||
- note: invalid-future-component
|
||||
rego: |
|
||||
package test
|
||||
import future.keywords.foo.bar
|
||||
error: "invalid future keyword"
|
||||
|
||||
- note: shadow/1
|
||||
rego: |
|
||||
package test
|
||||
|
||||
@@ -78,3 +78,21 @@ cases:
|
||||
some a, 5
|
||||
}
|
||||
error: encountered `5` while expecting identifier
|
||||
|
||||
- note: no-vars-before-in
|
||||
rego: |
|
||||
package test
|
||||
import future.keywords.in
|
||||
x = y {
|
||||
some in xs
|
||||
}
|
||||
error: "unexpected keyword `in`"
|
||||
|
||||
- note: too-many-before-in
|
||||
rego: |
|
||||
package test
|
||||
import future.keywords.in
|
||||
x = y {
|
||||
some a, b, c in xs
|
||||
}
|
||||
error: "encountered `c` while expecting `in`"
|
||||
|
||||
Reference in New Issue
Block a user