Skip to content

Commit

Permalink
updated tests, ran build
Browse files Browse the repository at this point in the history
  • Loading branch information
ahue committed Feb 18, 2022
1 parent fa33e58 commit 4277077
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 10 deletions.
2 changes: 2 additions & 0 deletions components/prism-cooklang.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
(function (Prism) {

// see https://github.com/cooklang/spec/blob/main/EBNF.md

var single_token_suffix = /(?:(?!\s)[\d$+<=a-zA-Z\x80-\uFFFF])+/.source;
var multi_token_infix = /[^{}@#]+/.source;
var multi_token_suffix = /\{[^}#@]*\}/.source;
Expand Down
2 changes: 1 addition & 1 deletion components/prism-cooklang.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 24 additions & 8 deletions tests/languages/cooklang/ingredient_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
@milk{3|1%L}
@milk{3*L} must not match amount-group
@milk{3|L}
@milk{3%*L} must noch match amount-group
@milk{3%*%L} must noch match amount-group
@milk{3%*L}
@milk{3%*%L}

----------------------------------------------------

Expand Down Expand Up @@ -101,7 +101,13 @@
["ingredient-group", [
["ingredient-keyword", "@"],
["ingredient", "milk"],
"{3*L}"
["amount-group", [
["punctuation", "{"],
["amount", "3"],
["servings-scaler", "*"],
"L",
["punctuation", "}"]
]]
]],
" must not match amount-group\r\n",

Expand All @@ -120,14 +126,24 @@
["ingredient-group", [
["ingredient-keyword", "@"],
["ingredient", "milk"],
"{3%*L}"
["amount-group", [
["punctuation", "{"],
["amount", "3"],
["unit-separator", "%"],
["unit", "*L"],
["punctuation", "}"]
]]
]],
" must noch match amount-group\r\n",

["ingredient-group", [
["ingredient-keyword", "@"],
["ingredient", "milk"],
"{3%*%L}"
]],
" must noch match amount-group"
["amount-group", [
["punctuation", "{"],
["amount", "3"],
["unit-separator", "%"],
["unit", "*%L"],
["punctuation", "}"]
]]
]]
]
16 changes: 15 additions & 1 deletion tests/languages/cooklang/timer_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
["punctuation", "}"]
]]
]],

["timer-group", [
["timer-keyword", "~"],
["timer", "eggs"],
Expand All @@ -28,7 +29,19 @@
["punctuation", "}"]
]]
]],
"\r\n~{abc%minutes} must not match\r\n",

["timer-group", [
["timer-keyword", "~"],
["duration-group", [
["punctuation", "{"],
"abc",
["operator", "%"],
["unit", "minutes"],
["punctuation", "}"]
]]
]],
" must not match\r\n",

["timer-group", [
["timer-keyword", "~"],
["timer", "eggs"],
Expand All @@ -40,6 +53,7 @@
["punctuation", "}"]
]]
]],

["timer-group", [
["timer-keyword", "~"],
["timer", "eggs"],
Expand Down

0 comments on commit 4277077

Please sign in to comment.