Skip to content

Commit

Permalink
support multiple calls to a neotoma module in the same process
Browse files Browse the repository at this point in the history
Right now you can't have one call to a neotoma parser in side of an
existing neotoma parser (rare case I know). This patch solves that
problem.
  • Loading branch information
Eric Merritt authored and seancribbs committed Sep 18, 2012
1 parent 2becaac commit 83e6a26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions priv/peg_includes.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ p(Inp, StartIndex, Name, ParseFun, TransformFun) ->
end.

setup_memo() ->
put(parse_memo_table, ets:new(?MODULE, [set])).
put({parse_memo_table, ?MODULE}, ets:new(?MODULE, [set])).

release_memo() ->
ets:delete(memo_table_name()).
Expand All @@ -42,7 +42,7 @@ get_memo(Index, Name) ->
end.

memo_table_name() ->
get(parse_memo_table).
get({parse_memo_table, ?MODULE}).

p_eof() ->
fun(<<>>, Index) -> {eof, [], Index};
Expand Down

0 comments on commit 83e6a26

Please sign in to comment.