Stream: show and tell

Topic: parser combinator


view this post on Zulip James Carlson (Sep 30 2021 at 18:01):

I've been working on a parser combinator library: file Parser.roc in ./examples/parser of the branch jim-parser. There is are two test files of interest: ParserTest.roc and ManyTest.roc. The latter contains test of code that causes a panic, so progress is stalled at the moment.

view this post on Zulip Folkert de Vries (Sep 30 2021 at 18:03):

There are some open PRs to fix some of those problems, but I keep uncovering more

view this post on Zulip James Carlson (Sep 30 2021 at 20:07):

Thanks Folkert, good to know!

view this post on Zulip James Carlson (Oct 02 2021 at 23:14):

Just an FYI: the file examples/parser/ParserTest.roc in branch jim-parser panics after the latest merge with trunk. File is unchanged.

➜  roc git:(jim-parser) cargo run examples/parser/ParserTest.roc
   Compiling roc_gen_wasm v0.1.0 (/Users/jxxcarlson/dev/roc/roc/compiler/gen_wasm)
   Compiling roc_build v0.1.0 (/Users/jxxcarlson/dev/roc/roc/compiler/build)
   Compiling roc_linker v0.1.0 (/Users/jxxcarlson/dev/roc/roc/linker)
   Compiling roc_cli v0.1.0 (/Users/jxxcarlson/dev/roc/roc/cli)
    Finished dev [unoptimized + debuginfo] target(s) in 21.03s
     Running `target/debug/roc examples/parser/ParserTest.roc`
thread 'main' panicked at 'internal error: entered unreachable code: symbol/layout `fx.Effect.map` ProcLayout { arguments: [LambdaSet(LambdaSet { set: [(`fx.Effect.effect_closure_putLine`, [Builtin(Str)])], representation: Struct([Builtin(Str)]) }), LambdaSet(LambdaSet { set: [(`base.Task.6`, [])], representation: Struct([]) })], result: LambdaSet(LambdaSet { set: [(`fx.Effect.effect_map_inner`, [LambdaSet(LambdaSet { set: [(`fx.Effect.effect_closure_putLine`, [Builtin(Str)])], representation: Struct([Builtin(Str)]) }), LambdaSet(LambdaSet { set: [(`base.Task.6`, [])], representation: Struct([]) })])], representation: Struct([LambdaSet(LambdaSet { set: [(`fx.Effect.effect_closure_putLine`, [Builtin(Str)])], representation: Struct([Builtin(Str)]) }), LambdaSet(LambdaSet { set: [(`base.Task.6`, [])], representation: Struct([]) })]) }) } combo must be in DeclarationToIndex', compiler/mono/src/borrow.rs:227:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
^C

view this post on Zulip Folkert de Vries (Oct 02 2021 at 23:15):

do you remember when you ran it last?

view this post on Zulip James Carlson (Oct 02 2021 at 23:55):

September 30 for sure. I haven't changed it in a good while -- am waiting for ManyTest.roc to pass before I proceed

view this post on Zulip James Carlson (Oct 03 2021 at 18:02):

@Folkert de Vries , good news, doing the below in the jim-parser branch now succeeds.

cargo run examples/parser/ParserTest.roc

view this post on Zulip James Carlson (Oct 03 2021 at 18:02):

((after merging a few minutes ago with trunk))

view this post on Zulip Folkert de Vries (Oct 03 2021 at 18:17):

nice!


Last updated: Jul 05 2025 at 12:14 UTC