parser
parser copied to clipboard
Parser.LanguageKit.whitespace with allowTabs=True has infinite recursion
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