[3.10] Allow the parser to avoid nested processing of invalid rules (GH-31252). (GH-31257)

(cherry picked from commit 390459de6db1e68b79c0897cc88c0d562693ec5c)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
6 files changed