Lines Matching refs:lexer
559 def __init__(self, lexer, message): argument
564 Lexer.compute_line_column(lexer.buf, lexer.start)
576 def __init__(self, lexer, inherited_env=None): argument
578 self.lexer = lexer
587 lexer = self.lexer
588 while lexer.token != Token.EOF:
589 if lexer.token == Token.IDENT:
591 if lexer.token in {Token.ASSIGN, Token.ASSIGNPLUS}:
592 self.parse_assign(ident, lexer.token)
593 elif lexer.token in {Token.LBRACE, Token.LPAREN}:
596 raise ParseError(lexer,
597 'unexpected token ' + lexer.token.name)
599 raise ParseError(lexer, 'unexpected token ' + lexer.token.name)
600 lexer.consume(Token.EOF)
616 lexer = self.lexer
617 lexer.consume(assign_token)
627 properties['_path'] = String(self.lexer.path)
633 ident = self.lexer.literal
634 self.lexer.consume(Token.IDENT)
646 lexer = self.lexer
647 if lexer.literal in {'true', 'false'}:
648 result = Bool(lexer.literal == 'true')
650 result = self.create_var_ref(lexer.literal)
651 lexer.consume(Token.IDENT)
657 lexer = self.lexer
658 string = String(lexer.literal)
659 lexer.consume(Token.STRING)
665 lexer = self.lexer
666 integer = Integer(int(lexer.literal))
667 lexer.consume(Token.INTEGER)
673 lexer = self.lexer
674 token = lexer.token
686 lexer.consume(Token.LPAREN)
688 lexer.consume(Token.RPAREN)
690 raise ParseError(lexer, 'unexpected token ' + token.name)
695 lexer = self.lexer
697 while lexer.token == Token.PLUS:
698 lexer.consume(Token.PLUS)
706 lexer = self.lexer
707 lexer.consume(Token.LBRACKET)
708 while lexer.token != Token.RBRACKET:
710 if lexer.token == Token.COMMA:
711 lexer.consume(Token.COMMA)
712 lexer.consume(Token.RBRACKET)
719 lexer = self.lexer
721 is_func_syntax = lexer.token == Token.LPAREN
723 lexer.consume(Token.LPAREN)
725 lexer.consume(Token.LBRACE)
727 while lexer.token != Token.RBRACE and lexer.token != Token.RPAREN:
728 if lexer.token != Token.IDENT:
729 raise ParseError(lexer, 'unexpected token ' + lexer.token.name)
732 if lexer.token == Token.ASSIGN:
733 lexer.consume(Token.ASSIGN)
735 lexer.consume(Token.COLON)
740 if lexer.token == Token.COMMA:
741 lexer.consume(Token.COMMA)
744 lexer.consume(Token.RPAREN)
746 lexer.consume(Token.RBRACE)