forked from ingydotnet/testml-pgx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testml.pgx.yaml
220 lines (220 loc) · 4.66 KB
/
testml.pgx.yaml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
---
+top: testml_document
assertion_call:
.any:
- -wrap: 1
.ref: assertion_eq
- -wrap: 1
.ref: assertion_ok
- -wrap: 1
.ref: assertion_has
assertion_call_test:
.rgx: (?:\.(?:[\ \t]|\r?\n|\#.*\r?\n)*|(?:[\ \t]|\r?\n|\#.*\r?\n)*\.)(?:EQ|OK|HAS)
assertion_eq:
.any:
- -wrap: 1
.ref: assertion_operator_eq
- -wrap: 1
.ref: assertion_function_eq
assertion_function_eq:
.all:
- .rgx: (?:\.(?:[\ \t]|\r?\n|\#.*\r?\n)*|(?:[\ \t]|\r?\n|\#.*\r?\n)*\.)EQ\(
- .ref: code_expression
- .rgx: \)
assertion_function_has:
.all:
- .rgx: (?:\.(?:[\ \t]|\r?\n|\#.*\r?\n)*|(?:[\ \t]|\r?\n|\#.*\r?\n)*\.)HAS\(
- .ref: code_expression
- .rgx: \)
assertion_function_ok:
.rgx: (?:\.(?:[\ \t]|\r?\n|\#.*\r?\n)*|(?:[\ \t]|\r?\n|\#.*\r?\n)*\.)(OK)(?:\((?:[\
\t]|\r?\n|\#.*\r?\n)*\))?
assertion_has:
.any:
- -wrap: 1
.ref: assertion_operator_has
- -wrap: 1
.ref: assertion_function_has
assertion_ok:
.ref: assertion_function_ok
assertion_operator_eq:
.all:
- .rgx: (?:[\ \t]|\r?\n|\#.*\r?\n)+==(?:[\ \t]|\r?\n|\#.*\r?\n)+
- .ref: code_expression
assertion_operator_has:
.all:
- .rgx: (?:[\ \t]|\r?\n|\#.*\r?\n)+\~\~(?:[\ \t]|\r?\n|\#.*\r?\n)+
- .ref: code_expression
assignment_statement:
.all:
- .ref: variable_name
- .rgx: \s+=\s+
- .ref: code_expression
- .ref: semicolon
blank_line:
.rgx: '[\ \t]*\r?\n'
block_header:
.all:
- .ref: block_marker
- +max: 1
.all:
- .rgx: '[\ \t]+'
- .ref: block_label
- .rgx: '[\ \t]*\r?\n'
block_label:
.ref: unquoted_string
block_marker:
.rgx: ===
block_point:
.any:
- .ref: lines_point
- .ref: phrase_point
call_indicator:
.rgx: (?:\.(?:[\ \t]|\r?\n|\#.*\r?\n)*|(?:[\ \t]|\r?\n|\#.*\r?\n)*\.)
code_expression:
.all:
- .ref: code_object
- +min: 0
.ref: unit_call
code_object:
.any:
- .ref: function_object
- .ref: point_object
- .ref: string_object
- .ref: number_object
- .ref: transform_object
code_section:
+min: 0
.any:
- .rgx: (?:[\ \t]|\r?\n|\#.*\r?\n)+
- .ref: assignment_statement
- .ref: code_statement
code_statement:
.all:
- .ref: code_expression
- +max: 1
.ref: assertion_call
- .ref: semicolon
comment:
.rgx: \#.*\r?\n
core_transform:
.rgx: ([A-Z]\w*)
data_block:
.all:
- .ref: block_header
- +min: 0
-skip: 1
.any:
- .ref: blank_line
- .ref: comment
- +min: 0
.ref: block_point
data_section:
+min: 0
.ref: data_block
double_quoted_string:
.rgx: (?:"((?:[^\n\\"]|\\"|\\\\|\\[0nt])*?)")
function_object:
.all:
- +max: 1
.ref: function_signature
- .ref: function_start
- +min: 0
.any:
- .rgx: (?:[\ \t]|\r?\n|\#.*\r?\n)+
- .ref: assignment_statement
- .ref: code_statement
- .rgx: (?:[\ \t]|\r?\n|\#.*\r?\n)*\}
function_signature:
.all:
- .rgx: \((?:[\ \t]|\r?\n|\#.*\r?\n)*
- +max: 1
.ref: function_variables
- .rgx: (?:[\ \t]|\r?\n|\#.*\r?\n)*\)
function_start:
.rgx: (?:[\ \t]|\r?\n|\#.*\r?\n)*(\{)(?:[\ \t]|\r?\n|\#.*\r?\n)*
function_variable:
.rgx: ([a-zA-Z]\w*)
function_variables:
+min: 1
.ref: function_variable
.sep:
.rgx: (?:[\ \t]|\r?\n|\#.*\r?\n)*,(?:[\ \t]|\r?\n|\#.*\r?\n)*
lines_point:
.all:
- .ref: point_marker
- .rgx: '[\ \t]+'
- .ref: point_name
- .rgx: '[\ \t]*\r?\n'
- .ref: point_lines
number:
.rgx: ([0-9]+)
number_object:
.ref: number
phrase_point:
.all:
- .ref: point_marker
- .rgx: '[\ \t]+'
- .ref: point_name
- .rgx: :[\ \t]
- .ref: point_phrase
- .rgx: \r?\n
- .rgx: (?:\#.*\r?\n|[\ \t]*\r?\n)*
point_lines:
.rgx: ((?:(?!===|\-\-\-).*\r?\n)*)
point_marker:
.rgx: \-\-\-
point_name:
.rgx: ([a-z]\w*|[A-Z]\w*)
point_object:
.rgx: (\*[a-z]\w*)
point_phrase:
.ref: unquoted_string
quoted_string:
.any:
- .ref: single_quoted_string
- .ref: double_quoted_string
semicolon:
.any:
- .rgx: ;
- .err: You seem to be missing a semicolon
single_quoted_string:
.rgx: (?:'((?:[^\n\\']|\\'|\\\\)*?)')
string_object:
.ref: quoted_string
testml_document:
.all:
- .ref: code_section
- +max: 1
.ref: data_section
transform_argument:
.ref: code_expression
transform_argument_list:
.all:
- .rgx: \((?:[\ \t]|\r?\n|\#.*\r?\n)*
- +min: 0
.ref: transform_argument
.sep:
.rgx: (?:[\ \t]|\r?\n|\#.*\r?\n)*,(?:[\ \t]|\r?\n|\#.*\r?\n)*
- .rgx: (?:[\ \t]|\r?\n|\#.*\r?\n)*\)
transform_name:
.any:
- .ref: user_transform
- .ref: core_transform
transform_object:
.all:
- .ref: transform_name
- +max: 1
.ref: transform_argument_list
unit_call:
.all:
- +asr: -1
.ref: assertion_call_test
- .ref: call_indicator
- .ref: code_object
unquoted_string:
.rgx: ([^\ \t\n\#](?:[^\n\#]*[^\ \t\n\#])?)
user_transform:
.rgx: ([a-z]\w*)
variable_name:
.rgx: ([a-zA-Z]\w*)