on master help sign in
Update comment about alternative nest level
commit05b2d530efa44b4afed6ff699651643acfc13c33 authorHarendra Kumar <harendra@composewell.com> dateWed 14 Apr 2021, 00:32 (6 years ago) parentec8ab6f
1 file changed+5−1
src/Streamly/Internal/Data/Parser/ParserK/Type.hs+5−1
src/Streamly/Internal/Data/Parser/ParserK/Type.hs+5−1
@@ -87,9 +87,13 @@ newtype Parser m a b = MkParser
8787 -- it is done. The used element count is a count of elements
8888 -- consumed by the Alternative. If the Alternative fails we need to
8989 -- backtrack by this amount.
90+ --
91+ -- The nesting level is used in parseDToK to optimize the case when
92+ -- we are not in an alternative, in that case we do not need to
93+ -- maintain the element count for backtracking.
9094 -> (Int, Int)
9195 -- The first argument is the (nest level, used count) tuple as
92− -- described above. The leftover element count carried as part of
96+ -- described above. The leftover element count is carried as part of
9397 -- 'Done' constructor of 'Parse'.
9498 -> ((Int, Int) -> Parse b -> m (Driver m a r))
9599 -> m (Driver m a r)