Phase 4: Recipe references + all 4 example file validation
- Fix pRecipeRef to include ./ prefix in stored path - Add recipe reference test - Add parse-validation tests for all 4 example .cook files (EasyPancakes, FriedRice, CoffeeSouffle, OlivierSalad) - All 24 tests passing, all examples parse without error
This commit is contained in:
+2
-1
@@ -131,11 +131,12 @@ pLineBreak = do
|
||||
pRecipeRef :: Parser StepItem
|
||||
pRecipeRef = do
|
||||
_ <- P.char '@'
|
||||
-- Consume @ and store ./ as part of the path
|
||||
_ <- P.char '.'
|
||||
_ <- P.char '/'
|
||||
path <- P.many (P.noneOf "{(\n\\")
|
||||
mqty <- P.optionMaybe (P.between (P.char '{') (P.char '}') pQuantityBody)
|
||||
return (StepRecipeRef (RecipeRef path (join mqty)))
|
||||
return (StepRecipeRef (RecipeRef ("./" <> path) (join mqty)))
|
||||
|
||||
-- | Ingredient: @name{quantity%unit}(preparation)
|
||||
pIngredient :: Parser StepItem
|
||||
|
||||
Reference in New Issue
Block a user