A gleam implementation of the Xcruciating Markup Language Parser that you build with this guide on parser combinators: bodil.lol/parser-combinators/.
This input:
<top label=\"Top\">
<semi-bottom label=\"Bottom\"/>
<middle>
<bottom label=\"Another bottom\"/>
</middle>
</top>
will get parsed as:
Ok(
tuple(
Parsable(""),
Element(
"top",
[Attribute("label", "Top")],
[
Element("semi-bottom", [Attribute("label", "Bottom")], []),
Element(
"middle",
[],
[Element("bottom", [Attribute("label", "Another bottom")], [])],
),
],
),
),
),
# Build the project
rebar3 compile
# Run the eunit tests
rebar3 eunit
# Run the Erlang REPL
rebar3 shell