Lines Matching full:stream
32 self.stream = environment._tokenize(source, name, filename, state)
50 lineno = self.stream.current.lineno
100 if self.stream.current.type in ('variable_end', 'block_end', 'rparen'):
103 return self.stream.current.test_any(extra_end_rules)
115 token = self.stream.current
122 return getattr(self, 'parse_' + self.stream.current.value)()
147 reached. Per default the active token in the stream at the end of
152 self.stream.skip_if('colon')
156 self.stream.expect('block_end')
161 if self.stream.current.type == 'eof':
165 next(self.stream)
170 lineno = next(self.stream).lineno
172 self.stream.expect('assign')
178 lineno = self.stream.expect('name:for').lineno
180 self.stream.expect('name:in')
184 if self.stream.skip_if('name:if'):
186 recursive = self.stream.skip_if('name:recursive')
188 if next(self.stream).value == 'endfor':
197 node = result = nodes.If(lineno=self.stream.expect('name:if').lineno)
202 token = next(self.stream)
204 new_node = nodes.If(lineno=self.stream.current.lineno)
217 node = nodes.Block(lineno=next(self.stream).lineno)
218 node.name = self.stream.expect('name').value
219 node.scoped = self.stream.skip_if('name:scoped')
224 if self.stream.current.type == 'sub':
230 self.stream.skip_if('name:' + node.name)
234 node = nodes.Extends(lineno=next(self.stream).lineno)
239 if self.stream.current.test_any('name:with', 'name:without') and \
240 self.stream.look().test('name:context'):
241 node.with_context = next(self.stream).value == 'with'
242 self.stream.skip()
248 node = nodes.Include(lineno=next(self.stream).lineno)
250 if self.stream.current.test('name:ignore') and \
251 self.stream.look().test('name:missing'):
253 self.stream.skip(2)
259 node = nodes.Import(lineno=next(self.stream).lineno)
261 self.stream.expect('name:as')
266 node = nodes.FromImport(lineno=next(self.stream).lineno)
268 self.stream.expect('name:import')
272 if self.stream.current.value in ('with', 'without') and \
273 self.stream.look().test('name:context'):
274 node.with_context = next(self.stream).value == 'with'
275 self.stream.skip()
281 self.stream.expect('comma')
282 if self.stream.current.type == 'name':
290 if self.stream.skip_if('name:as'):
295 if parse_context() or self.stream.current.type != 'comma':
301 self.stream.skip_if('comma')
307 self.stream.expect('lparen')
308 while self.stream.current.type != 'rparen':
310 self.stream.expect('comma')
313 if self.stream.skip_if('assign'):
316 self.stream.expect('rparen')
319 node = nodes.CallBlock(lineno=next(self.stream).lineno)
320 if self.stream.current.type == 'lparen':
333 node = nodes.FilterBlock(lineno=next(self.stream).lineno)
340 node = nodes.Macro(lineno=next(self.stream).lineno)
348 node = nodes.Output(lineno=next(self.stream).lineno)
350 while self.stream.current.type != 'block_end':
352 self.stream.expect('comma')
366 token = self.stream.expect('name')
390 lineno = self.stream.current.lineno
392 while self.stream.skip_if('name:if'):
394 if self.stream.skip_if('name:else'):
399 lineno = self.stream.current.lineno
403 lineno = self.stream.current.lineno
405 while self.stream.skip_if('name:or'):
408 lineno = self.stream.current.lineno
412 lineno = self.stream.current.lineno
414 while self.stream.skip_if('name:and'):
417 lineno = self.stream.current.lineno
421 if self.stream.current.test('name:not'):
422 lineno = next(self.stream).lineno
427 lineno = self.stream.current.lineno
431 token_type = self.stream.current.type
433 next(self.stream)
435 elif self.stream.skip_if('name:in'):
437 elif self.stream.current.test('name:not') and \
438 self.stream.look().test('name:in'):
439 self.stream.skip(2)
443 lineno = self.stream.current.lineno
449 lineno = self.stream.current.lineno
451 while self.stream.current.type == 'add':
452 next(self.stream)
455 lineno = self.stream.current.lineno
459 lineno = self.stream.current.lineno
461 while self.stream.current.type == 'sub':
462 next(self.stream)
465 lineno = self.stream.current.lineno
469 lineno = self.stream.current.lineno
471 while self.stream.current.type == 'tilde':
472 next(self.stream)
479 lineno = self.stream.current.lineno
481 while self.stream.current.type == 'mul':
482 next(self.stream)
485 lineno = self.stream.current.lineno
489 lineno = self.stream.current.lineno
491 while self.stream.current.type == 'div':
492 next(self.stream)
495 lineno = self.stream.current.lineno
499 lineno = self.stream.current.lineno
501 while self.stream.current.type == 'floordiv':
502 next(self.stream)
505 lineno = self.stream.current.lineno
509 lineno = self.stream.current.lineno
511 while self.stream.current.type == 'mod':
512 next(self.stream)
515 lineno = self.stream.current.lineno
519 lineno = self.stream.current.lineno
521 while self.stream.current.type == 'pow':
522 next(self.stream)
525 lineno = self.stream.current.lineno
529 token_type = self.stream.current.type
530 lineno = self.stream.current.lineno
532 next(self.stream)
535 next(self.stream)
545 token = self.stream.current
554 next(self.stream)
556 next(self.stream)
559 while self.stream.current.type == 'string':
560 buf.append(self.stream.current.value)
561 next(self.stream)
564 next(self.stream)
567 next(self.stream)
569 self.stream.expect('rparen')
598 lineno = self.stream.current.lineno
609 self.stream.expect('comma')
613 if self.stream.current.type == 'comma':
617 lineno = self.stream.current.lineno
629 describe_token(self.stream.current))
634 token = self.stream.expect('lbracket')
636 while self.stream.current.type != 'rbracket':
638 self.stream.expect('comma')
639 if self.stream.current.type == 'rbracket':
642 self.stream.expect('rbracket')
646 token = self.stream.expect('lbrace')
648 while self.stream.current.type != 'rbrace':
650 self.stream.expect('comma')
651 if self.stream.current.type == 'rbrace':
654 self.stream.expect('colon')
657 self.stream.expect('rbrace')
662 token_type = self.stream.current.type
675 token_type = self.stream.current.type
678 elif token_type == 'name' and self.stream.current.value == 'is':
689 token = next(self.stream)
691 attr_token = self.stream.current
692 next(self.stream)
703 while self.stream.current.type != 'rbracket':
705 self.stream.expect('comma')
707 self.stream.expect('rbracket')
716 lineno = self.stream.current.lineno
718 if self.stream.current.type == 'colon':
719 next(self.stream)
723 if self.stream.current.type != 'colon':
725 next(self.stream)
728 if self.stream.current.type == 'colon':
730 elif self.stream.current.type not in ('rbracket', 'comma'):
735 if self.stream.current.type == 'colon':
736 next(self.stream)
737 if self.stream.current.type not in ('rbracket', 'comma'):
747 token = self.stream.expect('lparen')
758 while self.stream.current.type != 'rparen':
760 self.stream.expect('comma')
762 if self.stream.current.type == 'rparen':
764 if self.stream.current.type == 'mul':
766 next(self.stream)
768 elif self.stream.current.type == 'pow':
770 next(self.stream)
774 if self.stream.current.type == 'name' and \
775 self.stream.look().type == 'assign':
776 key = self.stream.current.value
777 self.stream.skip(2)
786 self.stream.expect('rparen')
794 while self.stream.current.type == 'pipe' or start_inline:
796 next(self.stream)
797 token = self.stream.expect('name')
799 while self.stream.current.type == 'dot':
800 next(self.stream)
801 name += '.' + self.stream.expect('name').value
802 if self.stream.current.type == 'lparen':
814 token = next(self.stream)
815 if self.stream.current.test('name:not'):
816 next(self.stream)
820 name = self.stream.expect('name').value
821 while self.stream.current.type == 'dot':
822 next(self.stream)
823 name += '.' + self.stream.expect('name').value
826 if self.stream.current.type == 'lparen':
828 elif self.stream.current.type in ('name', 'string', 'integer',
831 self.stream
833 if self.stream.current.test('name:is'):
859 while self.stream:
860 token = self.stream.current
865 next(self.stream)
867 next(self.stream)
869 self.stream.expect('variable_end')
872 next(self.stream)
874 self.stream.current.test_any(*end_tokens):
881 self.stream.expect('block_end')