#Parser goes into an infinite loop

1 messages · Page 1 of 1 (latest)

jovial grove
#

I made a parser using the chomp package (fork of @buoyant schooner's nibble), but when I run it, it goes into an infinite loop and overflows:

export function many(parser) {
                    ^

RangeError: Maximum call stack size exceeded
    at Module.many (file:///home/theonlytails/IdeaProjects/nymph_gleam/build/dev/javascript/chomp/chomp.mjs:482:21)
    at parse_string (file:///home/theonlytails/IdeaProjects/nymph_gleam/build/dev/javascript/nymph_lang/nymph/parser.mjs:230:22)
    at file:///home/theonlytails/IdeaProjects/nymph_gleam/build/dev/javascript/nymph_lang/nymph/parser.mjs:620:21

source code is available here: https://github.com/theonlytails/nymph_gleam/blob/src/nymph/parser.gleam/

#

weirdest thing is - i'm not even parsing a string in this case

#

the parse_string function is recursive because it has string interpolation, btw