module ParserLimit

Overview

Parser limits from environment (e.g. for large repos).

NOIR_PARSER_MAX_DEPTH When set, miniparsers stop following imports beyond this depth. Depth 0 = entry file only; 1 = entry + direct imports; etc. Unset or negative = no limit.

Extended Modules

Defined in:

utils/parser_limit.cr

Instance Method Summary

Instance Method Detail

def allow_depth?(depth : Int32) : Bool #

Returns true if parsing at the given depth may follow imports (i.e. depth < max_depth).


[View source]
def max_depth : Int32 | Nil #

Maximum import depth (0 = entry file only). Nil = no limit.


[View source]
def reset #

Reset cached state so the environment variable is re-read on next access. Intended for testing only.


[View source]