Stream: contributing

Topic: Unhandled parse error with list after `module`


view this post on Zulip Jared Ramirez (Dec 23 2024 at 17:18):

Hey y'all! I'm thinking of taking #7246. It looks like @Joshua Warner left some details in the ticket, so I'll get started there. Lmk if there's anything else I should important to know and I'll post here if I run into any issues!

view this post on Zulip Richard Feldman (Dec 23 2024 at 17:21):

nice! :smiley:

view this post on Zulip Jared Ramirez (Dec 23 2024 at 17:46):

What should the error message of this particular parse error be? Here's my first pass:

── WEIRD MODULE NAME in /code/proj/Main.roc ───────────────────────────────────────

I am partway through parsing a module header, but got stuck here:

    1│  module foobar []
               ^

I am expecting a list of exports like

    module [func, value]

or module params like

    module { echo } -> [func, value]

Unlike application names, module names are not specified in the
header definition. Instead, they are derived from the name of
the module's filename.

What do y'all think?

view this post on Zulip Jared Ramirez (Dec 23 2024 at 17:53):

Seems like this error message should include something about module params since that could follow the module keyword as well?

view this post on Zulip Jared Ramirez (Dec 23 2024 at 17:57):

Updated w/ module params. Is there any standard example export values/module params used in error like this? Or are echo/func/value fine?

view this post on Zulip Jared Ramirez (Dec 23 2024 at 18:39):

Cool, PR up here: https://github.com/roc-lang/roc/pull/7408

Happy to change the error message to whatever y'all think. It's currently:

── WEIRD MODULE NAME in /code/proj/Main.roc ────────────────────────────────────

I am partway through parsing a header, but I got stuck here:

    1│  module foobar []
               ^

I am expecting a list of exports like

    module [func, value]

or module params like

    module { echo } -> [func, value]

If you're trying to specify a module name, recall that unlike
application names, module names are not specified in the header.
Instead, they are derived from the name of the module's filename.

Last updated: Jul 06 2025 at 12:14 UTC