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

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

Issue 85543002: Experimental lexer generator: utf line terminator fix. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years 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') | 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 if s: 193 if s:
194 switch_transitions.append((s, node_id)) 194 switch_transitions.append((s, node_id))
195 if d: 195 if d:
196 deferred_transitions.append((d, node_id)) 196 deferred_transitions.append((d, node_id))
197 state['transitions'] = if_transitions 197 state['transitions'] = if_transitions
198 state['switch_transitions'] = switch_transitions 198 state['switch_transitions'] = switch_transitions
199 state['deferred_transitions'] = deferred_transitions 199 state['deferred_transitions'] = deferred_transitions
200 return split_count + (0 if no_switch else 1) 200 return split_count + (0 if no_switch else 1)
201 201
202 __call_map = { 202 __call_map = {
203 'non_primary_whitespace' : 'IsWhiteSpace', 203 'non_primary_whitespace' : 'IsWhiteSpaceNotLineTerminator',
204 'non_primary_letter' : 'IsLetter', 204 'non_primary_letter' : 'IsLetter',
205 'non_primary_identifier_part_not_letter' : 'IsIdentifierPartNotLetter', 205 'non_primary_identifier_part_not_letter' : 'IsIdentifierPartNotLetter',
206 'non_primary_line_terminator' : 'IsLineTerminator', 206 'non_primary_line_terminator' : 'IsLineTerminator',
207 } 207 }
208 208
209 def __rewrite_deferred_transitions(self, state): 209 def __rewrite_deferred_transitions(self, state):
210 assert not state['long_char_transitions'] 210 assert not state['long_char_transitions']
211 transitions = state['deferred_transitions'] 211 transitions = state['deferred_transitions']
212 if not transitions: 212 if not transitions:
213 return 213 return
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 char_type = char_types[encoding.name()] 324 char_type = char_types[encoding.name()]
325 325
326 return template.render( 326 return template.render(
327 start_node_number = 0, 327 start_node_number = 0,
328 debug_print = self.__debug_print, 328 debug_print = self.__debug_print,
329 default_action = default_action, 329 default_action = default_action,
330 dfa_states = dfa_states, 330 dfa_states = dfa_states,
331 encoding = encoding.name(), 331 encoding = encoding.name(),
332 char_type = char_type, 332 char_type = char_type,
333 upper_bound = encoding.primary_range()[1]) 333 upper_bound = encoding.primary_range()[1])
OLDNEW
« no previous file with comments | « src/scanner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698