public final void increaseNestingLevel() {
        nestingLevel++;

        if (maxNestingLevel > 0 && nestingLevel > maxNestingLevel) {
            throw syntax("Parser exceeded the maximum allowed depth of " + maxNestingLevel);
        }
    }
Increases the current nesting level of the parser.

<p>This method can be manually invoked when parsing in order to
prevent parsing too deeply using recursive descent parsers.

@throws RuntimeException if the nesting level is deeper than the max allowed nesting.
smithy-utils/src/main/java/software/amazon/smithy/utils/SimpleParser.java