parser icon indicating copy to clipboard operation
parser copied to clipboard

Parser.LanguageKit.whitespace with allowTabs=True has infinite recursion

Open dave-doty opened this issue 8 years ago • 0 comments

The following is executed in elm-repl v0.18. The first two calls with allowTabs=False terminate as expected (although I'm confused as to why "\t" has a positive match when allowTabs=False), but the next two calls with allowTabs=True cause what is apparently an infinite recursion:

> import Parser exposing (..)
> import Parser.LanguageKit exposing (..)
> run (whitespace { allowTabs=False, lineComment=NoLineComment, multiComment=NoMultiComment } ) " "
Ok () : Result.Result Parser.Error ()
> run (whitespace { allowTabs=False, lineComment=NoLineComment, multiComment=NoMultiComment } ) "\t"
Ok () : Result.Result Parser.Error ()
> run (whitespace { allowTabs=True, lineComment=NoLineComment, multiComment=NoMultiComment } ) " "
RangeError: Maximum call stack size exceeded
> run (whitespace { allowTabs=True, lineComment=NoLineComment, multiComment=NoMultiComment } ) "\t"
RangeError: Maximum call stack size exceeded

dave-doty avatar Jul 28 '17 21:07 dave-doty