The goal of this exercise is to teach students how to use elm/parser
, and to state that this is the idiomatic way of parsing in Elm.
- Understand parser pipelines
- Parsers: Parser, run
- Building blocks: int, keyword, symbol, end
- Pipelines: succeed, (|=), (|.), andThen, problem
- Branches: oneOf, map
- Loops: sequence
- Whitespace: spaces
- Chompers: getChompedString, chompWhile
- Understand backtracking
- Understand tracking context
- Parser.advanced
- Parsers with error recovery
- Building blocks: number, variable
- Pipelines: lazy
- Branches: backtrackable, commit, token,
- Loops: loop
- Whitespace: lineComment, multiComment
- Chompers: chompIf, chompUntil, chompUntilEndOr, mapChompedString
- Errors, Indentation, Positions
parsing
: Learn the basics of parsing by processing the menu of Paola's Prestigious Pizza
basics-1
basics-2
booleans
lists
records
result
- [essential]
priceParser
should useint
(instead ofnumber
?) - [essential]
vegetarianParser
should usesymbol
orkeyword
(both are ok) - [essential]
vegetarianParser
should useParser.oneOf
- [essential]
wordParser
should usechompWhile
,getChompedString
, andmap
- [essential]
ingredientsParser
should useoneIngredientParser
- [essential]
pizzaParser
should usewordParser
,vegetarianParser
,ingredientsParser
andpriceParser
- [essential]
menuParser
should usepizzaParser
- [essential]
oneIngredientParser
should usechompWhile
,getChompedString
andandThen
- [actionable]
priceParser
should usesymbol
(more appropriate thankeyword
for €) - [informative]
sequence
should be used anywhere for the sake of learning (instead ofloop
?)