Codebase list golang-github-timberio-go-datemath / 83b082c2-fbe0-47bd-aaf1-3c95f53ab1ce/upstream
Import upstream version 0.1.0+git20200608.85899cb Debian Janitor 2 years ago
3 changed file(s) with 47 addition(s) and 31 deletion(s). Raw diff Collapse all Expand all
8181 return tDIGIT
8282
8383 "now"
84 return tNOW
84 return tNOW
8585
8686 "+"
8787 return tPLUS
9696 return tPIPES
9797
9898 "/"
99 return tBACKSLASH
99 return tBACKSLASH
100100
101101 [yMwdbhHms]
102102 switch l.buf[0] {
133133 {eof}
134134 return eofCode
135135
136 no.
137 return tINVALID_TOKEN
138
136139 .
137 return tINVALID_TOKEN
140 return tINVALID_TOKEN
138141
139142 %%
140143
6969
7070 goto yystart1
7171
72 goto yystate0 // silence unused label error
73 goto yystate1 // silence unused label error
7274 yystate1:
7375 l.next()
7476 yystart1:
9698 case l.current == 'n':
9799 goto yystate13
98100 case l.current == '|':
99 goto yystate16
101 goto yystate17
100102 case l.current >= '0' && l.current <= '9':
101103 goto yystate8
102104 case l.current >= '\x01' && l.current <= '\t' || l.current >= '\v' && l.current <= '*' || l.current == ',' || l.current >= ';' && l.current <= 'G' || l.current >= 'I' && l.current <= 'L' || l.current >= 'N' && l.current <= 'S' || l.current >= 'U' && l.current <= 'Y' || l.current >= '[' && l.current <= 'a' || l.current == 'c' || l.current >= 'e' && l.current <= 'g' || l.current >= 'i' && l.current <= 'l' || l.current >= 'o' && l.current <= 'r' || l.current >= 't' && l.current <= 'v' || l.current == 'x' || l.current == 'z' || l.current == '{' || l.current >= '}' && l.current <= 'ÿ':
109111
110112 yystate3:
111113 l.next()
112 goto yyrule13
114 goto yyrule14
113115
114116 yystate4:
115117 l.next()
151153 l.next()
152154 switch {
153155 default:
154 goto yyrule13
156 goto yyrule14
155157 case l.current == 'o':
156158 goto yystate14
157159 }
162164 default:
163165 goto yyabort
164166 case l.current == 'w':
167 goto yystate16
168 case l.current >= '\x01' && l.current <= '\t' || l.current >= '\v' && l.current <= 'v' || l.current >= 'x' && l.current <= 'ÿ':
165169 goto yystate15
166170 }
167171
168172 yystate15:
169173 l.next()
174 goto yyrule13
175
176 yystate16:
177 l.next()
170178 goto yyrule2
171179
172 yystate16:
173 l.next()
174 switch {
175 default:
176 goto yyrule13
180 yystate17:
181 l.next()
182 switch {
183 default:
184 goto yyrule14
177185 case l.current == '|':
178 goto yystate17
179 }
180
181 yystate17:
186 goto yystate18
187 }
188
189 yystate18:
182190 l.next()
183191 goto yyrule6
184192
267275
268276 return eofCode
269277 }
270 yyrule13: // .
271 if true { // avoid go vet determining the below panic will not be reached
278 yyrule13: // no.
279 {
272280
273281 return tINVALID_TOKEN
274282 }
283 yyrule14: // .
284 {
285
286 return tINVALID_TOKEN
287 }
275288 panic("unreachable")
276289
290 goto yyabort // silence unused label error
291
277292 yyabort: // no lexem recognized
278 //
279 // silence unused label errors for build and satisfy go vet reachability analysis
280 //
281 {
282 if false {
283 goto yyabort
284 }
285 if false {
286 goto yystate0
287 }
288 if false {
289 goto yystate1
290 }
291 }
292293
293294 // should never get here
294295 panic("scanner internal error")
252252 out: "2014-05-30T20:21:21Z",
253253
254254 err: fmt.Errorf(`day 35 out of bounds for month 5 at character 11 starting with "5"`),
255 },
256 {
257 in: "npe",
258 err: fmt.Errorf(`syntax error: unexpected tINVALID_TOKEN, expecting tNOW or tDIGIT at character 2 starting with "n"`),
259 },
260 {
261 in: "now-nope",
262 err: fmt.Errorf(`syntax error: unexpected tINVALID_TOKEN, expecting tUNIT at character 8 starting with "nop"`),
263 },
264 {
265 in: "definitely-nope",
266 err: fmt.Errorf(`syntax error: unexpected tUNIT, expecting tNOW or tDIGIT at character 2 starting with "d"`),
255267 },
256268 }
257269 for _, tt := range tests {