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

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

Issue 144003014: Experimental parser: cleanup state transformation in code generator (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 11 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 | « no previous file | 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 {%- for r in ranges -%} 249 {%- for r in ranges -%}
250 {%- for key in range(r[0], r[1] + 1) -%} 250 {%- for key in range(r[0], r[1] + 1) -%}
251 case {{key}}: 251 case {{key}}:
252 {% endfor %} 252 {% endfor %}
253 {%- endfor -%} 253 {%- endfor -%}
254 {{ do_transition(transition_state_id) }} 254 {{ do_transition(transition_state_id) }}
255 {% endfor -%} 255 {% endfor -%}
256 } 256 }
257 {%- endif -%} 257 {%- endif -%}
258 258
259 {%- for key, transition_state_id in state.transitions %} 259 {%- for key, transition_state_id in state['if_transitions'] %}
260 if ({{do_key(key)}}) { // normal if transition 260 if ({{do_key(key)}}) { // normal if transition
261 {{ do_transition(transition_state_id) }} 261 {{ do_transition(transition_state_id) }}
262 } 262 }
263 {% endfor -%} 263 {% endfor -%}
264 264
265 {%- for key, transition_state_id in state['deferred_transitions'] %} 265 {%- for key, transition_state_id in state['deferred_transitions'] %}
266 if ({{do_key(key)}}) { // deferred transition 266 if ({{do_key(key)}}) { // deferred transition
267 {{ do_transition(transition_state_id) }} 267 {{ do_transition(transition_state_id) }}
268 } 268 }
269 {% endfor -%} 269 {% endfor -%}
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 // force use of stored_token 354 // force use of stored_token
355 stored_token = Token::ILLEGAL; 355 stored_token = Token::ILLEGAL;
356 // force use of marker 356 // force use of marker
357 marker = NULL; 357 marker = NULL;
358 // force use of state_entry_0 358 // force use of state_entry_0
359 goto state_entry_0; 359 goto state_entry_0;
360 } 360 }
361 } 361 }
362 } } 362 } }
363 363
OLDNEW
« no previous file with comments | « no previous file | tools/lexer_generator/code_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698