Lines Matching refs:tok
138 tok = lexer.peek()
139 self.assertEqual(ninja.TK.EOF, tok.kind)
143 tok = lexer.peek()
144 self.assertEqual(ninja.TK.NEWLINE, tok.kind)
147 tok = lexer.peek()
148 self.assertEqual(ninja.TK.NEWLINE, tok.kind)
151 tok = lexer.peek()
152 self.assertEqual(ninja.TK.NEWLINE, tok.kind)
155 tok = lexer.peek()
156 self.assertEqual(ninja.TK.NEWLINE, tok.kind)
160 tok = lexer.peek()
161 self.assertEqual(ninja.TK.NEWLINE, tok.kind)
164 tok = lexer.peek()
165 self.assertEqual(ninja.TK.NEWLINE, tok.kind)
168 tok = lexer.peek()
169 self.assertEqual(ninja.TK.NEWLINE, tok.kind)
173 tok = lexer.peek()
174 self.assertEqual(ninja.TK.NEWLINE, tok.kind)
179 tok = lexer.peek()
180 self.assertEqual(ninja.TK.SPACE, tok.kind)
181 tok = lexer.peek() # Again
182 self.assertEqual(ninja.TK.SPACE, tok.kind) # Not changed
184 tok = lexer.lex() # Consume
185 self.assertEqual(ninja.TK.SPACE, tok.kind) # Not changed
186 tok = lexer.lex()
187 self.assertEqual(ninja.TK.IDENT, tok.kind)
191 tok = lexer.lex()
192 self.assertEqual(ninja.TK.SPACE, tok.kind)
195 tok = lexer.lex()
196 self.assertEqual(ninja.TK.SPACE, tok.kind)
199 tok = lexer.lex()
200 self.assertEqual(ninja.TK.SPACE, tok.kind)
203 tok = lexer.lex()
204 self.assertEqual(ninja.TK.SPACE, tok.kind)
207 tok = lexer.lex()
208 self.assertEqual(ninja.TK.SPACE, tok.kind)
209 tok = lexer.lex()
210 self.assertEqual(ninja.TK.IDENT, tok.kind)
215 tok = lexer.lex()
216 self.assertEqual(ninja.TK.IDENT, tok.kind)
217 self.assertEqual(1, tok.line)
218 self.assertEqual(1, tok.column)
220 tok = lexer.lex()
221 self.assertEqual(ninja.TK.IDENT, tok.kind)
222 self.assertEqual(1, tok.line)
223 self.assertEqual(3, tok.column)
227 tok = lexer.lex()
228 self.assertEqual(ninja.TK.IDENT, tok.kind)
229 self.assertEqual(1, tok.line)
230 self.assertEqual(1, tok.column)
231 tok = lexer.lex()
232 self.assertEqual(ninja.TK.IDENT, tok.kind)
233 self.assertEqual(2, tok.line)
234 self.assertEqual(3, tok.column)
237 tok = lexer.lex()
238 self.assertEqual(ninja.TK.IDENT, tok.kind)
239 self.assertEqual(1, tok.line)
240 self.assertEqual(1, tok.column)
241 tok = lexer.lex()
242 self.assertEqual(ninja.TK.IDENT, tok.kind)
243 self.assertEqual(2, tok.line)
244 self.assertEqual(1, tok.column)
247 tok = lexer.lex()
248 self.assertEqual(ninja.TK.IDENT, tok.kind)
249 self.assertEqual(1, tok.line)
250 self.assertEqual(1, tok.column)
251 tok = lexer.lex()
252 self.assertEqual(ninja.TK.IDENT, tok.kind)
253 self.assertEqual(1, tok.line)
254 self.assertEqual(7, tok.column)
255 tok = lexer.lex()
256 self.assertEqual(ninja.TK.COLON, tok.kind)
257 self.assertEqual(1, tok.line)
258 self.assertEqual(8, tok.column)
259 tok = lexer.lex()
260 self.assertEqual(ninja.TK.IDENT, tok.kind)
261 self.assertEqual(2, tok.line)
262 self.assertEqual(1, tok.column)
266 tok = lexer.lex()
267 self.assertEqual(ninja.TK.IDENT, tok.kind)
268 self.assertEqual(1, tok.line)
269 self.assertEqual(1, tok.column)
270 tok = lexer.lex()
271 self.assertEqual(ninja.TK.IDENT, tok.kind)
272 self.assertEqual(4, tok.line)
273 self.assertEqual(1, tok.column)
278 tok = lexer.lex()
279 self.assertEqual(ninja.TK.IDENT, tok.kind)
280 self.assertEqual(1, tok.line)
281 self.assertEqual(1, tok.column)
283 tok = lexer.lex()
284 self.assertEqual(ninja.TK.IDENT, tok.kind)
285 self.assertEqual(1, tok.line)
286 self.assertEqual(3, tok.column)
288 tok = lexer.lex()
289 self.assertEqual(ninja.TK.NEWLINE, tok.kind)
290 self.assertEqual(1, tok.line)
291 self.assertEqual(4, tok.column)
294 tok = lexer.lex()
295 self.assertEqual(ninja.TK.SPACE, tok.kind)
296 self.assertEqual(2, tok.line)
297 self.assertEqual(1, tok.column)
299 tok = lexer.lex()
300 self.assertEqual(ninja.TK.IDENT, tok.kind)
301 self.assertEqual(2, tok.line)
302 self.assertEqual(2, tok.column)
306 tok = lexer.lex()
307 self.assertEqual(ninja.TK.IDENT, tok.kind)
310 tok = lexer.lex()
311 self.assertEqual(ninja.TK.IDENT, tok.kind)
314 tok = lexer.lex()
315 self.assertEqual(ninja.TK.IDENT, tok.kind)
318 tok = lexer.lex()
319 self.assertEqual(ninja.TK.IDENT, tok.kind)
322 tok = lexer.lex()
323 self.assertEqual(ninja.TK.IDENT, tok.kind)
326 tok = lexer.lex()
327 self.assertEqual(ninja.TK.IDENT, tok.kind)
331 tok = lexer.lex()
332 self.assertEqual(ninja.TK.ASSIGN, tok.kind)
336 tok = lexer.lex()
337 self.assertEqual(ninja.TK.COLON, tok.kind)
341 tok = lexer.lex()
342 self.assertEqual(ninja.TK.PIPE, tok.kind)
346 tok = lexer.lex()
347 self.assertEqual(ninja.TK.PIPE2, tok.kind)
365 tok = lexer.lex_path()
366 self.assertEqual(ninja.TK.PATH, tok.kind)
367 self.assertEqual(1, tok.line)
368 self.assertEqual(1, tok.column)
369 self.assertEqual(('t', 'path1'), tok.value)
371 tok = lexer.lex_path()
372 self.assertEqual(ninja.TK.PATH, tok.kind)
373 self.assertEqual(1, tok.line)
374 self.assertEqual(7, tok.column)
375 self.assertEqual(('t', 'path2'), tok.value)
379 tok = lexer.lex_string()
380 self.assertEqual(ninja.TK.STRING, tok.kind)
381 self.assertEqual(1, tok.line)
382 self.assertEqual(1, tok.column)
383 self.assertEqual(('t', 'string with spaces'), tok.value)
388 tok = lexer.lex_path()
389 self.assertEqual(ninja.TK.PATH, tok.kind)
390 self.assertEqual(1, tok.line)
391 self.assertEqual(1, tok.column)
392 self.assertEqual(('t', char), tok.value)
397 tok = lexer.lex_string()
398 self.assertEqual(ninja.TK.STRING, tok.kind)
399 self.assertEqual(1, tok.line)
400 self.assertEqual(1, tok.column)
401 self.assertEqual(('t', char), tok.value)
424 tok = lexer.lex_path()
425 self.assertEqual(ninja.TK.PATH, tok.kind)
426 self.assertEqual(1, tok.line)
427 self.assertEqual(1, tok.column)
428 self.assertEqual(('t', 'path'), tok.value)
432 tok = lexer.lex_path()
433 self.assertIs(type(tok.value), ninja.EvalString)
434 self.assertEqual(('v', 'a',), tok.value)
437 tok = lexer.lex_path()
438 self.assertIs(type(tok.value), ninja.EvalString)
439 self.assertEqual(('v', 'a',), tok.value)
442 tok = lexer.lex_path()
443 self.assertIs(type(tok.value), ninja.EvalString)
444 self.assertEqual(('tv' ,'path/', 'a'), tok.value)
448 tok = lexer.lex_string()
449 self.assertIs(type(tok.value), ninja.EvalString)
450 self.assertEqual(('v', 'a'), tok.value)
453 tok = lexer.lex_string()
454 self.assertIs(type(tok.value), ninja.EvalString)
455 self.assertEqual(('v', 'a'), tok.value)
458 tok = lexer.lex_string()
459 self.assertIs(type(tok.value), ninja.EvalString)
460 self.assertEqual(('tv', 'path/', 'a'), tok.value)
463 tok = lexer.lex_string()
464 self.assertIs(type(tok.value), ninja.EvalString)
465 self.assertEqual(('tvt', 'path/', 'a', ' with space'), tok.value)