Documentation
¶
Overview ¶
Package nesting measures how deeply CUE source nests before it is parsed. CUE's parser recurses once per level with no limit, and a deep enough source overflows the stack, which is fatal to the process: no recover catches it.
Index ¶
Constants ¶
const MaxDepth = 1000
MaxDepth is the deepest nesting CUE source handed to the parser may have. Shipped definitions nest at most 18 levels; at about 3 KB of stack a level, this costs a few megabytes.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
Check refuses src when it nests deeper than max, or chains more than chainFactor times max operations in one expression.
func CheckJSONStrings ¶
CheckJSONStrings refuses a JSON document any of whose strings nests deeper than max as CUE, naming the first such field. It is for objects, such as definitions, that carry CUE in their string fields. A document that does not decode is left to the caller's decoder to report.
Types ¶
This section is empty.