Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: tools/lexer_generator/transition_keys.py

Issue 82953003: Experimental parser: cleanup after adding encodings (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/lexer_generator/code_generator.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 the V8 project authors. All rights reserved. 1 # Copyright 2013 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 for name, v in encoding.class_range_iter(): 278 for name, v in encoding.class_range_iter():
279 if r == v: return name 279 if r == v: return name
280 assert False 280 assert False
281 281
282 def range_iter(self, encoding): 282 def range_iter(self, encoding):
283 assert not self == TransitionKey.epsilon() and not self.__is_unique() 283 assert not self == TransitionKey.epsilon() and not self.__is_unique()
284 for r in self.__ranges: 284 for r in self.__ranges:
285 if encoding.is_class_range(r): 285 if encoding.is_class_range(r):
286 yield ('CLASS', TransitionKey.__class_name(encoding, r)) 286 yield ('CLASS', TransitionKey.__class_name(encoding, r))
287 else: 287 else:
288 yield ('LATIN_1', r) 288 yield ('PRIMARY_RANGE', r)
289 289
290 __printable_cache = { 290 __printable_cache = {
291 ord('\t') : '\\t', 291 ord('\t') : '\\t',
292 ord('\n') : '\\n', 292 ord('\n') : '\\n',
293 ord('\r') : '\\r', 293 ord('\r') : '\\r',
294 } 294 }
295 295
296 @staticmethod 296 @staticmethod
297 def __range_str(encoding, r): 297 def __range_str(encoding, r):
298 if encoding and encoding.is_class_range(r): 298 if encoding and encoding.is_class_range(r):
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 [(9, 9), (11, 12), (32, 32), self.class_range('non_ascii_whitespace')]) 520 [(9, 9), (11, 12), (32, 32), self.class_range('non_ascii_whitespace')])
521 self.add_predefined_range( 521 self.add_predefined_range(
522 'letter', [(65, 90), (97, 122), self.class_range('non_ascii_letter')]) 522 'letter', [(65, 90), (97, 122), self.class_range('non_ascii_letter')])
523 self.add_predefined_range( 523 self.add_predefined_range(
524 'line_terminator', 524 'line_terminator',
525 [(10, 10), (13, 13), self.class_range('non_ascii_line_terminator')]) 525 [(10, 10), (13, 13), self.class_range('non_ascii_line_terminator')])
526 self.add_predefined_range( 526 self.add_predefined_range(
527 'identifier_part_not_letter', 527 'identifier_part_not_letter',
528 [(48, 57), (95, 95), 528 [(48, 57), (95, 95),
529 self.class_range('non_ascii_identifier_part_not_letter')]) 529 self.class_range('non_ascii_identifier_part_not_letter')])
OLDNEW
« no previous file with comments | « tools/lexer_generator/code_generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698