Class Parslet::Atoms::Context
In: lib/parslet/atoms/context.rb
Parent: Object

Helper class that implements a transient cache that maps position and parslet object to results. This is used for memoization in the packrat style.

Methods

cache   new  

Public Class methods

Public Instance methods

Caches a parse answer for obj at source.pos. Applying the same parslet at one position of input always yields the same result, unless the input has changed.

We need the entire source here so we can ask for how many characters were consumed by a successful parse. Imitation of such a parse must advance the input pos by the same amount of bytes.

[Validate]