Home | History | Annotate | Download | only in scripts

Lines Matching refs:token_type

140   def __init__(self, start=None, end=None, value=None, token_type=None):
150 self.token_type = token_type
154 self.start, self.value, self.token_type)
160 self.token_type)
171 for (regex, token_type) in token_table:
178 best_match_token_type = token_type
197 (start_column, length, token_type) = m
202 return MakeToken(lines, found_start, found_end, token_type)
237 def MakeToken(lines, start, end, token_type):
240 return Token(start, end, SubString(lines, start, end), token_type)
243 def ParseToken(lines, pos, regex, token_type):
247 return MakeToken(lines, pos, pos + m.end(), token_type)
249 print 'ERROR: %s expected at %s.' % (token_type, pos)
270 def SkipUntil(lines, pos, regex, token_type):
277 (token_type, pos.line + 1, pos.column))
305 return Token(token.start, token.end, token.value[:-1], token.token_type)
324 if found.token_type == '$var':
340 elif found.token_type == '$for':
347 elif found.token_type == '$range':
362 elif found.token_type == '$':
369 elif (found.token_type == ']]' or found.token_type == '$if' or
370 found.token_type == '$elif' or found.token_type == '$else'):
453 def PopToken(a_list, token_type=None):
455 if token_type is not None and token.token_type != token_type:
456 print 'ERROR: %s expected at %s' % (token_type, token.start)
476 def Pop(token_type=None):
477 return PopToken(tokens, token_type)
482 if next.token_type == '$else':
488 elif next.token_type == '$elif':
504 def Pop(token_type=None):
505 return PopToken(tokens, token_type)
508 t = head.token_type
515 if next.token_type == 'exp':
525 if next_token.token_type == 'code':