diff --git a/data/test-cases b/data/test-cases index e0feb82..0423552 100644 --- a/data/test-cases +++ b/data/test-cases @@ -26,6 +26,7 @@ saus (tomaat, zout) en water saus (tomaat, zout) en pasta, water p (a, b), q(c) p (a, b (r)), q(c) +p (E123/E124) p: a, b. q: c p: a, b. q: c. p: e123i-E124 diff --git a/lib/food_ingredient_parser/strict/grammar/list.treetop b/lib/food_ingredient_parser/strict/grammar/list.treetop index ff204f1..7abad0a 100644 --- a/lib/food_ingredient_parser/strict/grammar/list.treetop +++ b/lib/food_ingredient_parser/strict/grammar/list.treetop @@ -4,11 +4,17 @@ module FoodIngredientParser::Strict::Grammar include Ingredient rule list - contains:(ingredient ( ws* '|' ws* ingredient )+ ( ws+ and ws+ ingredient )? ) / - contains:(ingredient ( ws* ';' ws* ingredient )+ ( ws+ and ws+ ingredient )? ) / - contains:(ingredient ( ws* ',' ws* ingredient )+ ( ws+ and ws+ ingredient )? ) / - contains:(ingredient ( ws* '.' ws* ingredient )+ ( ws+ and ws+ ingredient )? ) / - contains:(ingredient ( ws+ and ws+ ingredient )? ) + contains:(ingredient ( ws* '|' ws* ingredient )+ ( ws+ and ws+ ingredient )? ) / + contains:(ingredient ( ws* ';' ws* ingredient )+ ( ws+ and ws+ ingredient )? ) / + contains:(ingredient ( ws* ',' ws* ingredient )+ ( ws+ and ws+ ingredient )? ) / + contains:(ingredient ( ws* '.' ws* ingredient )+ ( ws+ and ws+ ingredient )? ) / + list_e_number / + contains:(ingredient ( ws+ and ws+ ingredient )? ) + end + + rule list_e_number + contains:(ingredient_simple_e_number ( ws* '/' ws* ingredient_simple_e_number )+ ) / + contains:(ingredient_simple_e_number ( ws* dash ws* ingredient_simple_e_number )+ ) end end end