Lines Matching refs:lexer
555 lexer = Lexer('a b //a\n "c"', 0)
557 self.assertEqual(lexer.start, 0)
558 self.assertEqual(lexer.end, 1)
559 self.assertEqual(lexer.token, Token.IDENT)
560 self.assertEqual(lexer.literal, 'a')
561 lexer.consume(Token.IDENT)
563 self.assertEqual(lexer.start, 2)
564 self.assertEqual(lexer.end, 3)
565 self.assertEqual(lexer.token, Token.IDENT)
566 self.assertEqual(lexer.literal, 'b')
567 lexer.consume(Token.IDENT)
569 self.assertEqual(lexer.start, 9)
570 self.assertEqual(lexer.end, 12)
571 self.assertEqual(lexer.token, Token.STRING)
572 self.assertEqual(lexer.literal, 'c')
573 lexer.consume(Token.STRING)
575 self.assertEqual(lexer.start, 12)
576 self.assertEqual(lexer.end, 12)
577 self.assertEqual(lexer.token, Token.EOF)
578 self.assertEqual(lexer.literal, None)
584 lexer = Lexer('a b', 2)
586 self.assertEqual(lexer.start, 2)
587 self.assertEqual(lexer.end, 3)
588 self.assertEqual(lexer.token, Token.IDENT)
589 self.assertEqual(lexer.literal, 'b')
590 lexer.consume(Token.IDENT)
592 self.assertEqual(lexer.start, 3)
593 self.assertEqual(lexer.end, 3)
594 self.assertEqual(lexer.token, Token.EOF)
595 self.assertEqual(lexer.literal, None)
596 lexer.consume(Token.EOF)
601 lexer = Lexer('content', path='test_path')
602 self.assertEqual(lexer.path, 'test_path')