Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 239 lines (181 sloc) 3.457 kb
4cd29ef @ingydotnet New pegex syntax
authored
1 %grammar testml
2 %version 0.0.1
3 %include atom
4
8c71181 @ingydotnet Change _ to - in rule names
authored
5 testml-document:
6 code-section
7 data-section?
584af21 @ingydotnet small grammar tweaks
authored
8
f892545 @ingydotnet The new and reduced testml grammar.
authored
9 # General Tokens
ac1735c @ingydotnet Add regex whitespace to the grammar.
authored
10 escape: / [0nt] /
4cd29ef @ingydotnet New pegex syntax
authored
11 line: / ANY* EOL /
12 blanks: / BLANK+ /
8c71181 @ingydotnet Change _ to - in rule names
authored
13 blank-line: / BLANK* EOL /
4cd29ef @ingydotnet New pegex syntax
authored
14 comment: / '#' line /
15 ws: /(: BLANK | EOL | comment )/
ac1735c @ingydotnet Add regex whitespace to the grammar.
authored
16
17 # Strings
8c71181 @ingydotnet Change _ to - in rule names
authored
18 quoted-string:
19 | single-quoted-string
20 | double-quoted-string
ac1735c @ingydotnet Add regex whitespace to the grammar.
authored
21
8c71181 @ingydotnet Change _ to - in rule names
authored
22 single-quoted-string:
4cd29ef @ingydotnet New pegex syntax
authored
23 /(:
24 SINGLE
25 ((:
26 [^ BREAK BACK SINGLE ] |
27 BACK SINGLE |
28 BACK BACK
29 )*?)
30 SINGLE
31 )/
ac1735c @ingydotnet Add regex whitespace to the grammar.
authored
32
8c71181 @ingydotnet Change _ to - in rule names
authored
33 double-quoted-string:
4cd29ef @ingydotnet New pegex syntax
authored
34 /(:
35 DOUBLE
36 ((:
37 [^ BREAK BACK DOUBLE] |
38 BACK DOUBLE |
39 BACK BACK |
40 BACK escape
41 )*?)
42 DOUBLE
43 )/
ac1735c @ingydotnet Add regex whitespace to the grammar.
authored
44
8c71181 @ingydotnet Change _ to - in rule names
authored
45 unquoted-string:
4cd29ef @ingydotnet New pegex syntax
authored
46 /(
47 [^ BLANKS BREAK HASH]
48 (:
49 [^ BREAK HASH]*
50 [^ BLANKS BREAK HASH]
51 )?
52 )/
ac1735c @ingydotnet Add regex whitespace to the grammar.
authored
53
4cd29ef @ingydotnet New pegex syntax
authored
54 number: / ( DIGIT+ ) /
672bb7e @ingydotnet change integer to number
authored
55
f892545 @ingydotnet The new and reduced testml grammar.
authored
56
8a55f00 @ingydotnet Grammar work.
authored
57 # TestML Code Section
8c71181 @ingydotnet Change _ to - in rule names
authored
58 code-section: (
4cd29ef @ingydotnet New pegex syntax
authored
59 | +
8c71181 @ingydotnet Change _ to - in rule names
authored
60 | assignment-statement
61 | code-statement
4cd29ef @ingydotnet New pegex syntax
authored
62 )*
8b41b47 @ingydotnet assignment
authored
63
8c71181 @ingydotnet Change _ to - in rule names
authored
64 assignment-statement:
65 variable-name
4cd29ef @ingydotnet New pegex syntax
authored
66 / WS+ '=' WS+ /
8c71181 @ingydotnet Change _ to - in rule names
authored
67 code-expression
4cd29ef @ingydotnet New pegex syntax
authored
68 ending
8b41b47 @ingydotnet assignment
authored
69
8c71181 @ingydotnet Change _ to - in rule names
authored
70 variable-name: /( ALPHA WORD* )/
fccbbb5 @ingydotnet New repo
authored
71
8c71181 @ingydotnet Change _ to - in rule names
authored
72 code-statement:
73 code-expression
74 assertion-call?
4cd29ef @ingydotnet New pegex syntax
authored
75 ending
8b41b47 @ingydotnet assignment
authored
76
4cd29ef @ingydotnet New pegex syntax
authored
77 ending: /(: ';' | EOL )/ | =ending2
26ad461 @ingydotnet Enable implied trailing semis within functions
authored
78
4cd29ef @ingydotnet New pegex syntax
authored
79 ending2: /- '}'/
4e33257 @ingydotnet Refactored the grammar to look like p6rules.
authored
80
8c71181 @ingydotnet Change _ to - in rule names
authored
81 code-expression:
82 code-object
83 call-call*
84
85 call-call:
86 !assertion-call-test
87 call-indicator
88 code-object
89
90 code-object:
91 | function-object
92 | point-object
93 | string-object
94 | number-object
95 | call-object
96
97 function-object:
98 function-signature?
99 function-start
100 ( + | assignment-statement | code-statement )*
4cd29ef @ingydotnet New pegex syntax
authored
101 /- '}'/
1e918cd @ingydotnet Latest grammar to match pm5 implementation.
authored
102
8c71181 @ingydotnet Change _ to - in rule names
authored
103 function-start: /- ( '{' ) -/
e2cb718 @ingydotnet pegex refo
authored
104
8c71181 @ingydotnet Change _ to - in rule names
authored
105 function-signature:
4cd29ef @ingydotnet New pegex syntax
authored
106 /'(' -/
8c71181 @ingydotnet Change _ to - in rule names
authored
107 function-variables?
4cd29ef @ingydotnet New pegex syntax
authored
108 /- ')'/
1e918cd @ingydotnet Latest grammar to match pm5 implementation.
authored
109
8c71181 @ingydotnet Change _ to - in rule names
authored
110 function-variables:
111 function-variable+ % /- ',' -/
1e918cd @ingydotnet Latest grammar to match pm5 implementation.
authored
112
8c71181 @ingydotnet Change _ to - in rule names
authored
113 function-variable: /( ALPHA WORD* )/
2c756a3 @ingydotnet reworked the grammar to match new spec
authored
114
8c71181 @ingydotnet Change _ to - in rule names
authored
115 point-object: /( '*' LOWER WORD* )/
fccbbb5 @ingydotnet New repo
authored
116
8c71181 @ingydotnet Change _ to - in rule names
authored
117 string-object: quoted-string
6ffcfc3 @ingydotnet added integer_call to grammar
authored
118
8c71181 @ingydotnet Change _ to - in rule names
authored
119 number-object: number
8a55f00 @ingydotnet Grammar work.
authored
120
8c71181 @ingydotnet Change _ to - in rule names
authored
121 call-object:
122 call-name
123 call-argument-list?
fccbbb5 @ingydotnet New repo
authored
124
8c71181 @ingydotnet Change _ to - in rule names
authored
125 call-name: user-call | core-call
fccbbb5 @ingydotnet New repo
authored
126
8c71181 @ingydotnet Change _ to - in rule names
authored
127 user-call: /( LOWER WORD* )/
fccbbb5 @ingydotnet New repo
authored
128
8c71181 @ingydotnet Change _ to - in rule names
authored
129 core-call: /( UPPER WORD* )/
fccbbb5 @ingydotnet New repo
authored
130
8c71181 @ingydotnet Change _ to - in rule names
authored
131 call-indicator: /(: '.' - | - '.' )/
fccbbb5 @ingydotnet New repo
authored
132
8c71181 @ingydotnet Change _ to - in rule names
authored
133 call-argument-list:
4cd29ef @ingydotnet New pegex syntax
authored
134 /'(' -/
8c71181 @ingydotnet Change _ to - in rule names
authored
135 call-argument* % /- ',' -/
4cd29ef @ingydotnet New pegex syntax
authored
136 /- ')'/
42ff323 @ingydotnet rework grammar to not need start and stop rules.
authored
137
8c71181 @ingydotnet Change _ to - in rule names
authored
138 call-argument: code-expression
fccbbb5 @ingydotnet New repo
authored
139
8c71181 @ingydotnet Change _ to - in rule names
authored
140 assertion-call-test: / call-indicator (:EQ|OK|HAS) /
2c756a3 @ingydotnet reworked the grammar to match new spec
authored
141
8c71181 @ingydotnet Change _ to - in rule names
authored
142 assertion-call:
143 | +assertion-eq
144 | +assertion-ok
145 | +assertion-has
2c756a3 @ingydotnet reworked the grammar to match new spec
authored
146
8c71181 @ingydotnet Change _ to - in rule names
authored
147 assertion-eq:
148 | +assertion-operator-eq
149 | +assertion-function-eq
fccbbb5 @ingydotnet New repo
authored
150
8c71181 @ingydotnet Change _ to - in rule names
authored
151 assertion-operator-eq:
4cd29ef @ingydotnet New pegex syntax
authored
152 /+ '==' +/
8c71181 @ingydotnet Change _ to - in rule names
authored
153 code-expression
fccbbb5 @ingydotnet New repo
authored
154
8c71181 @ingydotnet Change _ to - in rule names
authored
155 assertion-function-eq:
156 / call-indicator 'EQ(' /
157 code-expression
4cd29ef @ingydotnet New pegex syntax
authored
158 / ')' /
2c756a3 @ingydotnet reworked the grammar to match new spec
authored
159
8c71181 @ingydotnet Change _ to - in rule names
authored
160 assertion-ok: assertion-function-ok
2c756a3 @ingydotnet reworked the grammar to match new spec
authored
161
8c71181 @ingydotnet Change _ to - in rule names
authored
162 assertion-function-ok: / call-indicator ('OK') empty-parens? /
fccbbb5 @ingydotnet New repo
authored
163
8c71181 @ingydotnet Change _ to - in rule names
authored
164 assertion-has: +assertion-operator-has | +assertion-function-has
2c756a3 @ingydotnet reworked the grammar to match new spec
authored
165
8c71181 @ingydotnet Change _ to - in rule names
authored
166 assertion-operator-has:
4cd29ef @ingydotnet New pegex syntax
authored
167 /+ '~~' +/
8c71181 @ingydotnet Change _ to - in rule names
authored
168 code-expression
fccbbb5 @ingydotnet New repo
authored
169
8c71181 @ingydotnet Change _ to - in rule names
authored
170 assertion-function-has:
171 / call-indicator 'HAS(' /
172 code-expression
4cd29ef @ingydotnet New pegex syntax
authored
173 / ')' /
fccbbb5 @ingydotnet New repo
authored
174
8c71181 @ingydotnet Change _ to - in rule names
authored
175 empty-parens: /(: '(' - ')' )/
f892545 @ingydotnet The new and reduced testml grammar.
authored
176
177 # TestML Data Section
8c71181 @ingydotnet Change _ to - in rule names
authored
178 block-marker: '==='
179 point-marker: '---'
4cd29ef @ingydotnet New pegex syntax
authored
180
8c71181 @ingydotnet Change _ to - in rule names
authored
181 data-section: data-block*
fccbbb5 @ingydotnet New repo
authored
182
8c71181 @ingydotnet Change _ to - in rule names
authored
183 data-block:
184 block-header
185 .( blank-line | comment )*
186 block-point*
fccbbb5 @ingydotnet New repo
authored
187
8c71181 @ingydotnet Change _ to - in rule names
authored
188 block-header:
189 block-marker
190 ( blanks block-label )?
191 blank-line
fccbbb5 @ingydotnet New repo
authored
192
8c71181 @ingydotnet Change _ to - in rule names
authored
193 block-label: unquoted-string
fccbbb5 @ingydotnet New repo
authored
194
8c71181 @ingydotnet Change _ to - in rule names
authored
195 block-point: lines-point | phrase-point
fccbbb5 @ingydotnet New repo
authored
196
8c71181 @ingydotnet Change _ to - in rule names
authored
197 lines-point:
198 point-marker
4cd29ef @ingydotnet New pegex syntax
authored
199 blanks
8c71181 @ingydotnet Change _ to - in rule names
authored
200 point-name
201 blank-line
202 point-lines
fccbbb5 @ingydotnet New repo
authored
203
8c71181 @ingydotnet Change _ to - in rule names
authored
204 point-lines: /(
4cd29ef @ingydotnet New pegex syntax
authored
205 (:
206 (!
2788a84 @ingydotnet Allow === and --- in data.
authored
207 (: block-marker | point-marker )
208 SPACE WORD
4cd29ef @ingydotnet New pegex syntax
authored
209 )
210 line
211 )*
f008eb7 @ingydotnet change (?: to (:
authored
212 )/
fccbbb5 @ingydotnet New repo
authored
213
8c71181 @ingydotnet Change _ to - in rule names
authored
214 phrase-point:
215 point-marker
4cd29ef @ingydotnet New pegex syntax
authored
216 blanks
8c71181 @ingydotnet Change _ to - in rule names
authored
217 point-name
4cd29ef @ingydotnet New pegex syntax
authored
218 / COLON BLANK /
8c71181 @ingydotnet Change _ to - in rule names
authored
219 point-phrase
4cd29ef @ingydotnet New pegex syntax
authored
220 / EOL /
221 /(:
222 comment |
8c71181 @ingydotnet Change _ to - in rule names
authored
223 blank-line
4cd29ef @ingydotnet New pegex syntax
authored
224 )*/
ac1735c @ingydotnet Add regex whitespace to the grammar.
authored
225
8c71181 @ingydotnet Change _ to - in rule names
authored
226 point-name:
4cd29ef @ingydotnet New pegex syntax
authored
227 /(
8c71181 @ingydotnet Change _ to - in rule names
authored
228 user-point-name |
229 core-point-name
4cd29ef @ingydotnet New pegex syntax
authored
230 )/
ac1735c @ingydotnet Add regex whitespace to the grammar.
authored
231
8c71181 @ingydotnet Change _ to - in rule names
authored
232 user-point-name: / LOWER WORD* /
ac1735c @ingydotnet Add regex whitespace to the grammar.
authored
233
8c71181 @ingydotnet Change _ to - in rule names
authored
234 core-point-name: / UPPER WORD* /
4e33257 @ingydotnet Refactored the grammar to look like p6rules.
authored
235
8c71181 @ingydotnet Change _ to - in rule names
authored
236 point-phrase: unquoted-string
4cd29ef @ingydotnet New pegex syntax
authored
237
4287964 @ingydotnet add lisp to vim setttings
authored
238 # vim: sw=2 lisp:
Something went wrong with that request. Please try again.