feat: add recursion limit to parser

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2025-12-18 12:26:19 -06:00
parent fd4bb3081f
commit 5d0cf95332
2 changed files with 93 additions and 9 deletions

View File

@@ -0,0 +1,17 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
cases:
- note: deep-parens-over-limit
rego: |
package test
x = ((((((((((((((((((((((((((((((((1))))))))))))))))))))))))))))))))
error: "expression nesting too deep"
skip: true
- note: compr-mixed-deep
rego: |
package test
x = (1 + ( 2 + ( 3 + ( 4 + ((((((( [ [ 1 + (2 + ((((((((((((((((((((1))))))))))))))))))))) | true ] | true ] )))))))))))))
error: "expression nesting too deep"