abstract class Ven::Suite::Visitor
- Ven::Suite::Visitor
- Reference
- Object
Overview
The base class for a node (in Ven, quote) visitor.
Direct Known Subclasses
Defined in:
ven/suite/visitor.crConstant Summary
-
MAX_VISIT_DEPTH =
2048
-
Maximum amount of nested
#visit
calls. This prevents the Crystal 'very deep recursion' error with thousands of entries jumpscaring a user. Since we're a visitor, we have to handle recursion depth errors well. The number will change, as any significant interpreter update generally decreases it.WHAT: per one meaningful visit the Ven infrastructure may make over 10 (much more in reality) internal calls; this expodes the call stack very quickly, causing Ven itself to blow up. We prevent this by having a
MAX_VISIT_DEPTH
.
Instance Method Summary
- #last=(last : Quote)
-
#visit(quote : Quote)
Remembers quote as the last visited node and hands it off to
#visit!
. -
#visit(quotes : Quotes)
Same as
#visit(quote)
, but iterates over quotes. -
#visit!(quote : _)
Fallback visitor (subclass has no such visitor).
Instance Method Detail
Remembers quote as the last visited node and hands it
off to #visit!
. Makes sure visit depth does not exceed
MAX_VISIT_DEPTH
.