Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

LanguageKit.whitespace throws JS exception when allowTabs=True #29

Open
brian-carroll opened this issue Nov 12, 2017 · 0 comments
Open
Labels

Comments

@brian-carroll
Copy link

brian-carroll commented Nov 12, 2017

Hi, Really nice library, enjoying using it!
I noticed the whitespace function only works with allowTabs = False. When set to True, it looks like there's an infinite recursion somewhere.
See REPL session below based on the example from the documentation comments.
I'm using v2.0.1 of the library with Elm 0.18.

$ elm repl
---- elm-repl 0.18.0 -----------------------------------------------------------
 :help for help, :exit to exit, more at <https://github.com/elm-lang/elm-repl>
--------------------------------------------------------------------------------
> import Parser exposing (..)
> import Parser.LanguageKit exposing (..)
> jsWhitespace = whitespace { allowTabs = True, lineComment = LineComment "//", multiComment = UnnestableComment "/*" "*/" }
Parser <function> : Parser.Parser ()
> run jsWhitespace ""
RangeError: Maximum call stack size exceeded
> noTabsWhitespace = whitespace { allowTabs = False, lineComment = LineComment "//", multiComment = UnnestableComment "/*" "*/" }
Parser <function> : Parser.Parser ()
> run noTabsWhitespace ""
Ok () : Result.Result Parser.Error ()
>
@brian-carroll brian-carroll changed the title LanguageKit.whitespace doesn't work with allowTabs=True LanguageKit.whitespace throws JS exception when allowTabs=True Nov 12, 2017
@evancz evancz added bug problem and removed bug labels May 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants