modl 0.0.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +15 -0
  3. data/.idea/vcs.xml +6 -0
  4. data/.rspec +3 -0
  5. data/.rubocop.yml +5 -0
  6. data/.travis.yml +7 -0
  7. data/CHANGELOG.md +4 -0
  8. data/CODE_OF_CONDUCT.md +74 -0
  9. data/Gemfile +9 -0
  10. data/LICENSE.txt +21 -0
  11. data/README.md +52 -0
  12. data/Rakefile +6 -0
  13. data/bin/console +14 -0
  14. data/bin/setup +8 -0
  15. data/grammar_tests/1.modl +1 -0
  16. data/grammar_tests/2.modl +1 -0
  17. data/grammar_tests/3.modl +1 -0
  18. data/grammar_tests/a.modl +1 -0
  19. data/grammar_tests/b.modl +1 -0
  20. data/grammar_tests/base_tests.json +996 -0
  21. data/grammar_tests/c.modl +1 -0
  22. data/grammar_tests/demo_config.modl +9 -0
  23. data/grammar_tests/error_tests.json +70 -0
  24. data/grammar_tests/import_config.modl +9 -0
  25. data/grammar_tests/test_import_dir/nested_import1.txt +1 -0
  26. data/grammar_tests/test_import_dir/nested_import2.txt +1 -0
  27. data/grammar_tests/test_import_dir/nested_import3.txt +1 -0
  28. data/grammar_tests/test_import_dir/test_import.txt +9 -0
  29. data/lib/modl/interpreter.rb +10 -0
  30. data/lib/modl/parser/MODLLexer.interp +136 -0
  31. data/lib/modl/parser/MODLLexer.rb +324 -0
  32. data/lib/modl/parser/MODLLexer.tokens +41 -0
  33. data/lib/modl/parser/MODLParser.interp +95 -0
  34. data/lib/modl/parser/MODLParser.rb +2504 -0
  35. data/lib/modl/parser/MODLParser.tokens +41 -0
  36. data/lib/modl/parser/MODLParserBaseListener.rb +164 -0
  37. data/lib/modl/parser/MODLParserBaseVisitor.rb +107 -0
  38. data/lib/modl/parser/MODLParserListener.rb +151 -0
  39. data/lib/modl/parser/MODLParserVisitor.rb +56 -0
  40. data/lib/modl/parser/class_processor.rb +159 -0
  41. data/lib/modl/parser/evaluator.rb +164 -0
  42. data/lib/modl/parser/file_importer.rb +64 -0
  43. data/lib/modl/parser/global_parse_context.rb +249 -0
  44. data/lib/modl/parser/instruction_processor.rb +58 -0
  45. data/lib/modl/parser/interpreter.rb +38 -0
  46. data/lib/modl/parser/modl_class.rb +102 -0
  47. data/lib/modl/parser/modl_index.rb +30 -0
  48. data/lib/modl/parser/modl_keylist.rb +43 -0
  49. data/lib/modl/parser/modl_method.rb +132 -0
  50. data/lib/modl/parser/object_cache.rb +54 -0
  51. data/lib/modl/parser/parsed.rb +1410 -0
  52. data/lib/modl/parser/parser.rb +42 -0
  53. data/lib/modl/parser/ref_processor.rb +139 -0
  54. data/lib/modl/parser/substitutions.rb +67 -0
  55. data/lib/modl/parser/sutil.rb +78 -0
  56. data/lib/modl/parser/throwing_error_listener.rb +20 -0
  57. data/lib/modl/parser/version.rb +5 -0
  58. data/modl.gemspec +32 -0
  59. metadata +138 -11
  60. data/lib/modl.rb +0 -5
@@ -0,0 +1,996 @@
1
+ [
2
+ {
3
+ "input": "*L=grammar_tests/test_import_dir/nested_import1.txt;\nfiles=%*load",
4
+ "minimised_modl": "*L=grammar_tests/test_import_dir/nested_import1.txt;files=%*load",
5
+ "expected_output": "{\"files\":[\"grammar_tests/test_import_dir/nested_import1.txt\",\"grammar_tests/test_import_dir/nested_import2.txt\",\"grammar_tests/test_import_dir/nested_import3.txt\",\"grammar_tests/test_import_dir/test_import.txt\"]}"
6
+ },
7
+ {
8
+ "input": "*L=grammar_tests/1:grammar_tests/2:grammar_tests/3:grammar_tests/1;\nfiles=%*load",
9
+ "minimised_modl": "*L=grammar_tests/1:grammar_tests/2:grammar_tests/3:grammar_tests/1;files=%*load",
10
+ "expected_output": "{\"files\":[\"grammar_tests/1.modl\",\"grammar_tests/2.modl\",\"grammar_tests/3.modl\",\"grammar_tests/1.modl\"]}"
11
+ },
12
+ {
13
+ "input": "*L=\"https://www.modl.uk/tests/message-thread.txt\";\n\nclasses=*class",
14
+ "minimised_modl": "*L=\"https://www.modl.uk/demo/message-thread.txt\";classes=*class",
15
+ "expected_output": "{\"classes\":\"*class\"}"},
16
+ {
17
+ "input": "*L=\"http://modules.num.uk/1.txt\";\n\nclasses=%*class",
18
+ "minimised_modl": "*L=\"http://modules.num.uk/1.txt\";classes=%*class",
19
+ "expected_output": "{\"classes\":\"*class\"}"
20
+ },
21
+ {
22
+ "input": "*method(\n ## The method can be called by it's ID or name\n *id=cn;\n *name=company_name;\n ## The value of the object that the method is called on is transformed using the following methods:\n *transform=`replace(-, ).trim(.).initcap`\n);\n\nm=%*method",
23
+ "minimised_modl": "*m(*i=cn;*n=company_name;*transform=`replace(-, ).trim(.).initcap`);m=%*method",
24
+ "expected_output": "{\"m\":[{\"cn\":{\"name\":\"company_name\",\"transform\":\"replace(-,).trim(.).initcap\"}}]}"
25
+ },
26
+ {
27
+ "input": "*L=\"https://www.modl.uk/tests/message-thread.txt\";\n*class(\n *id=a;\n *name=alpha;\n *superclass=map;\n v=victor\n);\n*class(\n *id=b;\n *name=bravo;\n *superclass=alpha;\n w=whisky\n);\n*class(\n *id=c;\n *name=charlie;\n *superclass=bravo;\n x=xray\n);\n*class(\n *id=d;\n *name=delta;\n *superclass=charlie;\n y=yankee\n);\nclasses=%*class",
28
+ "minimised_modl": "*L=\"https://www.modl.uk/tests/message-thread.txt\";*class(*id=a;*name=alpha;*superclass=map;v=victor)*class(*id=b;*name=bravo;*superclass=alpha;w=whisky);*class(*id=c;*name=charlie;*superclass=bravo;x=xray)*class(*id=d;*name=delta;*superclass=charlie;y=yankee)classes=%*class",
29
+ "expected_output": "{\n \"classes\": [\n {\n \"m\": {\n \"name\": \"message\",\n \"superclass\": \"map\",\n \"assign\": [\n [\n \"direction\",\n \"date_time\",\n \"message\"\n ]\n ],\n \"method\": \"sms\"\n }\n },\n {\n \"a\": {\n \"name\": \"alpha\",\n \"superclass\": \"map\",\n \"v\": \"victor\"\n }\n },\n {\n \"b\": {\n \"name\": \"bravo\",\n \"superclass\": \"alpha\",\n \"w\": \"whisky\"\n }\n },\n {\n \"c\": {\n \"name\": \"charlie\",\n \"superclass\": \"bravo\",\n \"x\": \"xray\"\n }\n },\n {\n \"d\": {\n \"name\": \"delta\",\n \"superclass\": \"charlie\",\n \"y\": \"yankee\"\n }\n }\n ]\n}"
30
+ },
31
+ {
32
+ "input": "_test1=one;\n_one=two;\n{\ntest1=`one`?\n result=match\n/?\n result=nomatch\n}",
33
+ "minimised_modl": "_test1=one;_one=two{test1=`one`?result=match/?result=nomatch}",
34
+ "expected_output": "{\n \"result\": \"match\"\n}"},
35
+ {
36
+ "input": "_test1=one;\n_one=two;\n{\ntest1=`two`?\n result=match\n/?\n result=nomatch\n}",
37
+ "minimised_modl": "_test1=one;_one=two{test1=`two`?result=match/?result=nomatch}",
38
+ "expected_output": "{\n \"result\": \"nomatch\"\n}"},
39
+ {
40
+ "input": "_test1=one;\n_one=two;\n{\ntest1=\"one\"?\n result=match\n/?\n result=nomatch\n}",
41
+ "minimised_modl": "_test1=one;_one=two{test1=\"one\"?result=match/?result=nomatch}",
42
+ "expected_output": "{\n \"result\": \"match\"\n}"},
43
+ {
44
+ "input": "_test1=one;\n_one=two;\n{\ntest1=\"two\"?\n result=match\n/?\n result=nomatch\n}",
45
+ "minimised_modl": "_test1=one;_one=two{test1=\"two\"?result=match/?result=nomatch}",
46
+ "expected_output": "{\n \"result\": \"nomatch\"\n}"},
47
+ {
48
+ "input": "_test1=one;\n_one=two;\n{\ntest1=\"one\"?\n result=match\n/?\n result=nomatch\n}",
49
+ "minimised_modl": "_test1=one;_one=two{test1=`one`?result=match/?result=nomatch}",
50
+ "expected_output": "{\n \"result\": \"match\"\n}"},
51
+ {
52
+ "input": "_x=a:b:c:d;\n_y=[1;2;3;4];\nz={%x.1=b | %y.2=1?}\n",
53
+ "minimised_modl": "_x=a:b:c:d;_y=[1;2;3;4];z={%x.1=b | %y.2=1?}",
54
+ "expected_output": "{\"z\":true}"},
55
+ {
56
+ "input": "_x=a:b:c:d;\n_y=[1;2;3;4];\nz={%x.1=b & %y.2=1?}\n",
57
+ "minimised_modl": "_x=a:b:c:d;_y=[1;2;3;4];z={%x.1=b & %y.2=1?}",
58
+ "expected_output": "{\"z\":false}"},
59
+ {
60
+ "input": "_x=a:b:c:d;\n_y=[1;2;3;4];\nz={%x.1=b&%y.2=3?}",
61
+ "minimised_modl": "_x=a:b:c:d;_y=[1;2;3;4];z={%x.1=b&%y.2=3?}",
62
+ "expected_output": "{\"z\":true}"},
63
+ {
64
+ "input": "_x=a:b:c:d;\n_y=[1;2;3;4];\nz={%x.1=b|%y.2=3?}",
65
+ "minimised_modl": "_x=a:b:c:d;_y=[1;2;3;4];z={%x.1=b|%y.2=3?}",
66
+ "expected_output": "{\"z\":true}"},
67
+ {
68
+ "input": "_x=a:b:c:d;\n_y=[1;2;3;4];\nz={%x.1=b|%y.2=x?}",
69
+ "minimised_modl": "_x=a:b:c:d;_y=[1;2;3;4];z={%x.1=b|%y.2=x?}",
70
+ "expected_output": "{\"z\":true}"},
71
+ {
72
+ "input": "_x=a:b:c:d;\n_y=[1;2;3;4];\nz={%x.1=a|%y.2=3?}",
73
+ "minimised_modl": "_x=a:b:c:d;_y=[1;2;3;4];z={%x.1=a|%y.2=3?}",
74
+ "expected_output": "{\"z\":true}"},
75
+ {
76
+ "input": "_x=a:b:c:d;\n_y=[1;2;3;4];\nx={%x.1=%y.2?}",
77
+ "minimised_modl": "_x=a:b:c:d;_y=[1;2;3;4];x={%x.1=%y.2?}",
78
+ "expected_output": "{\"x\":false}"},
79
+ {
80
+ "input": "_x=[1;2;3;4];\n_y=[1;2;3;4];\nx={%x.2=%y.2?}",
81
+ "minimised_modl": "_x=[1;2;3;4];_y=[1;2;3;4];x={%x.2=%y.2?}",
82
+ "expected_output": "{\"x\":false}"},
83
+ {
84
+ "input": "_country=gb;\n{\n country = gb | country = us?\n support_number=+441270123456\n /?\n support_number=+14161234567\n}",
85
+ "minimised_modl": "_country=gb{country = gb | country = us?support_number=+441270123456/?support_number=+14161234567}",
86
+ "expected_output": "{\n \"support_number\": \"+441270123456\"\n}"},
87
+ {
88
+ "input": "_country=gb;\n{\n country = us | country = gb?\n support_number=+441270123456\n /?\n support_number=+14161234567\n}",
89
+ "minimised_modl": "_country=gb{country = us | country = gb?support_number=+441270123456/?support_number=+14161234567}",
90
+ "expected_output": "{\n \"support_number\": \"+441270123456\"\n}"},
91
+ { "input": "?=a:b:c:d;12%3=1",
92
+ "minimised_modl": "?=a:b:c:d;12%3=1",
93
+ "expected_output": "{\"12d\":1}"},
94
+ { "input": "(name=`e1afmkfd`.p;department=` -7sbcecqbdsccxfizhcp6b8ah`.p)",
95
+ "minimised_modl": "(name=`e1afmkfd`.p;department=` -7sbcecqbdsccxfizhcp6b8ah`.p)",
96
+ "expected_output": "{\n \"name\": \"пример\",\n \"department\": \"обслуживание клиентов\"\n}"},
97
+ { "input": "`80aafnhi4ae`.p.u=`lsa12dvaxki`.p.u",
98
+ "minimised_modl": "`80aafnhi4ae`.p=`lsa12dvaxki`.p",
99
+ "expected_output": "{\n \"НАЗВАНИЕ\":\"БОРИ́С\"\n}"
100
+ },
101
+ {
102
+ "input": "(\n _name = John;\n %name.u = \"Developer\";\n foo = %name.u\n)",
103
+ "minimised_modl": "(_name = John;%name.u = \"Developer\";foo = %name.u)",
104
+ "expected_output": "{\n \"JOHN\" : \"Developer\", \n \"foo\" : \"JOHN\"\n}"},
105
+ {
106
+ "input": "(\n _name = John;\n %name.u = \"Developer\";\n foo = %JOHN\n)",
107
+ "minimised_modl": "(_name=John;%name.u=\"Developer\";foo = %JOHN)",
108
+ "expected_output": "{\n \"JOHN\" : \"Developer\", \n \"foo\" : \"Developer\"\n}"},
109
+ {
110
+ "input": "_array[1;2];\n_array_item=%array.0;\ntest={\n array_item=%array.0?\n yes\n /?\n no\n}",
111
+ "minimised_modl": "_array[1;2];_array_item=%array.0;test={array_item=%array.0?yes/?no}",
112
+ "expected_output": "{\n \"test\": \"yes\"\n}"},
113
+ {
114
+ "input": "_array[1;2];\ntest={\n %array.0=1?\n yes\n /?\n no\n}",
115
+ "minimised_modl": "_array[1;2];test={%array.0=1?yes/?no}",
116
+ "expected_output": "{\n \"test\": \"yes\"\n}"},
117
+ {
118
+ "input": "_array[1;2];\n_array_item=%array.0;\ntest={\n array_item=1?\n yes\n /?\n no\n}",
119
+ "minimised_modl": "_array[1;2];_array_item=%array.0;test={array_item=1?yes/?no}",
120
+ "expected_output": "{\n \"test\": \"yes\"\n}"},
121
+ {
122
+ "input": "_person( \n name(\n speak=say;\n first=John;\n last=Smith\n )\n);\njust `%person.name.speak.u`_this=Hello %person.name.first.d!",
123
+ "minimised_modl": "_person(name(speak=say;first=John;last=Smith));just `%person.name.speak.u`_this=Hello %person.name.first.d!",
124
+ "expected_output": "{\n \"just SAY_this\": \"Hello john!\"\n}"},
125
+ {
126
+ "input": "*class(\n *i=test;\n *a=[\n [one;two;three]\n ]\n);\ntest=1:2:3",
127
+ "minimised_modl": "*class(\n *i=test\n *a=[\n [one;two;three]\n ]\n)\ntest=1:2:3",
128
+ "expected_output": "{\n \"test\": {\n \"one\": 1,\n \"two\": 2,\n \"three\": 3\n }\n}"},
129
+ {
130
+ "input": "*class(\n *i=test;\n *a=[\n [one;two;three]\n ]\n);\n\ntest=1:2:(a=Alpha;b=Bravo;c=Charlie)",
131
+ "minimised_modl": "*class(\n *i=test\n *a=[\n [one;two;three]\n ]\n)\n\ntest=1:2:(a=Alpha;b=Bravo;c=Charlie)",
132
+ "expected_output": "{\n \"test\": {\n \"one\": 1,\n \"two\": 2,\n \"three\": {\n \"a\": \"Alpha\",\n \"b\": \"Bravo\",\n \"c\": \"Charlie\"\n }\n }\n}"},
133
+ {
134
+ "input": "*class(\n *i=test;\n *a=[\n [one;two;three]\n ]\n);\n\ntest=1:2:[a;b;c]",
135
+ "minimised_modl": "*class(\n *i=test\n *a=[\n [one;two;three]\n ]\n)\n\ntest=1:2:[a;b;c]",
136
+ "expected_output": "{\n \"test\": {\n \"one\": 1,\n \"two\": 2,\n \"three\": [\n \"a\",\n \"b\",\n \"c\"\n ]\n }\n}\n"},
137
+ {
138
+ "input": "_name = John;\n%name = \"123\"",
139
+ "minimised_modl": "_name = John;%name = \"123\"",
140
+ "expected_output": "{\"John\":\"123\"}"},
141
+ {"input": "[\none;\ntwo;\nthree;\n]",
142
+ "minimised_modl": "[one;two;three;]",
143
+ "expected_output": "[\"one\",\"two\",\"three\"]"},
144
+ {"input": "[\none;\ntwo;\nthree\n]",
145
+ "minimised_modl": "[one;two;three]",
146
+ "expected_output": "[\"one\",\"two\",\"three\"]"},
147
+ {
148
+ "input": "_country = gb;\nsupport_contact = {\ncountry=gb?\n}",
149
+ "minimised_modl": "_country=gb;support_contact={country=gb?}",
150
+ "expected_output": "{\"support_contact\": true}"},
151
+ {
152
+ "input": " *class(\n *id=a;\n *name=alpha;\n *superclass=map;\n v=victor\n);\n*class(\n *id=b;\n *name=bravo;\n *superclass=alpha;\n w=whisky\n);\n*class(\n *id=c;\n *name=charlie;\n *superclass=bravo;\n x=xray\n);\n*class(\n *id=d;\n *name=delta;\n *superclass=charlie;\n y=yankee\n);\nd(test1=test2)",
153
+ "minimised_modl": "*class(*id=a;*name=alpha;*superclass=map;v=victor)*class(*id=b;*name=bravo;*superclass=alpha;w=whisky)*class(*id=c;*name=charlie;*superclass=bravo;x=xray);*class(*id=d;*name=delta;*superclass=charlie;y=yankee)d(test1=test2)",
154
+ "expected_output": "{\"delta\": {\"test1\": \"test2\",\"y\": \"yankee\",\"x\": \"xray\",\"w\": \"whisky\",\"v\": \"victor\"}}"},
155
+ {
156
+ "input": "*class(\n *id=a;\n *name=alpha;\n *superclass=map;\n v=victor\n);\n*class(\n *id=b;\n *name=bravo;\n *superclass=a;\n w=whisky\n);\n*class(\n *id=c;\n *name=charlie;\n *superclass=b;\n x=xray\n);\n*class(\n *id=d;\n *name=delta;\n *superclass=c;\n y=yankee\n);\nd(test1=test2)",
157
+ "minimised_modl": "*class(*id=a;*name=alpha;*superclass=map;v=victor)*class(*id=b;*name=bravo;*superclass=a;w=whisky)*class(*id=c;*name=charlie;*superclass=b;x=xray)*class(*id=d;*name=delta;*superclass=c;y=yankee)d(test1=test2)",
158
+ "expected_output": "{\"delta\": {\"test1\": \"test2\",\"y\": \"yankee\",\"x\": \"xray\",\"w\": \"whisky\",\"v\": \"victor\"}}"},
159
+ {"input": "_test=[[a;b]];letters2=%test.0.0",
160
+ "minimised_modl": "_test=[[a;b]];letters2=%test.0.0",
161
+ "expected_output": "{\"letters2\": \"a\"}"},
162
+ {"input": "?=`e1afmkfd`:` -7sbcecqbdsccxfizhcp6b8ah`;(name=%0.p;department=%1.p)",
163
+ "minimised_modl": "?=`e1afmkfd`:` -7sbcecqbdsccxfizhcp6b8ah`;(name=%0.p;department=%1.p)",
164
+ "expected_output": "{\"name\":\"пример\",\"department\":\"обслуживание клиентов\"}"
165
+ },
166
+ {"input": "*class(*id=object;*superclass=arr);sales(name=John Smith;telephone=44800 555 555);service(name=Jim Brown;telephone=44800 666 666)",
167
+ "minimised_modl": "*c(*id=object;*superclass=arr);sales(name=John Smith;telephone=44800 555 555);service(name=Jim Brown;telephone=44800 666 666)",
168
+ "expected_output": "[{\"sales\": {\"name\": \"John Smith\",\"telephone\": \"44800 555 555\"}},{\"service\": {\"name\": \"Jim Brown\",\"telephone\": \"44800 666 666\"}}]"
169
+ },
170
+ {
171
+ "input": "*class(\n *id=p;\n *NAME=person\n);\n\np(name=John Smith;dob=01/01/2001)",
172
+ "minimised_modl": "*c(*i=p;*N=person);p(name=John Smith;dob=01/01/2001)",
173
+ "expected_output": "{\n \"person\" : {\n \"name\" : \"John Smith\",\n \"dob\" : \"01/01/2001\"\n }\n}\n"
174
+ },
175
+ {"input": "*class(*id=a;*name=age);a=10",
176
+ "minimised_modl": "*class(*id=a;*name=age);a=10",
177
+ "expected_output": "{\"age\":10}"
178
+ },
179
+ {"input": "*class(*id=a;*name=age;*superclass=num);a=10",
180
+ "minimised_modl": "*class(*id=a;*name=age;*superclass=num);a=10",
181
+ "expected_output": "{\"age\":10}"
182
+ },
183
+ {"input": "*class(*id=a;*name=age;*superclass=str);a=10",
184
+ "minimised_modl": "*class(*id=a;*name=age;*superclass=str);a=10",
185
+ "expected_output": "{\"age\":\"10\"}"
186
+ },
187
+ {"input": "*class(*id=newstr;*superclass=str);*class(*id=a;*name=age;*superclass=newstr);a=10",
188
+ "minimised_modl": "*class(*id=newstr;*superclass=str);*class(*id=a;*name=age;*superclass=newstr);a=10",
189
+ "expected_output": "{\"age\":\"10\"}"
190
+ },
191
+ {"input": "?[[a;b;c]];letters=%0",
192
+ "minimised_modl": "?[[a;b;c]];letters=%0",
193
+ "expected_output": "{\"letters\": [ \"a\", \"b\", \"c\"]}"
194
+ },
195
+ {
196
+ "input": "?=[a;b;c;d]:[1;2;3;4;5];\ntest=%1.0",
197
+ "minimised_modl": "?=[a;b;c;d]:[1;2;3;4;5];test=%1.0",
198
+ "expected_output": "{\n \"test\" : 1\n}\n"
199
+ },
200
+ {"input": "_test=123;object(print_test = %test.test)",
201
+ "minimised_modl": "_test=123;object(print_test = %test.test)",
202
+ "expected_output": "{\"object\":{\"print_test\":\"123.test\"}}"},
203
+ {"input": "?=one:two:three;test1=%0;test2=%1;test3=%2;test4=%3;test5=%4;test6=%5;test7=%6;test8=%7;test9=%8",
204
+ "minimised_modl": "?=one:two:three;test1=%0;test2=%1;test3=%2;test4=%3;test5=%4;test6=%5;test7=%6;test8=%7;test9=%8",
205
+ "expected_output": "[{\"test1\": \"one\"},{\"test2\": \"two\"},{\"test3\": \"three\"},{\"test4\": \"%3\"},{\"test5\": \"%4\"},{\"test6\": \"%5\"},{\"test7\": \"%6\"},{\"test8\": \"%7\"},{\"test9\": \"%8\"}]"},
206
+ {
207
+ "input": "a=1:2:3;b=4:5:6",
208
+ "minimised_modl": "a=1:2:3;b=4:5:6",
209
+ "expected_output": "[ {\n \"a\" : [ 1, 2, 3 ]\n}, {\n \"b\" : [ 4, 5, 6 ]\n} ]"},
210
+ {
211
+ "input": "a=1:2:3;b=4:5:6",
212
+ "minimised_modl": "a=1:2:3;b=4:5:6;",
213
+ "expected_output": "[ {\n \"a\" : [ 1, 2, 3 ]\n}, {\n \"b\" : [ 4, 5, 6 ]\n} ]"},
214
+ {"input": "a=1:2:3;b=4:5:6",
215
+ "minimised_modl": "a=1:2:3;b=4:5:6",
216
+ "expected_output": "[ {\n \"a\" : [ 1, 2, 3 ]\n}, {\n \"b\" : [ 4, 5, 6 ]\n} ]"},
217
+ {"input": "a=1:2:3;\nb=4:5:6",
218
+ "minimised_modl": "a=1:2:3;\nb=4:5:6",
219
+ "expected_output": "[ {\n \"a\" : [ 1, 2, 3 ]\n}, {\n \"b\" : [ 4, 5, 6 ]\n} ]"},
220
+ {
221
+ "input": "a=1:2:3;\nb=4:5:6",
222
+ "minimised_modl": "a=1:2:3\nb=4:5:6",
223
+ "expected_output": "[ {\n \"a\" : [ 1, 2, 3 ]\n}, {\n \"b\" : [ 4, 5, 6 ]\n} ]"},
224
+ {
225
+ "input": "a=1:2:3\n;\nb=4:5:6",
226
+ "minimised_modl": "a=1:2:3\n;\nb=4:5:6",
227
+ "expected_output": "[ {\n \"a\" : [ 1, 2, 3 ]\n}, {\n\"b\" : [ 4, 5, 6 ]\n} ]"},
228
+ {
229
+ "input": "_test=(a=b=c=d=f);\nx=%test.a.b.c.d",
230
+ "minimised_modl": "_test=(a=b=c=d=f)\nx=%test.a.b.c.d",
231
+ "expected_output": "{\"x\":\"f\"}"},
232
+ {
233
+ "input": "a(b(c(d(e(f=1)))));\ntesting=%a.b.c.d.e.f",
234
+ "minimised_modl": "a(b(c(d(e(f=1)))))\ntesting=%a.b.c.d.e.f",
235
+ "expected_output": "[ {\"a\" : {\"b\" : {\"c\" : {\"d\" : {\"e\" : {\"f\" : 1}}}}}}, {\"testing\":1}]"},
236
+ {
237
+ "input": "_test=(a=b=c=d=f);\ntesting=%test.a.b.c.d",
238
+ "minimised_modl": "_test=(a=b=c=d=f)\ntesting=%test.a.b.c.d",
239
+ "expected_output": "{\"testing\":\"f\"}"},
240
+ {
241
+ "input": "a=\nb\n=c;\nd=e",
242
+ "minimised_modl": "a=\nb\n=c\nd=e",
243
+ "expected_output": "[ {\"a\" : {\"b\" : \"c\"}}, {\"d\" : \"e\"} ]"},
244
+ {"input": "test=this is a #hashtag test;test2=#testing 123",
245
+ "minimised_modl": "test=this is a #hashtag test;test2=#testing 123",
246
+ "expected_output": "[ {\"test\" : \"this is a #hashtag test\"}, {\"test2\" : \"#testing 123\"} ]"},
247
+ {"input": "a=(b=c=d=e=f)",
248
+ "minimised_modl": "a=(b=c=d=e=f)",
249
+ "expected_output": "{\"a\": {\"b\": {\"c\": {\"d\": {\"e\": \"f\"}}}}}"},
250
+ {"input": "a=b=c=d=e=f",
251
+ "minimised_modl": "a=b=c=d=e=f",
252
+ "expected_output": "{\"a\": {\"b\": {\"c\": {\"d\": {\"e\": \"f\"}}}}}"},
253
+ {"input": "a=(b=(c=(d=(e=f))))",
254
+ "minimised_modl": "a=(b=(c=(d=(e=f))))",
255
+ "expected_output": "{\"a\": {\"b\": {\"c\": {\"d\": {\"e\": \"f\"}}}}}"},
256
+ {
257
+ "input": "country=gb;\nx=[{ country=gb ? this /country=us? that }]",
258
+ "minimised_modl": "country=gb;x=[{ country=gb? this /country=us? that }]",
259
+ "expected_output": "[{\"country\" : \"gb\"}, { \"x\" : [ \"this\" ]}]"},
260
+ {"input": "_a=3;_b=3;c={a=b?true/?false}",
261
+ "minimised_modl": "_a=3;_b=3;c={a=b?true/?false}",
262
+ "expected_output": "{\"c\": true}"},
263
+ {"input": "a=1;b=2;b={{a=1}|{b=2}?true/?false}",
264
+ "minimised_modl": "a=1;b=2;b={{a=1}|{b=2}?true/?false}",
265
+ "expected_output": "[{\"a\": 1},{\"b\": 2},{\"b\": true}]"},
266
+ {
267
+ "input": "_a=1;\n_b=2;\nx={a=b?}",
268
+ "minimised_modl": "_a=1;_b=2;x={a=b?}",
269
+ "expected_output": "{\"x\":false}"},
270
+ {
271
+ "input": "_a=1;\n_b=1;\nx={a=b?}",
272
+ "minimised_modl": "_a=1;_b=1;x={a=b?}",
273
+ "expected_output": "{\"x\":true}"},
274
+ {
275
+ "input": "_testing = quick-test of John's variable_methods;\nupcase_example = %testing.u;\ndowncase_example = %testing.d;\ninitcap_example = %testing.i;\nsentence_example = %testing.s;\nurl_encode_example = %testing.u.e",
276
+ "minimised_modl": "_testing=quick-test of John's variable_methods;upcase_example=%testing.u;downcase_example=%testing.d;initcap_example=%testing.i;sentence_example=%testing.s;url_encode_example=%testing.u.e",
277
+ "expected_output": "[ {\n \"upcase_example\" : \"QUICK-TEST OF JOHN'S VARIABLE_METHODS\"\n}, {\n \"downcase_example\" : \"quick-test of john's variable_methods\"\n}, {\n \"initcap_example\" : \"Quick-test Of John's Variable_methods\"\n}, {\n \"sentence_example\" : \"Quick-test of John's variable_methods\"\n}, {\n \"url_encode_example\" : \"QUICK-TEST+OF+JOHN%27S+VARIABLE_METHODS\"\n} ]"
278
+ }, {
279
+ "input": "*VERSION=1;\n\"test\"=1",
280
+ "minimised_modl": "*VERSION=1;test=1",
281
+ "expected_output": "{\"test\" : 1}"
282
+ }, {
283
+ "input": "*VERSION=100;\n\"test\"=1",
284
+ "minimised_modl": "*VERSION=100;test=1",
285
+ "expected_output": "{\"test\" : 1}"
286
+ },{
287
+ "input": "*class(\n *id=g;\n *name=glossary;\n *superclass=map\n);\n*class(\n *id=t;\n *name=title;\n *superclass=str\n);\n*class(\n *id=d;\n *name=GlossDiv;\n *superclass=map\n);\n*class(\n *id=l;\n *name=GlossList;\n *superclass=map\n);\n*class(\n *id=e;\n *name=GlossEntry;\n *superclass=map;\n *assign[\n [i;s;gt;a;ab;gd;gs]\n ]\n);\n*class(\n *id=i;\n *name=ID;\n *superclass=str\n);\n*class(\n *id=s;\n *name=SortAs;\n *superclass=str\n);\n*class(\n *id=gt;\n *name=GlossTerm;\n *superclass=str\n);\n*class(\n *id=a;\n *name=Acronym;\n *superclass=str\n);\n*class(\n *id=ab;\n *name=Abbrev;\n *superclass=str\n);\n*class(\n *id=gd;\n *name=GlossDef;\n *superclass=map;\n *assign=[\n [p];\n [p;sa]\n ]\n);\n*class(\n *id=p;\n *name=para;\n *superclass=str\n);\n*class(\n *id=sa;\n *name=SeeAlso;\n *superclass=arr\n);\n*class(\n *id=gs;\n *name=GlossSee;\n *superclass=str\n);\n\ng(\n ?=[SGML;markup;language];\n t=example glossary;\n d(\n t=S;\n l(\n e(\n i=%0;\n s=%0;\n gt=Standard Generalized %1.s %2.s;\n a=%0;\n ab=ISO 8879\\:1986;\n gd=A meta-%1 %2, used to create %1 %2s such as DocBook.\n :[GML;XML];\n gs=%1\n )\n )\n )\n)",
288
+ "minimised_modl": "*c(*i=g;*n=glossary;*s=map);*c(*i=t;*n=title;*s=str);*c(*i=d;*n=GlossDiv;*s=map);*c(*i=l;*n=GlossList;*s=map);*c(*i=e;*n=GlossEntry;*s=map;*a[[i;s;gt;a;ab;gd;gs]]);*c(*i=i;*n=ID;*s=str);*c(*i=s;*n=SortAs;*s=str);*c(*i=gt;*n=GlossTerm;*s=str);*c(*i=a;*n=Acronym;*s=str);*c(*i=ab;*n=Abbrev;*s=str);*c(*i=gd;*n=GlossDef;*s=map;*a=[p]:[p;sa]);*c(*i=p;*n=para;*s=str);*c(*i=sa;*n=SeeAlso;*s=arr);*c(*i=gs;*n=GlossSee;*s=str);g(?=SGML:markup:language;t=example glossary;d(t=S;l(e(i=%0;s=%0;gt=Standard Generalized %1.s %2.s;a=%0;ab=ISO 8879~:1986;gd=A meta-%1 %2, used to create %1 %2s such as DocBook.:[GML;XML];gs=%1))))",
289
+ "expected_output": "{\n \"glossary\" : {\n \"title\" : \"example glossary\",\n \"GlossDiv\" : {\n \"title\" : \"S\",\n \"GlossList\" : {\n \"GlossEntry\" : {\n \"ID\" : \"SGML\",\n \"SortAs\" : \"SGML\",\n \"GlossTerm\" : \"Standard Generalized Markup Language\",\n \"Acronym\" : \"SGML\",\n \"Abbrev\" : \"ISO 8879:1986\",\n \"GlossDef\" : {\n \"para\" : \"A meta-markup language, used to create markup languages such as DocBook.\",\n \"SeeAlso\" : [ \"GML\", \"XML\" ]\n },\n \"GlossSee\" : \"markup\"\n }\n }\n }\n }\n}\n"
290
+ }, {
291
+ "input": "_test=1~:2;\n\nresult={\n test=1~:2?\n yes\n /?\n no\n}",
292
+ "minimised_modl": "_test=1~:2;result={test=1~:2?yes/?no}",
293
+ "expected_output": "{\n \"result\" : \"yes\"\n}\n"
294
+ }, {
295
+ "input": "_test=\"http://www.tesco.com\";\n\nresult={\n test=\"http://www.tesco.com\"?\n yes\n /?\n no\n}",
296
+ "minimised_modl": "_test=http~://www.tesco.com;result={test=\"http://www.tesco.com\"?yes/?no}",
297
+ "expected_output": "{\n \"result\" : \"yes\"\n}\n"
298
+ }, {
299
+ "input": "_test=\"http://www.tesco.com\";\n\nresult={\n test=\"http://www.tesco.com\"?\n yes\n /?\n no\n}",
300
+ "minimised_modl": "_test=http~://www.tesco.com;result={test=\"http://www.tesco.com\"?yes/?no}",
301
+ "expected_output": "{\n \"result\" : \"yes\"\n}\n"
302
+ }, {
303
+ "input": "_branch=\"alex.\";_root=d;namespace=`%branch`blah.`%root`",
304
+ "minimised_modl": "_branch=alex.;_root=d;namespace=`%branch`blah.`%root`",
305
+ "expected_output": "{\n \"namespace\" : \"alex.blah.d\"\n}\n"
306
+ }, {
307
+ "input": "namespace=`%branch`blah.`%root`",
308
+ "minimised_modl": "namespace=`%branch`blah.`%root`",
309
+ "expected_output": "{\n \"namespace\" : \"%branchblah.%root\"\n}\n"
310
+ }, {
311
+ "input": "_root=tesco.com;\n_branch=direct.;\nnamespace1=`%branch`numrecord.`%root`;\nnamespace2=`%branch`_`%root`.numq.net",
312
+ "minimised_modl": "_root=tesco.com;_branch=direct.;namespace1=`%branch`numrecord.`%root`;namespace2=`%branch`_`%root`.numq.net",
313
+ "expected_output": "[ {\n \"namespace1\" : \"direct.numrecord.tesco.com\"\n}, {\n \"namespace2\" : \"direct._tesco.com.numq.net\"\n} ]\n"
314
+ }, {
315
+ "input": "_branch=\"\";\n_root=\"\";\nnamespace=`%branch`numrecord.`%root`",
316
+ "minimised_modl": "_branch=\"\";_root=\"\";namespace=`%branch`numrecord.`%root`",
317
+ "expected_output": "{\n \"namespace\" : \"numrecord.\"\n}\n"
318
+ }, {
319
+ "input": "*class(\n *id=desc;\n *name=description;\n *superclass=str\n);\n\n*class(\n *id=val;\n *name=value;\n *superclass=str\n);\n\n*class(\n *id=media1;\n *name=media1;\n *superclass=map;\n *assign=[\n [desc;val]\n ]\n);\n\n*class(\n *id=media2;\n *name=media2;\n *superclass=map;\n *assign=[\n [desc;val]\n ]\n);\n*class(\n *id=list;\n *name=list;\n *superclass=map;\n *assign[\n [media1;media2]\n ]\n);\n\n\nlist=[tel;fb]:[yt;tw]",
320
+ "minimised_modl": "*c(*i=desc;*n=description;*s=str);*c(*i=val;*n=value;*s=str);*c(*i=media1;*n=media1;*s=map;*a[[desc;val]]);*c(*i=media2;*n=media2;*s=map;*a[[desc;val]]);*c(*i=list;*n=list;*s=map;*a[[media1;media2]]);list=[tel;fb]:[yt;tw]",
321
+ "expected_output": "{\n \"list\" : {\n \"media1\" : {\n \"description\" : \"tel\",\n \"value\" : \"fb\"\n },\n \"media2\" : {\n \"description\" : \"yt\",\n \"value\" : \"tw\"\n }\n }\n}\n"
322
+ }, {
323
+ "input": "*CLASS(\n *id=p;\n *name=person;\n *SUPERCLASS=map\n);\n\np(name=John Smith;dob=01/01/2000)",
324
+ "minimised_modl": "*C(*i=p;*n=person;*S=map);p(name=John Smith;dob=01/01/2000)",
325
+ "expected_output": "{\n \"person\" : {\n \"name\" : \"John Smith\",\n \"dob\" : \"01/01/2000\"\n }\n}\n"
326
+ }, {
327
+ "input": "*c(\n *i=m;\n *n=message;\n *S=map;\n *a=[\n [direction;date_time;message]\n ];\n method=sms\n);\nm=in:2018-03-22:hi",
328
+ "minimised_modl": "*c(*i=m;*n=message;*S=map;*a[[direction;date_time;message]];method=sms);m=in:2018-03-22:hi",
329
+ "expected_output": "{\n \"message\" : {\n \"direction\" : \"in\",\n \"date_time\" : \"2018-03-22\",\n \"message\" : \"hi\",\n \"method\" : \"sms\"\n }\n}\n"
330
+ }, {
331
+ "input": "*class(\n *id=car;\n *name=car;\n *superclass=map\n);\n\ncar(\n make=Bentley\n)",
332
+ "minimised_modl": "*c(*i=car;*n=car;*s=map);car(make=Bentley)",
333
+ "expected_output": "{\n \"car\" : {\n \"make\" : \"Bentley\"\n }\n}\n"
334
+ }, {
335
+ "input": "?=[one;two];\ntest=Blah `%0.s` %1.s",
336
+ "minimised_modl": "?=one:two;test=Blah `%0.s` %1.s",
337
+ "expected_output": "{\n \"test\" : \"Blah One Two\"\n}\n"
338
+ }, {
339
+ "input": "?=one:two;\ntest=Blah `%0.r(o,huzzah)` `%1.t(w)`",
340
+ "minimised_modl": "?=one:two;test=Blah `%0.r(o,huzzah)` `%1.t(w)`",
341
+ "expected_output": "{\n \"test\" : \"Blah huzzahne t\"\n}\n"
342
+ }, {
343
+ "input": "_test=\"123\";\nobject(\n print_test = %test.test\n)",
344
+ "minimised_modl": "_test=\"123\";object(print_test=%test.test)",
345
+ "expected_output": "{\n \"object\" : {\n \"print_test\" : \"123.test\"\n }\n}\n"
346
+ }, {
347
+ "input": "_var = NotThisOne;_var=`%var`blah;out=`%var`deblah",
348
+ "minimised_modl": "_var=NotThisOne;_var=`%var`blah;out=`%var`deblah",
349
+ "expected_output": "{\n \"out\" : \"NotThisOneblahdeblah\"\n}\n"
350
+ }, {
351
+ "input": "_var = NotThisOne;_var=blah;out=`%var`deblah",
352
+ "minimised_modl": "_var=NotThisOne;_var=blah;out=`%var`deblah",
353
+ "expected_output": "{\n \"out\" : \"blahdeblah\"\n}\n"
354
+ }, {
355
+ "input": "test(\n map(\n array[]\n );\n array[\n map();\n array[1;2;3]\n ]\n)",
356
+ "minimised_modl": "test(map(array[]);array[map();array=1:2:3])",
357
+ "expected_output": "{\n \"test\" : {\n \"map\" : {\n \"array\" : [ ]\n },\n \"array\" : [ {\n \"map\" : { }\n }, {\n \"array\" : [ 1, 2, 3 ]\n } ]\n }\n}\n"
358
+ }, {
359
+ "input": "{\n01?\n test=1\n}",
360
+ "minimised_modl": "{01?test=1}",
361
+ "expected_output": "{\n \"test\" : 1\n}\n"
362
+ }, {
363
+ "input": "test=()",
364
+ "minimised_modl": "test()",
365
+ "expected_output": "{\n \"test\" : { }\n}\n"
366
+ }, {
367
+ "input": "_co=at;\n_l=de;\n{\n co=at?\n country=Austria\n language={\n l=fr?\n French\n /l=de?\n German\n /?\n Other\n }\n /?\n country=Other\n}",
368
+ "minimised_modl": "_co=at;_l=de;{co=at?country=Austria;language={l=fr?French/l=de?German/?Other}/?country=Other}",
369
+ "expected_output": "[ {\n \"country\" : \"Austria\"\n}, {\n \"language\" : \"German\"\n} ]\n"
370
+ }, {
371
+ "input": "true2 = 01;\ntrue1 = true;\nfalse2 = 00;\nfalse1 = false;\nnull2 = 000;\nnull1 = null",
372
+ "minimised_modl": "true2=01;true1=01;false2=00;false1=00;null2=000;null1=000",
373
+ "expected_output": "[ {\n \"true2\" : true\n}, {\n \"true1\" : true\n}, {\n \"false2\" : false\n}, {\n \"false1\" : false\n}, {\n \"null2\" : null\n}, {\n \"null1\" : null\n} ]\n"
374
+ }, {
375
+ "input": "_person( \n name(\n first=John;\n last=Smith\n )\n);\nsay=%person.name.first",
376
+ "minimised_modl": "_person(name(first=John;last=Smith));say=%person.name.first",
377
+ "expected_output": "{\"say\":\"John\"}"
378
+ }, {
379
+ "input": "_person( \n name(\n first=John;\n last=Smith\n )\n);\nsay=%person.name.first",
380
+ "minimised_modl": "_person(name(first=John;last=Smith));say=%person.name.first",
381
+ "expected_output": "{\n \"say\" : \"John\"\n}\n"
382
+ }, {
383
+ "input": "_C=gb;\n_COUNTRIES(\n us=United States;\n gb=United Kingdom;\n de=Germany\n);\n\ncountry_name = %COUNTRIES.%C",
384
+ "minimised_modl": "_C=gb;_COUNTRIES(us=United States;gb=United Kingdom;de=Germany);country_name=%COUNTRIES.%C",
385
+ "expected_output": "{\n \"country_name\" : \"United Kingdom\"\n}\n"
386
+ }, {
387
+ "input": "*class(\n *id=car;\n *name=car;\n *superclass=map;\n *assign=[\n [m];\n [m;md]\n ]\n);\n\n_C=gb;\n\ncar=Bentley:{C=ru?ContinentalRussia GT/?Continental GT}",
388
+ "minimised_modl": "*c(*i=car;*n=car;*s=map;*a=[m]:[m;md]);_C=gb;car=Bentley:{C=ru?ContinentalRussia GT/?Continental GT}",
389
+ "expected_output": "{\n \"car\" : {\n \"m\" : \"Bentley\",\n \"md\" : \"Continental GT\"\n }\n}\n"
390
+ }, {
391
+ "input": "_person( \n name(\n first=\"John\"\n )\n);\na=%person.name.first",
392
+ "minimised_modl": "_person(name(first=John));a=%person.name.first",
393
+ "expected_output": "{\n \"a\" : \"John\"\n}\n"
394
+ }, {
395
+ "input": "?=[a;b;c;d]:[1;2;3;4;5];\ntest=%1",
396
+ "minimised_modl": "?=[a;b;c;d]:[1;2;3;4;5];test=%1",
397
+ "expected_output": "{\n \"test\" : [ 1, 2, 3, 4, 5 ]\n}\n"
398
+ }, {
399
+ "input": "_test=123;\nprint=%_test",
400
+ "minimised_modl": "_test=123;print=%_test",
401
+ "expected_output": "{\n \"print\" : 123\n}\n"
402
+ }, {
403
+ "input": "_test=abc;\n\n{\n test?\n result=test is defined\n /?\n result=test is not defined\n}",
404
+ "minimised_modl": "_test=abc;{test?result=test is defined/?result=test is not defined}",
405
+ "expected_output": "{\n \"result\" : \"test is defined\"\n}\n"
406
+ }, {
407
+ "input": "{\n true?\n result=true\n}\n",
408
+ "minimised_modl": "{01?result=01}",
409
+ "expected_output": "{\n \"result\" : true\n}\n"
410
+ }, {
411
+ "input": "_test=true;\n\n{\n test?\n result=%test\n}\n",
412
+ "minimised_modl": "_test=01;{test?result=%test}",
413
+ "expected_output": "{\n \"result\" : true\n}\n"
414
+ }, {
415
+ "input": "_test=false;\n\n{\n test?\n result=result is true\n /?\n result=result is false\n}",
416
+ "minimised_modl": "_test=00;{test?result=result is true/?result=result is false}",
417
+ "expected_output": "{\n \"result\" : \"result is false\"\n}\n"
418
+ }, {
419
+ "input": "{\n test?\n result=test is defined\n /?\n result=test is not defined\n}\n",
420
+ "minimised_modl": "{test?result=test is defined/?result=test is not defined}",
421
+ "expected_output": "{\n \"result\" : \"test is not defined\"\n}\n"
422
+ }, {
423
+ "input": "{\n !test?\n result=test is not defined\n /?\n result=test is defined\n}\n",
424
+ "minimised_modl": "{!test?result=test is not defined/?result=test is defined}",
425
+ "expected_output": "{\n \"result\" : \"test is not defined\"\n}\n"
426
+ }, {
427
+ "input": "_colour = green;\n_test = { colour=green? true /? false }; \n\n{\n !test?\n result=it's not green\n /?\n result=it's green\n}",
428
+ "minimised_modl": "_colour=green;_test={colour=green?01/?00};{!test?result=it's not green/?result=it's green}",
429
+ "expected_output": "{\n \"result\" : \"it's green\"\n}\n"
430
+ }, {
431
+ "input": "_test=1;\nresult={\n %test=1?\n yes\n /?\n no\n}",
432
+ "minimised_modl": "_test=1;result={%test=1?yes/?no}",
433
+ "expected_output": "{\n \"result\" : \"yes\"\n}\n"
434
+ }, {
435
+ "input": "_test=1;\nresult={\n test=1?\n yes\n /?\n no\n}",
436
+ "minimised_modl": "_test=1;result={test=1?yes/?no}",
437
+ "expected_output": "{\n \"result\" : \"yes\"\n}\n"
438
+ }, {
439
+ "input": "_test=1;\nresult={\n _test=1?\n yes\n /?\n no\n}",
440
+ "minimised_modl": "_test=1;result={_test=1?yes/?no}",
441
+ "expected_output": "{\n \"result\" : \"yes\"\n}\n"
442
+ }, {
443
+ "input": "_test=1;\nresult={\n %_test=1?\n yes\n /?\n no\n}",
444
+ "minimised_modl": "_test=1;result={%_test=1?yes/?no}",
445
+ "expected_output": "{\n \"result\" : \"yes\"\n}\n"
446
+ }, {
447
+ "input": "?[[a;b;c];[one;two;three]];letters=%0;numbers=%1",
448
+ "minimised_modl": "?=[a;b;c]:[one;two;three];letters=%0;numbers=%1",
449
+ "expected_output": "[ {\n \"letters\" : [ \"a\", \"b\", \"c\" ]\n}, {\n \"numbers\" : [ \"one\", \"two\", \"three\" ]\n} ]\n"
450
+ }, {
451
+ "input": "?=[a;b;c]:[one;two;three];letters=%0;numbers=%1",
452
+ "minimised_modl": "?=[a;b;c]:[one;two;three];letters=%0;numbers=%1",
453
+ "expected_output": "[ {\n \"letters\" : [ \"a\", \"b\", \"c\" ]\n}, {\n \"numbers\" : [ \"one\", \"two\", \"three\" ]\n} ]\n"
454
+ }, {
455
+ "input": "?[a;b;c];letters=%0",
456
+ "minimised_modl": "?=a:b:c;letters=%0",
457
+ "expected_output": "{\n \"letters\" : \"a\"\n}\n"
458
+ }, {
459
+ "input": "?=[a;b;c]:[one;two;three];letters=%0;numbers=%1",
460
+ "minimised_modl": "?=[a;b;c]:[one;two;three];letters=%0;numbers=%1",
461
+ "expected_output": "[ {\n \"letters\" : [ \"a\", \"b\", \"c\" ]\n}, {\n \"numbers\" : [ \"one\", \"two\", \"three\" ]\n} ]\n"
462
+ }, {
463
+ "input": "test=[zero;one]:[a;b]",
464
+ "minimised_modl": "test=[zero;one]:[a;b]",
465
+ "expected_output": "{\n \"test\" : [ [ \"zero\", \"one\" ], [ \"a\", \"b\" ] ]\n}\n"
466
+ }, {
467
+ "input": "test=[zero;one]:[a;b]",
468
+ "minimised_modl": "test=[zero;one]:[a;b]",
469
+ "expected_output": "{\n \"test\" : [ [ \"zero\", \"one\" ], [ \"a\", \"b\" ] ]\n}\n"
470
+ }, {
471
+ "input": "?[zero;one;two];\nfirst_var=%0;\nsecond_var=%1;\nthird_var=%2",
472
+ "minimised_modl": "?=zero:one:two;first_var=%0;second_var=%1;third_var=%2",
473
+ "expected_output": "[ {\n \"first_var\" : \"zero\"\n}, {\n \"second_var\" : \"one\"\n}, {\n \"third_var\" : \"two\"\n} ]\n"
474
+ }, {
475
+ "input": "_C=gb;\no(\n{C=gb?test1=123};\ntest2=456\n)",
476
+ "minimised_modl": "_C=gb;o({C=gb?test1=123};test2=456)",
477
+ "expected_output": "{\n \"o\" : {\n \"test1\" : 123,\n \"test2\" : 456\n }\n}\n"
478
+ }, {
479
+ "input": "{\ntrue?\n test=1\n}",
480
+ "minimised_modl": "{01?test=1}",
481
+ "expected_output": "{\n \"test\" : 1\n}\n"
482
+ }, {
483
+ "input": "_test[a;b;c];alex=%test",
484
+ "minimised_modl": "_test=a:b:c;alex=%test",
485
+ "expected_output": "{\n \"alex\" : [ \"a\", \"b\", \"c\" ]\n}\n"
486
+ }, {
487
+ "input": "_test[a;b;c];alex=%test.0",
488
+ "minimised_modl": "_test=a:b:c;alex=%test.0",
489
+ "expected_output": "{\n \"alex\" : \"a\"\n}\n"
490
+ }, {
491
+ "input": "?[a;b;c];alex=%0",
492
+ "minimised_modl": "?=a:b:c;alex=%0",
493
+ "expected_output": "{\n \"alex\" : \"a\"\n}\n"
494
+ }, {
495
+ "input": "_bool=true;\n{\n%bool?\n test=1\n}",
496
+ "minimised_modl": "_bool=01;{%bool?test=1}",
497
+ "expected_output": "{\n \"test\" : 1\n}\n"
498
+ }, {
499
+ "input": "_co = gb;\ntest = {\n co = gb?\n UK\n /?\n Other\n}",
500
+ "minimised_modl": "_co=gb;test={co=gb?UK/?Other}",
501
+ "expected_output": "{\n \"test\" : \"UK\"\n}\n"
502
+ }, {
503
+ "input": "?=0:1:2;\nresult={\n%1>1?\n yes\n/?\n no\n}",
504
+ "minimised_modl": "?=0:1:2;result={%1>1?yes/?no}",
505
+ "expected_output": "{\n \"result\" : \"no\"\n}\n"
506
+ }, {
507
+ "input": "_test_vars(\n one = 1;\n two = 2\n);\n\nfirst_number = %test_vars.one",
508
+ "minimised_modl": "_test_vars(one=1;two=2);first_number=%test_vars.one",
509
+ "expected_output": "{\n \"first_number\" : 1\n}\n"
510
+ }, {
511
+ "input": "_C=gb;\n_COUNTRIES[\n United States;\n United Kingdom;\n Germany\n];\n\ncountry_name = %COUNTRIES.0",
512
+ "minimised_modl": "_C=gb;_COUNTRIES=United States:United Kingdom:Germany;country_name=%COUNTRIES.0",
513
+ "expected_output": "{\n \"country_name\" : \"United States\"\n}\n"
514
+ }, {
515
+ "input": "(_C=gb;\n{C=gb?test1=123};\ntest2=456)",
516
+ "minimised_modl": "(_C=gb;{C=gb?test1=123};test2=456)",
517
+ "expected_output": "{\n \"test1\" : 123,\n \"test2\" : 456\n}\n"
518
+ }, {
519
+ "input": "alex=1.2345",
520
+ "minimised_modl": "alex=1.2345",
521
+ "expected_output": "{\n \"alex\" : 1.2345\n}\n"
522
+ }, {
523
+ "input": "?=zero:one:two;\ndiscount=%30",
524
+ "minimised_modl": "?=zero:one:two;discount=%30",
525
+ "expected_output": "{\n \"discount\" : \"%30\"\n}\n"
526
+ }, {
527
+ "input": "{\ntrue?\n test=1\n}",
528
+ "minimised_modl": "{01?test=1}",
529
+ "expected_output": "{\n \"test\" : 1\n}\n"
530
+ }, {
531
+ "input": "{\nTRUE?\n test=1\n}",
532
+ "minimised_modl": "{01?test=1}",
533
+ "expected_output": "{\n \"test\" : 1\n}\n"
534
+ }, {
535
+ "input": "_test=abcdefg;\nresult={\n {test!=a*}?\n in\n /?\n out\n}",
536
+ "minimised_modl": "_test=abcdefg;result={{test!=a*}?in/?out}",
537
+ "expected_output": "{\n \"result\" : \"out\"\n}\n"
538
+ }, {
539
+ "input": "test=[]",
540
+ "minimised_modl": "test[]",
541
+ "expected_output": "{\n \"test\" : [ ]\n}\n"
542
+ }, {
543
+ "input": "test(\n empty_array=[];\n empty_map=()\n)\n",
544
+ "minimised_modl": "test(empty_array[];empty_map())",
545
+ "expected_output": "{\n \"test\" : {\n \"empty_array\" : [ ],\n \"empty_map\" : { }\n }\n}\n"
546
+ }, {
547
+ "input": "_num1 = 2;\n_num2 = 1000;\n\nresult={\n num1>num2?\n num1 is bigger\n /?\n num1 is not bigger\n}\n",
548
+ "minimised_modl": "_num1=2;_num2=1000;result={num1>num2?num1 is bigger/?num1 is not bigger}",
549
+ "expected_output": "{\n \"result\" : \"num1 is not bigger\"\n}\n"
550
+ }, {
551
+ "input": "?=0:1:2;\nzero=%0;\none=%1;\ntwo=%2",
552
+ "minimised_modl": "?=0:1:2;zero=%0;one=%1;two=%2",
553
+ "expected_output": "[ {\n \"zero\" : 0\n}, {\n \"one\" : 1\n}, {\n \"two\" : 2\n} ]\n"
554
+ }, {
555
+ "input": "?=a:b:c;\nzero=%0;\none=%1;\ntwo=%2\n",
556
+ "minimised_modl": "?=a:b:c;zero=%0;one=%1;two=%2",
557
+ "expected_output": "[ {\n \"zero\" : \"a\"\n}, {\n \"one\" : \"b\"\n}, {\n \"two\" : \"c\"\n} ]\n"
558
+ }, {
559
+ "input": "_num1 = 5;\n_num2 = 2;\n\nresult={\n num1>num2?\n num1 is bigger\n /?\n num1 is not bigger\n}",
560
+ "minimised_modl": "_num1=5;_num2=2;result={num1>num2?num1 is bigger/?num1 is not bigger}",
561
+ "expected_output": "{\n \"result\" : \"num1 is bigger\"\n}\n"
562
+ }, {
563
+ "input": "?=\"A\":B:C;\nfirst_letter=%0",
564
+ "minimised_modl": "?=A:B:C;first_letter=%0",
565
+ "expected_output": "{\n \"first_letter\" : \"A\"\n}\n"
566
+ }, {
567
+ "input": "test=100%",
568
+ "minimised_modl": "test=100%",
569
+ "expected_output": "{\n \"test\" : \"100%\"\n}\n"
570
+ }, {
571
+ "input": "test=`test`",
572
+ "minimised_modl": "test=`test`",
573
+ "expected_output": "{\n \"test\" : \"test\"\n}\n"
574
+ }, {
575
+ "input": "test=\u0021",
576
+ "minimised_modl": "test=\u0021",
577
+ "expected_output": "{\n \"test\" : \"!\"\n}\n"
578
+ }, {
579
+ "input": "test=[zero;one]",
580
+ "minimised_modl": "test=zero:one",
581
+ "expected_output": "{\n \"test\" : [ \"zero\", \"one\" ]\n}\n"
582
+ }, {
583
+ "input": "_C=fr;\n{C=gb?test1=123};\ntest2=456",
584
+ "minimised_modl": "_C=fr;{C=gb?test1=123};test2=456",
585
+ "expected_output": "{\n \"test2\" : 456\n}\n"
586
+ }, {
587
+ "input": "_C=ca;\n_L=en;\n{\n C=ca?\n n=Tesco Canada\n {L=fr?\n s=Chaque Petite Contribution\n }\n}",
588
+ "minimised_modl": "_C=ca;_L=en;{C=ca?n=Tesco Canada;{L=fr?s=Chaque Petite Contribution}}",
589
+ "expected_output": "{\n \"n\" : \"Tesco Canada\"\n}\n"
590
+ }, {
591
+ "input": "_L=en;\n{\n C=ca?\n o(\n n=Tesco Canada;\n s={L=fr?\n Chaque Petite Contribution\n /?\n Every Little Helps\n }\n )\n}",
592
+ "minimised_modl": "_L=en;{C=ca?o(n=Tesco Canada;s={L=fr?Chaque Petite Contribution/?Every Little Helps})}",
593
+ "expected_output": "\n"
594
+ }, {
595
+ "input": "_letter=a;\n{\n letter=a?\n word=Apple\n /letter=b?\n word=Bee\n /?\n word=Other\n}",
596
+ "minimised_modl": "_letter=a;{letter=a?word=Apple/letter=b?word=Bee/?word=Other}",
597
+ "expected_output": "{\n \"word\" : \"Apple\"\n}\n"
598
+ }, {
599
+ "input": "_int=1;\n{\n int=1?\n number=one\n /int=2?\n number=two\n /int=3?\n number=three\n /?\n number=other\n}",
600
+ "minimised_modl": "_int=1;{int=1?number=one/int=2?number=two/int=3?number=three/?number=other}",
601
+ "expected_output": "{\n \"number\" : \"one\"\n}\n"
602
+ }, {
603
+ "input": "_number=one;\n{\n number=one?\n int=1\n /number=two?\n int=2\n /number=three?\n int=3\n}",
604
+ "minimised_modl": "_number=one;{number=one?int=1/number=two?int=2/number=three?int=3}",
605
+ "expected_output": "{\n \"int\" : 1\n}\n"
606
+ }, {
607
+ "input": "_co=gb;\n{\nco=gb?\n country = United Kingdom\n/?\n country = Other\n}",
608
+ "minimised_modl": "_co=gb;{co=gb?country=United Kingdom/?country=Other}",
609
+ "expected_output": "{\n \"country\" : \"United Kingdom\"\n}\n"
610
+ }, {
611
+ "input": "_co=gb;\n{\nco=gb?\n country = United Kingdom\n/?\n country = Other\n}",
612
+ "minimised_modl": "_co=gb;{co=gb?country=United Kingdom/?country=Other}",
613
+ "expected_output": "{\n \"country\" : \"United Kingdom\"\n}\n"
614
+ }, {
615
+ "input": "_co = gb;\ntest = {\n co = gb?\n test=123\n /?\n test\n}",
616
+ "minimised_modl": "_co=gb;test={co=gb?test=123/?test}",
617
+ "expected_output": "{\n \"test\" : {\n \"test\" : 123\n }\n}\n"
618
+ }, {
619
+ "input": "_co = fr;\ntest = {\n co = gb?\n test=123\n /?\n test\n}",
620
+ "minimised_modl": "_co=fr;test={co=gb?test=123/?test}",
621
+ "expected_output": "{\n \"test\" : \"test\"\n}\n"
622
+ }, {
623
+ "input": "_COUNTRY=gb;\ncountry=The country is %COUNTRY",
624
+ "minimised_modl": "_COUNTRY=gb;country=The country is %COUNTRY",
625
+ "expected_output": "{\n \"country\" : \"The country is gb\"\n}\n"
626
+ }, {
627
+ "input": "COUNTRY=gb;\ncountry=The country is %COUNTRY",
628
+ "minimised_modl": "COUNTRY=gb;country=The country is %COUNTRY",
629
+ "expected_output": "[ {\n \"COUNTRY\" : \"gb\"\n}, {\n \"country\" : \"The country is gb\"\n} ]\n"
630
+ }, {
631
+ "input": "_co=gb;\ncountry=The country is %co",
632
+ "minimised_modl": "_co=gb;country=The country is %co",
633
+ "expected_output": "{\n \"country\" : \"The country is gb\"\n}\n"
634
+ }, {
635
+ "input": "_test = 123;\n_test2 = abc",
636
+ "minimised_modl": "_test=123;_test2=abc",
637
+ "expected_output": "\n"
638
+ }, {
639
+ "input": "_co=gb;\ntest=123",
640
+ "minimised_modl": "_co=gb;test=123",
641
+ "expected_output": "{\n \"test\" : 123\n}\n"
642
+ }, {
643
+ "input": "*method(\n ## The method can be called by it's ID or name;\n *id=cn;\n *name=company_name;\n ## The value of the object that the method is called on is transformed using the following methods:\n *transform=`replace(-, ).trim(.).initcap`\n);\n\n_domain = smiths-limited.com;\nfriendly_name = %domain.cn ## The value \"Smiths Limited\" is assigned to the key \"friendly_name\"",
644
+ "minimised_modl": "*m(*i=cn;*n=company_name;*transform=`replace(-, ).trim(.).initcap`);_domain=smiths-limited.com;friendly_name=%domain.cn",
645
+ "expected_output": "{\n \"friendly_name\" : \"Smiths Limited\"\n}\n"
646
+ }, {
647
+ "input": "*method(\n *id=rt;\n *name=remove_two;\n *transform=`replace(two,)`\n);\n\n_numbers = one two three;\nname = %numbers.rt",
648
+ "minimised_modl": "*m(*i=rt;*n=remove_two;*transform=`replace(two,)`);_numbers=one two three;name=%numbers.rt",
649
+ "expected_output": "{\n \"name\" : \"one three\"\n}\n"
650
+ }, {
651
+ "input": "_co=ca;\n_l=fr;\n{\n { co = ca & l = fr } | co = fr?\n support_number=14161234567\n /?\n support_number=441270123456\n}",
652
+ "minimised_modl": "_co=ca;_l=fr;{{co=ca&l=fr}|co=fr?support_number=14161234567/?support_number=441270123456}",
653
+ "expected_output": "{\n \"support_number\" : 14161234567\n}\n"
654
+ }, {
655
+ "input": "_input=\"hi apple ios\";\n{\n {input=*apple*ios*}?\n support_number=441270123456\n /?\n support_number=International Clients:14161234567\n}",
656
+ "minimised_modl": "_input=hi apple ios;{{input=*apple*ios*}?support_number=441270123456/?support_number=International Clients:14161234567}",
657
+ "expected_output": "{\n \"support_number\" : 441270123456\n}\n"
658
+ }, {
659
+ "input": "_input=\"An iOS string\";\n{\n {input=*iOS*}?\n support_number=441270123456\n /?\n support_number=International Clients:14161234567\n}",
660
+ "minimised_modl": "_input=An iOS string;{{input=*iOS*}?support_number=441270123456/?support_number=International Clients:14161234567}",
661
+ "expected_output": "{\n \"support_number\" : 441270123456\n}\n"
662
+ }, {
663
+ "input": "_input=\"An iOS string\";\n{\n !{input=iOS*}?\n support_number=441270123456\n /?\n support_number=International Clients:14161234567\n}",
664
+ "minimised_modl": "_input=An iOS string;{!{input=iOS*}?support_number=441270123456/?support_number=International Clients:14161234567}",
665
+ "expected_output": "{\n \"support_number\" : 441270123456\n}\n"
666
+ }, {
667
+ "input": "_number=42;\n{\n {number>41}?\n support_number=441270123456\n /?\n support_number=International Clients:14161234567\n}",
668
+ "minimised_modl": "_number=42;{{number>41}?support_number=441270123456/?support_number=International Clients:14161234567}",
669
+ "expected_output": "{\n \"support_number\" : 441270123456\n}\n"
670
+ }, {
671
+ "input": "_co=ca;\n{\n co = fr?\n support_number=14161234567\n /?\n support_number=441270123456\n}",
672
+ "minimised_modl": "_co=ca;{co=fr?support_number=14161234567/?support_number=441270123456}",
673
+ "expected_output": "{\n \"support_number\" : 441270123456\n}\n"
674
+ }, {
675
+ "input": "_country=gb;\n{\n country=us/gb/au?\n support_number=441270123456\n /?\n support_number=International Clients:14161234567\n}",
676
+ "minimised_modl": "_country=gb;{country=us/gb/au?support_number=441270123456/?support_number=International Clients:14161234567}",
677
+ "expected_output": "{\n \"support_number\" : 441270123456\n}\n"
678
+ }, {
679
+ "input": "_test=gb;\nresult={test=gb/au?No/?Yes}",
680
+ "minimised_modl": "_test=gb;result={test=gb/au?No/?Yes}",
681
+ "expected_output": "{\n \"result\" : \"No\"\n}\n"
682
+ }, {
683
+ "input": "_number=42;\n{\n !{number>41}?\n support_number=441270123456\n /?\n support_number=International Clients:14161234567\n}",
684
+ "minimised_modl": "_number=42;{!{number>41}?support_number=441270123456/?support_number=International Clients:14161234567}",
685
+ "expected_output": "{\n \"support_number\" : [ \"International Clients\", 14161234567 ]\n}\n"
686
+ }, {
687
+ "input": "_country=gb;\n{\n !{country=us/gb/au}?\n support_number=441270123456\n /?\n support_number=International Clients:14161234567\n}",
688
+ "minimised_modl": "_country=gb;{!{country=us/gb/au}?support_number=441270123456/?support_number=International Clients:14161234567}",
689
+ "expected_output": "{\n \"support_number\" : [ \"International Clients\", 14161234567 ]\n}\n"
690
+ }, {
691
+ "input": "*L=\"https://www.modl.uk/tests/message-thread.txt\";\n\nm=out:2018-03-22 15\\:25:Hi;\nm=in:2018-03-22 15\\:26:Hello, how are you?;\nm=out:2018-03-22 15\\:25:Hi, good thanks;\nm=out:2018-03-22 15\\:26:How about you?;\nm=in:2018-03-22 15\\:26:Yes, fine thanks. What are you up to?;\nm=out:2018-03-22 15\\:25:Just testing out MODL;\nm=in:2018-03-22 15\\:26:Cool!",
692
+ "minimised_modl": "*L=\"https://www.modl.uk/demo/message-thread.txt\";m=out:2018-03-22 15~:25:Hi;m=in:2018-03-22 15~:26:Hello, how are you?;m=out:2018-03-22 15~:25:Hi, good thanks;m=out:2018-03-22 15~:26:How about you?;m=in:2018-03-22 15~:26:Yes, fine thanks. What are you up to?;m=out:2018-03-22 15~:25:Just testing out MODL;m=in:2018-03-22 15~:26:Cool!",
693
+ "expected_output": "[ {\n \"message\" : {\n \"direction\" : \"out\",\n \"date_time\" : \"2018-03-22 15:25\",\n \"message\" : \"Hi\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"in\",\n \"date_time\" : \"2018-03-22 15:26\",\n \"message\" : \"Hello, how are you?\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"out\",\n \"date_time\" : \"2018-03-22 15:25\",\n \"message\" : \"Hi, good thanks\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"out\",\n \"date_time\" : \"2018-03-22 15:26\",\n \"message\" : \"How about you?\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"in\",\n \"date_time\" : \"2018-03-22 15:26\",\n \"message\" : \"Yes, fine thanks. What are you up to?\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"out\",\n \"date_time\" : \"2018-03-22 15:25\",\n \"message\" : \"Just testing out MODL\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"in\",\n \"date_time\" : \"2018-03-22 15:26\",\n \"message\" : \"Cool!\",\n \"method\" : \"sms\"\n }\n} ]\n"
694
+ }, {
695
+ "input": "_var=2;\n*L=\"http://s3-eu-west-1.amazonaws.com/modltestfiles/testing.txt!\";\nprint=%update_date\n",
696
+ "minimised_modl": "_var=2;*L=http~://s3-eu-west-1.amazonaws.com/modltestfiles/testing.txt!;print=%update_date",
697
+ "expected_output": "{\n \"print\" : \"20180921 08:20 2\"\n}\n"
698
+ }, {
699
+ "input": "_T=grammar_tests/demo;\n*L=`%T`_config",
700
+ "minimised_modl": "_T=grammar_tests/demo;*L=`%T`_config",
701
+ "expected_output": "\n"
702
+ }, {
703
+ "input": "*l=grammar_tests/1;*L=grammar_tests/1;a=1",
704
+ "minimised_modl": "*l=grammar_tests/1;*L=grammar_tests/1;a=1",
705
+ "expected_output": "{\n \"a\" : 1\n}\n"
706
+ }, {
707
+ "input": "*l=grammar_tests/1;*l=grammar_tests/1;a=1",
708
+ "minimised_modl": "*L=grammar_tests/1;*l=grammar_tests/1;a=1",
709
+ "expected_output": "{\n \"a\" : 1\n}\n"
710
+ }, {
711
+ "input": "*L=grammar_tests/1:grammar_tests/2:grammar_tests/3;\nthe_number=%number",
712
+ "minimised_modl": "*L=grammar_tests/1:grammar_tests/2:grammar_tests/3;the_number=%number",
713
+ "expected_output": "{\n \"the_number\" : 3\n}\n"
714
+ }, {
715
+ "input": "*L=grammar_tests/1:grammar_tests/2:grammar_tests/3:grammar_tests/1;\nthe_number=%number",
716
+ "minimised_modl": "*L=grammar_tests/1:grammar_tests/2:grammar_tests/3:grammar_tests/1;the_number=%number",
717
+ "expected_output": "{\n \"the_number\" : 1\n}\n"
718
+ }, {
719
+ "input": "*L[grammar_tests/1;grammar_tests/2;grammar_tests/3;grammar_tests/1];\nthe_number=%number",
720
+ "minimised_modl": "*L=grammar_tests/1:grammar_tests/2:grammar_tests/3:grammar_tests/1;the_number=%number",
721
+ "expected_output": "{\n \"the_number\" : 1\n}\n"
722
+ }, {
723
+ "input": "*L=grammar_tests/a:grammar_tests/b:grammar_tests/c;\nvar=%var",
724
+ "minimised_modl": "*L=grammar_tests/a:grammar_tests/b:grammar_tests/c;var=%var",
725
+ "expected_output": "{\n \"var\" : \"abc\"\n}\n"
726
+ }, {
727
+ "input": "*L=grammar_tests/demo_config;\n\nm=out:2018-03-22 15\\:25:Hi;\nm=in:2018-03-22 15\\:26:Hello, how are you?;\nm=out:2018-03-22 15\\:25:Hi, good thanks;\nm=out:2018-03-22 15\\:26:How about you?;\nm=in:2018-03-22 15\\:26:Yes, fine thanks. What are you up to?;\nm=out:2018-03-22 15\\:25:Just testing out MODL;\nm=in:2018-03-22 15\\:26:Cool!",
728
+ "minimised_modl": "*L=grammar_tests/demo_config;m=out:2018-03-22 15~:25:Hi;m=in:2018-03-22 15~:26:Hello, how are you?;m=out:2018-03-22 15~:25:Hi, good thanks;m=out:2018-03-22 15~:26:How about you?;m=in:2018-03-22 15~:26:Yes, fine thanks. What are you up to?;m=out:2018-03-22 15~:25:Just testing out MODL;m=in:2018-03-22 15~:26:Cool!",
729
+ "expected_output": "[ {\n \"message\" : {\n \"direction\" : \"out\",\n \"date_time\" : \"2018-03-22 15:25\",\n \"message\" : \"Hi\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"in\",\n \"date_time\" : \"2018-03-22 15:26\",\n \"message\" : \"Hello, how are you?\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"out\",\n \"date_time\" : \"2018-03-22 15:25\",\n \"message\" : \"Hi, good thanks\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"out\",\n \"date_time\" : \"2018-03-22 15:26\",\n \"message\" : \"How about you?\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"in\",\n \"date_time\" : \"2018-03-22 15:26\",\n \"message\" : \"Yes, fine thanks. What are you up to?\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"out\",\n \"date_time\" : \"2018-03-22 15:25\",\n \"message\" : \"Just testing out MODL\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"in\",\n \"date_time\" : \"2018-03-22 15:26\",\n \"message\" : \"Cool!\",\n \"method\" : \"sms\"\n }\n} ]\n"
730
+ }, {
731
+ "input": "## country\n_c = us;\n## language\n_l = en;\n\n*L=grammar_tests/import_config.modl;\n\ncountry = %c;\nlanguage = %l;\ntime_zone = %tz",
732
+ "minimised_modl": "_c=us;_l=en;*L=grammar_tests/import_config.modl;country=%c;language=%l;time_zone=%tz",
733
+ "expected_output": "[ {\n \"country\" : \"us\"\n}, {\n \"language\" : \"en\"\n}, {\n \"time_zone\" : \"EST\"\n} ]\n"
734
+ }, {
735
+ "input": "*L=grammar_tests/test_import_dir/test_import.txt;\n\nm=out:2018-03-22 15\\:25:Hi;\nm=in:2018-03-22 15\\:26:Hello, how are you?;\nm=out:2018-03-22 15\\:25:Hi, good thanks;\nm=out:2018-03-22 15\\:26:How about you?;\nm=in:2018-03-22 15\\:26:Yes, fine thanks. What are you up to?;\nm=out:2018-03-22 15\\:25:Just testing out MODL;\nm=in:2018-03-22 15\\:26:Cool!",
736
+ "minimised_modl": "*L=grammar_tests/test_import_dir/test_import.txt;m=out:2018-03-22 15~:25:Hi;m=in:2018-03-22 15~:26:Hello, how are you?;m=out:2018-03-22 15~:25:Hi, good thanks;m=out:2018-03-22 15~:26:How about you?;m=in:2018-03-22 15~:26:Yes, fine thanks. What are you up to?;m=out:2018-03-22 15~:25:Just testing out MODL;m=in:2018-03-22 15~:26:Cool!",
737
+ "expected_output": "[ {\n \"message\" : {\n \"direction\" : \"out\",\n \"date_time\" : \"2018-03-22 15:25\",\n \"message\" : \"Hi\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"in\",\n \"date_time\" : \"2018-03-22 15:26\",\n \"message\" : \"Hello, how are you?\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"out\",\n \"date_time\" : \"2018-03-22 15:25\",\n \"message\" : \"Hi, good thanks\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"out\",\n \"date_time\" : \"2018-03-22 15:26\",\n \"message\" : \"How about you?\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"in\",\n \"date_time\" : \"2018-03-22 15:26\",\n \"message\" : \"Yes, fine thanks. What are you up to?\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"out\",\n \"date_time\" : \"2018-03-22 15:25\",\n \"message\" : \"Just testing out MODL\",\n \"method\" : \"sms\"\n }\n}, {\n \"message\" : {\n \"direction\" : \"in\",\n \"date_time\" : \"2018-03-22 15:26\",\n \"message\" : \"Cool!\",\n \"method\" : \"sms\"\n }\n} ]\n"
738
+ }, {
739
+ "input": "o=[test;test;t=Customer Service:44123]",
740
+ "minimised_modl": "o[test;test;t=Customer Service:44123]",
741
+ "expected_output": "{\n \"o\" : [ \"test\", \"test\", {\n \"t\" : [ \"Customer Service\", 44123 ]\n } ]\n}\n"
742
+ }, {
743
+ "input": "test[number=1;number=2;number=3]",
744
+ "minimised_modl": "test[number=1;number=2;number=3]",
745
+ "expected_output": "{\n \"test\" : [ {\n \"number\" : 1\n }, {\n \"number\" : 2\n }, {\n \"number\" : 3\n } ]\n}\n"
746
+ }, {
747
+ "input": "test(one=1;two=2;three=3)",
748
+ "minimised_modl": "test(one=1;two=2;three=3)",
749
+ "expected_output": "{\n \"test\" : {\n \"one\" : 1,\n \"two\" : 2,\n \"three\" : 3\n }\n}\n"
750
+ }, {
751
+ "input": "test=test",
752
+ "minimised_modl": "test=test",
753
+ "expected_output": "{\n \"test\" : \"test\"\n}\n"
754
+ }, {
755
+ "input": "one=1;two=2;three=3",
756
+ "minimised_modl": "one=1;two=2;three=3",
757
+ "expected_output": "[ {\n \"one\" : 1\n}, {\n \"two\" : 2\n}, {\n \"three\" : 3\n} ]\n"
758
+ }, {
759
+ "input": "[o(n=test);o(n=test2)]",
760
+ "minimised_modl": "[o(n=test);o(n=test2)]",
761
+ "expected_output": "[ {\n \"o\" : {\n \"n\" : \"test\"\n }\n}, {\n \"o\" : {\n \"n\" : \"test2\"\n }\n} ]\n"
762
+ }, {
763
+ "input": "R=0;\nnumber=1;number=2;number=3",
764
+ "minimised_modl": "R=0;number=1;number=2;number=3",
765
+ "expected_output": "[ {\n \"R\" : 0\n}, {\n \"number\" : 1\n}, {\n \"number\" : 2\n}, {\n \"number\" : 3\n} ]\n"
766
+ }, {
767
+ "input": "test=(one=1)",
768
+ "minimised_modl": "test(one=1)",
769
+ "expected_output": "{\n \"test\" : {\n \"one\" : 1\n }\n}\n"
770
+ }, {
771
+ "input": "test(one=1)",
772
+ "minimised_modl": "test(one=1)",
773
+ "expected_output": "{\n \"test\" : {\n \"one\" : 1\n }\n}\n"
774
+ }, {
775
+ "input": "test=[1;2;3]",
776
+ "minimised_modl": "test=1:2:3",
777
+ "expected_output": "{\n \"test\" : [ 1, 2, 3 ]\n}\n"
778
+ }, {
779
+ "input": "test[1;2;3]",
780
+ "minimised_modl": "test=1:2:3",
781
+ "expected_output": "{\n \"test\" : [ 1, 2, 3 ]\n}\n"
782
+ }, {
783
+ "input": "o(n=Tesco;s=Every Little Helps)",
784
+ "minimised_modl": "o(n=Tesco;s=Every Little Helps)",
785
+ "expected_output": "{\n \"o\" : {\n \"n\" : \"Tesco\",\n \"s\" : \"Every Little Helps\"\n }\n}\n"
786
+ }, {
787
+ "input": "o(n=test)",
788
+ "minimised_modl": "o(n=test)",
789
+ "expected_output": "{\n \"o\" : {\n \"n\" : \"test\"\n }\n}\n"
790
+ }, {
791
+ "input": "o(n=test)\n",
792
+ "minimised_modl": "o(n=test)",
793
+ "expected_output": "{\n \"o\" : {\n \"n\" : \"test\"\n }\n}\n"
794
+ }, {
795
+ "input": "o(\nn=test\n)",
796
+ "minimised_modl": "o(n=test)",
797
+ "expected_output": "{\n \"o\" : {\n \"n\" : \"test\"\n }\n}\n"
798
+ }, {
799
+ "input": "o(n=test)",
800
+ "minimised_modl": "o(n=test)",
801
+ "expected_output": "{\n \"o\" : {\n \"n\" : \"test\"\n }\n}\n"
802
+ }, {
803
+ "input": "o(n=test);\no(n=test2)",
804
+ "minimised_modl": "o(n=test);o(n=test2)",
805
+ "expected_output": "[ {\n \"o\" : {\n \"n\" : \"test\"\n }\n}, {\n \"o\" : {\n \"n\" : \"test2\"\n }\n} ]\n"
806
+ }, {
807
+ "input": "o(n=test);o(n=test2)",
808
+ "minimised_modl": "o(n=test);o(n=test2)",
809
+ "expected_output": "[ {\n \"o\" : {\n \"n\" : \"test\"\n }\n}, {\n \"o\" : {\n \"n\" : \"test2\"\n }\n} ]\n"
810
+ }, {
811
+ "input": "o=[test;test]",
812
+ "minimised_modl": "o=test:test",
813
+ "expected_output": "{\n \"o\" : [ \"test\", \"test\" ]\n}\n"
814
+ }, {
815
+ "input": "o=test",
816
+ "minimised_modl": "o=test",
817
+ "expected_output": "{\n \"o\" : \"test\"\n}\n"
818
+ }, {
819
+ "input": "o=[1;2]",
820
+ "minimised_modl": "o=1:2",
821
+ "expected_output": "{\n \"o\" : [ 1, 2 ]\n}\n"
822
+ }, {
823
+ "input": "o=[test1;test2]",
824
+ "minimised_modl": "o=test1:test2",
825
+ "expected_output": "{\n \"o\" : [ \"test1\", \"test2\" ]\n}\n"
826
+ }, {
827
+ "input": "o(t=test1;t2=test2)",
828
+ "minimised_modl": "o(t=test1;t2=test2)",
829
+ "expected_output": "{\n \"o\" : {\n \"t\" : \"test1\",\n \"t2\" : \"test2\"\n }\n}\n"
830
+ }, {
831
+ "input": "o(t(a=test;b=test2);t2(c=test;d=test2))",
832
+ "minimised_modl": "o(t(a=test;b=test2);t2(c=test;d=test2))",
833
+ "expected_output": "{\n \"o\" : {\n \"t\" : {\n \"a\" : \"test\",\n \"b\" : \"test2\"\n },\n \"t2\" : {\n \"c\" : \"test\",\n \"d\" : \"test2\"\n }\n }\n}"
834
+ }, {
835
+ "input": "o=1:2::4:5",
836
+ "minimised_modl": "5",
837
+ "expected_output": "{\n \"o\" : [ 1, 2, null, 4, 5 ]\n}"
838
+ }, {
839
+ "input": "o=[1;2;;4;5]",
840
+ "minimised_modl": "o=1:2::4:5",
841
+ "expected_output": "{\n \"o\" : [ 1, 2, null, 4, 5 ]\n}"
842
+ }, {
843
+ "input": "o=[1;\n2;\n\n3;\n4;\n5]",
844
+ "minimised_modl": "o=1:2:3:4:5",
845
+ "expected_output": "{\n \"o\" : [ 1, 2, 3, 4, 5 ]\n}"
846
+ }, {
847
+ "input": "o=[1 2 3 4 5]",
848
+ "minimised_modl": "o=1 2 3 4 5",
849
+ "expected_output": "{\n \"o\" : [ \"1 2 3 4 5\" ]\n}"
850
+ }, {
851
+ "input": "o=`ok`",
852
+ "minimised_modl": "o=`ok`",
853
+ "expected_output": "{\n \"o\" : \"ok\"\n}"
854
+ }, {
855
+ "input": "o=``",
856
+ "minimised_modl": "o=``",
857
+ "expected_output": "{\n \"o\" : \"\"\n}"
858
+ }, {
859
+ "input": "_test=(\n numbers=[[1;2;3;4;5];[6;7;8;9;10]]\n);\n \ntesting=%test.numbers.0.0",
860
+ "minimised_modl": "_test=(numbers=[[1;2;3;4;5];[6;7;8;9;10]]);testing=%test.numbers.0.0",
861
+ "expected_output": "{\n \"testing\" : 1\n}"
862
+ }, {
863
+ "input": "_test=(\n numbers=(\"one\"=1)\n);\n \ntesting = this is a string that includes a reference with a letter s after it `%test.numbers.one`s",
864
+ "minimised_modl": "_test=(numbers=(one=1));testing=this is a string that includes a reference with a letter s after it `%test.numbers.one`s",
865
+ "expected_output": "{\n \"testing\" : \"this is a string that includes a reference with a letter s after it 1s\"\n}"
866
+ }, {
867
+ "input": "_test=(\n numbers=(\"v\"=TEST)\n);\n \ntesting = this is a string that includes extra transforms for the value `%test.numbers.v.d`_value",
868
+ "minimised_modl": "_test=(numbers=(v=TEST));testing=this is a string that includes extra transforms for the value `%test.numbers.v.d`_value",
869
+ "expected_output": "{\n \"testing\" : \"this is a string that includes extra transforms for the value test_value\"\n}"
870
+ }, {
871
+ "input": "_test=(\n first=(\"v\"=TEST);\n second=(\"v\"=TEST2)\n);\n \ntesting = this is a string that includes extra transforms for the value `%test.second.v.d`_value",
872
+ "minimised_modl": "_test=(first=(v=TEST);second=(v=TEST2));testing=this is a string that includes extra transforms for the value `%test.second.v.d`_value",
873
+ "expected_output": "{\n \"testing\" : \"this is a string that includes extra transforms for the value test2_value\"\n}"
874
+ }, {
875
+ "input": "_test=(\n first=(\"v1\"=one);\n second=(\"v2\"=two:three)\n);\n \ntesting = \"`%test.second.v2.1`\"",
876
+ "minimised_modl": "_test=(first=(v1=one);second=(v2=two:three));testing=`%test.second.v2.1`",
877
+ "expected_output": "{\n \"testing\" : \"three\"\n}\n"
878
+ }, {
879
+ "input": "_test=(\n first=(\"v1\"=[one]);\n second=(\"v2\"=two:three)\n);\n \ntesting = \"`%test.first.v1.0``%test.second.v2.0``%test.second.v2.1`\"",
880
+ "minimised_modl": "_test=(first=(v1=[one]);second=(v2=two:three));testing=`%test.first.v1.0``%test.second.v2.0``%test.second.v2.1`",
881
+ "expected_output": "{\n \"testing\" : \"onetwothree\"\n}\n"
882
+ }, {
883
+ "input": "_test=(\n first=(\"v1\"=(one=(two=three)))\n);\n \ntesting = \"`%test.first.v1.one.two`\"",
884
+ "minimised_modl": "_test=(first=(v1=(one=(two=three))));testing=`%test.first.v1.one.two`",
885
+ "expected_output": "{\n \"testing\" : \"three\"\n}\n"
886
+ },
887
+ {"input": "b=2;c=2;d=2;e=2;a={{b=c & d=e}?v1:v2:v3/?v4:v5:v6}",
888
+ "minimised_modl": "b=2;c=2;d=2;e=2;a={{b=c & d=e}?v1:v2:v3/?v4:v5:v6}",
889
+ "expected_output": "[{\"b\": 2},{\"c\": 2},{\"d\": 2},{\"e\": 2}, {\"a\": [\"v1\",\"v2\",\"v3\"]}]"},
890
+
891
+ {"input" : "o=1:2:3:4:5",
892
+ "minimised_modl" : "o=1:2:3:4:5",
893
+ "expected_output" : "{\n \"o\" : [ 1, 2, 3, 4, 5 ]\n}"
894
+ },
895
+ {"input" : "o=1:2::4:5",
896
+ "minimised_modl" : "o=1:2::4:5",
897
+ "expected_output" : "{\n \"o\" : [ 1, 2, null, 4, 5 ]\n}"
898
+ },
899
+ {"input" : "o=[1;2;3;4;5]",
900
+ "minimised_modl" : "o=[1;2;3;4;5]",
901
+ "expected_output" : "{\n \"o\" : [ 1, 2, 3, 4, 5 ]\n}"
902
+ },
903
+ {"input" : "o=[1;2;;4;5]",
904
+ "minimised_modl" : "o=[1;2;;4;5]",
905
+ "expected_output" : "{\n \"o\" : [ 1, 2, null, 4, 5 ]\n}"
906
+ },
907
+ {
908
+ "input": "o=[1;\n2;\n3;\n4;\n5]",
909
+ "minimised_modl" : "o=[1\n2\n3\n4\n5]",
910
+ "expected_output" : "{\n \"o\" : [ 1, 2, 3, 4, 5 ]\n}"
911
+ },
912
+ {
913
+ "input": "o=[1;\n2;\n\n3;\n4;\n5]",
914
+ "minimised_modl" : "o=[1\n2\n\n3\n4\n5]",
915
+ "expected_output" : "{\n \"o\" : [ 1, 2, 3, 4, 5 ]\n}"
916
+ },
917
+ {"input" : "o=[1 2 3 4 5]",
918
+ "minimised_modl" : "o=[1 2 3 4 5]",
919
+ "expected_output" : "{\n \"o\" : [ \"1 2 3 4 5\" ]\n}"
920
+ },
921
+ {"input" : "o=`ok`",
922
+ "minimised_modl" : "o=ok",
923
+ "expected_output" : "{\n \"o\" : \"ok\"}"
924
+ },
925
+ {"input" : "o=``",
926
+ "minimised_modl" : "o=``",
927
+ "expected_output" : "{\n \"o\" : \"\"\n}"
928
+ },
929
+ {"input" : "o=\"ok\"",
930
+ "minimised_modl" : "o=ok",
931
+ "expected_output" : "{\n \"o\" : \"ok\"}"
932
+ },
933
+ {"input" : "o=\"\"",
934
+ "minimised_modl" : "o=\"\"",
935
+ "expected_output" : "{\n \"o\" : \"\"\n}"
936
+ },
937
+ {
938
+ "input": "_test=( numbers=[[1;2;3;4;5];[6;7;8;9;10]]\n);\n \ntesting=%test.numbers.0.0",
939
+ "minimised_modl" : "_test=(numbers=[[1;2;3;4;5];[6;7;8;9;10]]);testing=%test.numbers.0.0",
940
+ "expected_output" : "{\"testing\":1}"
941
+ },
942
+ {
943
+ "input": "_test=(\n numbers=(\"one\"=1)\n);\n\ntesting = this is a string that includes a reference with a letter s after it `%test.numbers.one`s",
944
+ "minimised_modl" : "_test=(numbers=(\"one\"=1));testing = this is a string that includes a reference with a letter s after it `%test.numbers.one`s",
945
+ "expected_output" : "{\"testing\":\"this is a string that includes a reference with a letter s after it 1s\"}"
946
+ },
947
+ {
948
+ "input": "_test=(\n numbers=(\"v\"=TEST)\n);\n \ntesting = this is a string that includes extra transforms for the value `%test.numbers.v.d`_value",
949
+ "minimised_modl" : "_test=(numbers=(\"v\"=TEST));testing = this is a string that includes extra transforms for the value `%test.numbers.v.d`_value",
950
+ "expected_output" : "{\"testing\":\"this is a string that includes extra transforms for the value test_value\"}"
951
+ },
952
+ {
953
+ "input": "_test=(\n first=(\"v\"=TEST);\n second=(\"v\"=TEST2)\n);\n \ntesting = this is a string that includes extra transforms for the value `%test.second.v.d`_value",
954
+ "minimised_modl" : "_test=(first=(\"v\"=TEST);second=(\"v\"=TEST2));testing = this is a string that includes extra transforms for the value `%test.second.v.d`_value",
955
+ "expected_output" : "{\"testing\":\"this is a string that includes extra transforms for the value test2_value\"}"
956
+ },
957
+ {
958
+ "input": "_test=(\n first=(\"v1\"=one);\n second=(\"v2\"=two:three)\n);\n \ntesting = \"`%test.second.v2.1`\"",
959
+ "minimised_modl" : "_test=(first=(\"v1\"=one);second=(\"v2\"=two:three));testing = \"`%test.second.v2.1`\"",
960
+ "expected_output" : "{\"testing\":\"three\"}"
961
+ },
962
+ {
963
+ "input": "_test=(\n first=(\"v1\"=[one]);\n second=(\"v2\"=two:three)\n);\n \ntesting = \"`%test.first.v1.0``%test.second.v2.0``%test.second.v2.1`\"",
964
+ "minimised_modl" : "_test=(first=(\"v1\"=[one]);second=(\"v2\"=two:three));testing = \"`%test.first.v1.0``%test.second.v2.0``%test.second.v2.1`\"",
965
+ "expected_output" : "{\"testing\":\"onetwothree\"}"
966
+ },
967
+ {
968
+ "input": "_test=(\n first=(\"v1\"=(one=(two=three)))\n);\n \ntesting = \"`%test.first.v1.one.two`\"",
969
+ "minimised_modl" : "_test=(first=(\"v1\"=(one=(two=three))));testing = \"`%test.first.v1.one.two`\"",
970
+ "expected_output" : "{\"testing\":\"three\"}"
971
+ },
972
+ {
973
+ "input": "tony=hungry;\nneeds_food_1={tony=hungry?true/?false};\nneeds_food_2={!tony=hungry?false/?true};\nneeds_food_3={tony!=hungry?false/?true};\nneeds_food_3={!tony!=hungry?true/?false}",
974
+ "minimised_modl": "tony=hungry\nneeds_food_1={tony=hungry?true/?false}\nneeds_food_2={!tony=hungry?false/?true}\nneeds_food_3={tony!=hungry?false/?true}\nneeds_food_3={!tony!=hungry?true/?false}",
975
+ "expected_output": "[{\"tony\": \"hungry\"},{\"needs_food_1\": true},{\"needs_food_2\": true},{\"needs_food_3\": true},{\"needs_food_3\": true}]"
976
+
977
+ },
978
+ {
979
+ "input": "_c=de;\nresult={c!=de/at?German or Austrian/?Other}",
980
+ "minimised_modl": "_c=de\nresult={c!=de/at?German or Austrian/?Other}",
981
+ "expected_output": "{\"result\":\"Other\"}"},
982
+ {
983
+ "input": "_test = 1;\nresult={!test!=1?one/?Other}",
984
+ "minimised_modl": "_test = 1\nresult={!test!=1?one/?Other}",
985
+ "expected_output": "{\"result\":\"one\"}"},
986
+ {"input": "x=[1;2:3:4]",
987
+ "minimised_modl": "x=[1;2:3:4]",
988
+ "expected_output": "{\"x\": [1,[2,3,4]]}"},
989
+ {
990
+ "input": "_x=[1;2:3:4];\na=%x.1.1",
991
+ "minimised_modl": "_x=[1;2:3:4]\na=%x.1.1",
992
+ "expected_output": "{\"a\":3}"},
993
+ {"input": "x=[1;;;;;;;2:::::::::3;;;;;;;;;;4:::::::::5]",
994
+ "minimised_modl": "x=[1;;;;;;;2:::::::::3;;;;;;;;;;4:::::::::5]",
995
+ "expected_output": "{\"x\" : [ 1, null, null, null, null, null, null, [2, null, null, null, null, null, null, null, null, 3], null, null, null, null, null, null, null, null, null, [4, null, null, null, null, null, null, null, null, 5] ]}"}
996
+ ]