forked from cucumber/gherkin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialect.cpp.jq
44 lines (44 loc) · 1.05 KB
/
dialect.cpp.jq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
. as $root |
[
"#include <gherkin/dialect.hpp>\n\n",
"namespace gherkin {\n\n",
"const keywords_maps&\n",
"all_keywords()\n",
"{\n",
" static const keywords_maps kwms = {\n",
" ",
(
[
to_entries[] | .key as $lang | .value |
[
("{\n \"",$lang,"\",\n {\n"),
(" "),
(
[
{
"and", "background", "but", "examples", "feature", "given",
"rule", "scenario", "scenarioOutline", "then", "when"
} | to_entries[] |
[
"{ \"", .key, "\", { ",
(
[.value[] | [@json] | add] | join(", ")
),
" } }"
] | add
] | join(",\n ")
),
("\n }\n }")
] | add
] | join(",\n ")
),
"\n };\n\n",
" return kwms;",
"}\n\n",
"const keywords_map&\n",
"keywords(const std::string_view& language)\n",
"{\n",
" return all_keywords().at(language);\n",
"}\n\n",
"}\n"
] | add