• Home
  • Raw
  • Download

Lines Matching refs:Lexer

9 class Lexer(object):  class
43 self.mode_ = Lexer.MODE_NORMAL_
54 if token_type != Lexer.NEWLINE:
62 self.scan_over_(Lexer.CHAR_WHITESPACE_)
76 return (Lexer.NEWLINE, None, location)
81 return (Lexer.NEWLINE, None, location)
83 self.scan_until_(Lexer.CHAR_NEWLINE_)
84 return (Lexer.COMMENT, text[start:self.pos_], location)
86 if self.mode_ is Lexer.MODE_FILENAME_:
96 self.mode_ = Lexer.MODE_NORMAL_
97 return (Lexer.FILENAME, text[start + 1:self.pos_ - 1], location)
99 if cur_char == "\\" and next_char in Lexer.CHAR_DIGIT_:
101 self.scan_over_(Lexer.CHAR_DIGIT_)
102 return (Lexer.CID, int(text[start + 1:self.pos_], 10), location)
105 self.scan_over_(Lexer.CHAR_NAME_CONTINUATION_)
113 if not Lexer.RE_GLYPHCLASS.match(glyphclass):
117 return (Lexer.GLYPHCLASS, glyphclass, location)
118 if cur_char in Lexer.CHAR_NAME_START_:
120 self.scan_over_(Lexer.CHAR_NAME_CONTINUATION_)
123 self.mode_ = Lexer.MODE_FILENAME_
124 return (Lexer.NAME, token, location)
127 self.scan_over_(Lexer.CHAR_HEXDIGIT_)
128 return (Lexer.NUMBER, int(text[start:self.pos_], 16), location)
129 if cur_char in Lexer.CHAR_DIGIT_:
130 self.scan_over_(Lexer.CHAR_DIGIT_)
132 return (Lexer.NUMBER, int(text[start:self.pos_], 10), location)
134 self.scan_over_(Lexer.CHAR_DIGIT_)
135 return (Lexer.FLOAT, float(text[start:self.pos_]), location)
136 if cur_char == "-" and next_char in Lexer.CHAR_DIGIT_:
138 self.scan_over_(Lexer.CHAR_DIGIT_)
140 return (Lexer.NUMBER, int(text[start:self.pos_], 10), location)
142 self.scan_over_(Lexer.CHAR_DIGIT_)
143 return (Lexer.FLOAT, float(text[start:self.pos_]), location)
144 if cur_char in Lexer.CHAR_SYMBOL_:
146 return (Lexer.SYMBOL, cur_char, location)
154 return (Lexer.STRING, string, location)
176 self.scan_until_(Lexer.CHAR_NEWLINE_)
177 self.scan_over_(Lexer.CHAR_NEWLINE_)
185 return (Lexer.ANONYMOUS_BLOCK, split[0], location)
207 if token_type is Lexer.NAME and token == "include":
209 if fname_type is not Lexer.FILENAME:
252 return Lexer(data, filename)