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

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

Issue 148283007: Experimental parser: remove bom handling (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 10 months 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 self.add_predefined_range('line_terminator', [(10, 10), (13, 13)]) 486 self.add_predefined_range('line_terminator', [(10, 10), (13, 13)])
487 self.add_predefined_range( 487 self.add_predefined_range(
488 'identifier_part_not_letter', [(48, 57), (95, 95)]) 488 'identifier_part_not_letter', [(48, 57), (95, 95)])
489 489
490 class Utf16Encoding(KeyEncoding): 490 class Utf16Encoding(KeyEncoding):
491 491
492 def __init__(self): 492 def __init__(self):
493 super(Utf16Encoding, self).__init__( 493 super(Utf16Encoding, self).__init__(
494 'utf16', 494 'utf16',
495 (0, 255), 495 (0, 255),
496 ['byte_order_mark', 496 ['non_primary_whitespace',
497 'non_primary_whitespace',
498 'non_primary_letter', 497 'non_primary_letter',
499 'non_primary_identifier_part_not_letter', 498 'non_primary_identifier_part_not_letter',
500 'non_primary_line_terminator', 499 'non_primary_line_terminator',
501 'non_primary_everything_else']) 500 'non_primary_everything_else'])
502 self.add_predefined_range( 501 self.add_predefined_range(
503 'whitespace', 502 'whitespace',
504 [(9, 9), (11, 12), (32, 32), (133, 133), (160, 160), 503 [(9, 9), (11, 12), (32, 32), (133, 133), (160, 160),
505 self.class_range('byte_order_mark'),
506 self.class_range('non_primary_whitespace')]) 504 self.class_range('non_primary_whitespace')])
507 self.add_predefined_range( 505 self.add_predefined_range(
508 'letter', [ 506 'letter', [
509 (65, 90), (97, 122), (170, 170), (181, 181), 507 (65, 90), (97, 122), (170, 170), (181, 181),
510 (186, 186), (192, 214), (216, 246), (248, 255), 508 (186, 186), (192, 214), (216, 246), (248, 255),
511 self.class_range('non_primary_letter')]) 509 self.class_range('non_primary_letter')])
512 self.add_predefined_range( 510 self.add_predefined_range(
513 'line_terminator', 511 'line_terminator',
514 [(10, 10), (13, 13), self.class_range('non_primary_line_terminator')]) 512 [(10, 10), (13, 13), self.class_range('non_primary_line_terminator')])
515 self.add_predefined_range( 513 self.add_predefined_range(
516 'identifier_part_not_letter', 514 'identifier_part_not_letter',
517 [(48, 57), (95, 95), 515 [(48, 57), (95, 95),
518 self.class_range('non_primary_identifier_part_not_letter')]) 516 self.class_range('non_primary_identifier_part_not_letter')])
519 517
520 class Utf8Encoding(KeyEncoding): 518 class Utf8Encoding(KeyEncoding):
521 519
522 def __init__(self): 520 def __init__(self):
523 super(Utf8Encoding, self).__init__( 521 super(Utf8Encoding, self).__init__(
524 'utf8', 522 'utf8',
525 (0, 127), 523 (0, 127),
526 ['byte_order_mark', 524 ['non_primary_whitespace',
527 'non_primary_whitespace',
528 'non_primary_letter', 525 'non_primary_letter',
529 'non_primary_identifier_part_not_letter', 526 'non_primary_identifier_part_not_letter',
530 'non_primary_line_terminator', 527 'non_primary_line_terminator',
531 'non_primary_everything_else']) 528 'non_primary_everything_else'])
532 self.add_predefined_range( 529 self.add_predefined_range(
533 'whitespace', 530 'whitespace',
534 [(9, 9), (11, 12), (32, 32), 531 [(9, 9), (11, 12), (32, 32),
535 self.class_range('byte_order_mark'),
536 self.class_range('non_primary_whitespace')]) 532 self.class_range('non_primary_whitespace')])
537 self.add_predefined_range( 533 self.add_predefined_range(
538 'letter', [(65, 90), (97, 122), self.class_range('non_primary_letter')]) 534 'letter', [(65, 90), (97, 122), self.class_range('non_primary_letter')])
539 self.add_predefined_range( 535 self.add_predefined_range(
540 'line_terminator', 536 'line_terminator',
541 [(10, 10), (13, 13), self.class_range('non_primary_line_terminator')]) 537 [(10, 10), (13, 13), self.class_range('non_primary_line_terminator')])
542 self.add_predefined_range( 538 self.add_predefined_range(
543 'identifier_part_not_letter', 539 'identifier_part_not_letter',
544 [(48, 57), (95, 95), 540 [(48, 57), (95, 95),
545 self.class_range('non_primary_identifier_part_not_letter')]) 541 self.class_range('non_primary_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