]> git.wincent.com - walrat.git/commit
Remove :origin option from memoization identifier
authorWincent Colaiuta <win@wincent.com>
Fri, 27 Aug 2010 21:37:40 +0000 (23:37 +0200)
committerWincent Colaiuta <win@wincent.com>
Fri, 27 Aug 2010 21:37:40 +0000 (23:37 +0200)
commit48ff88bf2d07e9a4fd27ce7b6c373fffcbad7ae6
tree7291e4d1ca6c329592e44cd73c0ab11b039202bc
parenteda4e09364ef2158c47349b362d0623b52748b68
Remove :origin option from memoization identifier

This was a Walrus-specific option so really has no place in Walrat
itself, and it turns out that it isn't necessary anyway and so only is a
waste of memory.

The motivation for adding it to the memoization identifier was so as to
distinguish between parse results with the same parseable at the same
location but in different files (for example, a comment directive
parslet seeing a comment on the first line of a file and also on the
first line of a file included from the former).

It turns out that this kind of differentiation is never needed because
include files are parsed by a completely separate Parser instance, and
each instance has its own MemoizingCache instance. See the
Walrus::Grammar :include_subparslet rule, and particularly this line:

  sub_result = Parser.new.parse(...)

Signed-off-by: Wincent Colaiuta <win@wincent.com>
lib/walrat/memoizing_cache.rb