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

Side by Side Diff: tools/lexer_generator/code_generator.jinja

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 | « src/scanner.h ('k') | tools/lexer_generator/code_generator.py » ('j') | 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 29 matching lines...) Expand all
40 (primary_char == 0 && cursor_ < buffer_end_) 40 (primary_char == 0 && cursor_ < buffer_end_)
41 {%- elif r[1][0] == 0 -%} 41 {%- elif r[1][0] == 0 -%}
42 primary_char <= {{r[1][1]}} 42 primary_char <= {{r[1][1]}}
43 {%- elif r[1][1] == upper_bound and not encoding == 'utf16'-%} 43 {%- elif r[1][1] == upper_bound and not encoding == 'utf16'-%}
44 primary_char >= {{r[1][0]}} 44 primary_char >= {{r[1][0]}}
45 {%- else -%} 45 {%- else -%}
46 ({{r[1][0]}} <= primary_char && primary_char <= {{r[1][1]}}) 46 ({{r[1][0]}} <= primary_char && primary_char <= {{r[1][1]}})
47 {%- endif -%} 47 {%- endif -%}
48 {# These classes require long_char and to be outside the primary range #} 48 {# These classes require long_char and to be outside the primary range #}
49 {%- elif r[0] == 'LONG_CHAR_CLASS' and encoding in ['utf16', 'utf8'] -%} 49 {%- elif r[0] == 'LONG_CHAR_CLASS' and encoding in ['utf16', 'utf8'] -%}
50 {%- if r[1] == 'byte_order_mark' -%} 50 {%- if r[1] == 'call' -%}
51 (long_char == 0xfffe || long_char == 0xfeff)
52 {%- elif r[1] == 'call' -%}
53 unicode_cache_->{{r[2]}}(long_char) 51 unicode_cache_->{{r[2]}}(long_char)
54 {%- elif r[1] == 'invert' -%} 52 {%- elif r[1] == 'invert' -%}
55 !({{do_key(r[2])}}) 53 !({{do_key(r[2])}})
56 {%- elif r[1] == 'catch_all' -%} 54 {%- elif r[1] == 'catch_all' -%}
57 (true || long_char == 0) /* {{r[1]}} */ 55 (true || long_char == 0) /* {{r[1]}} */
58 {%- else -%} 56 {%- else -%}
59 uncompilable code for {{encoding}} {{r[0]}} {{r[1]}} 57 uncompilable code for {{encoding}} {{r[0]}} {{r[1]}}
60 {%- endif -%} 58 {%- endif -%}
61 {%- else -%} 59 {%- else -%}
62 uncompilable code for {{encoding}} {{r[0]}} {{r[1]}} 60 uncompilable code for {{encoding}} {{r[0]}} {{r[1]}}
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 // force use of stored_token 350 // force use of stored_token
353 stored_token = Token::ILLEGAL; 351 stored_token = Token::ILLEGAL;
354 // force use of marker 352 // force use of marker
355 marker = NULL; 353 marker = NULL;
356 // force use of state_entry_0 354 // force use of state_entry_0
357 goto state_entry_0; 355 goto state_entry_0;
358 } 356 }
359 } 357 }
360 } } 358 } }
361 359
OLDNEW
« no previous file with comments | « src/scanner.h ('k') | tools/lexer_generator/code_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698