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

Side by Side Diff: src/lexer/lexer_py.re

Issue 63363004: Experimental lexer generator: comment fixes. (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 | « 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 "==" <|push_token(EQ)|> 58 "==" <|push_token(EQ)|>
59 "=" <|push_token(ASSIGN)|> 59 "=" <|push_token(ASSIGN)|>
60 "!==" <|push_token(NE_STRICT)|> 60 "!==" <|push_token(NE_STRICT)|>
61 "!=" <|push_token(NE)|> 61 "!=" <|push_token(NE)|>
62 "!" <|push_token(NOT)|> 62 "!" <|push_token(NOT)|>
63 63
64 "//" <||SingleLineComment> 64 "//" <||SingleLineComment>
65 "/*" <||MultiLineComment> 65 "/*" <||MultiLineComment>
66 "<!--" <||HtmlComment> 66 "<!--" <||HtmlComment>
67 67
68 whitespace? "-->" <{ 68 "-->" <{
69 if (!just_seen_line_terminator_) { 69 if (!just_seen_line_terminator_) {
70 PUSH_TOKEN(Token::DEC); 70 PUSH_TOKEN(Token::DEC);
71 start_ = cursor_ - 1; 71 start_ = cursor_ - 1;
72 goto code_start; 72 goto code_start;
73 } 73 }
74 }||SingleLineComment> 74 }||SingleLineComment>
75 75
76 ">>>=" <|push_token(ASSIGN_SHR)|> 76 ">>>=" <|push_token(ASSIGN_SHR)|>
77 ">>>" <|push_token(SHR)|> 77 ">>>" <|push_token(SHR)|>
78 "<<=" <|push_token(ASSIGN_SHL)|> 78 "<<=" <|push_token(ASSIGN_SHL)|>
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 <<Identifier>> 199 <<Identifier>>
200 identifier_char <|push_token(IDENTIFIER)|continue> 200 identifier_char <|push_token(IDENTIFIER)|continue>
201 /\\u[0-9a-fA-F]{4}/ <{ 201 /\\u[0-9a-fA-F]{4}/ <{
202 if (V8_UNLIKELY(!ValidIdentifierPart())) { 202 if (V8_UNLIKELY(!ValidIdentifierPart())) {
203 goto default_action; 203 goto default_action;
204 } 204 }
205 }|push_token(IDENTIFIER)|continue> 205 }|push_token(IDENTIFIER)|continue>
206 206
207 <<SingleLineComment>> 207 <<SingleLineComment>>
208 line_terminator <|push_line_terminator|> 208 line_terminator <|push_line_terminator|>
209 eof <|skip_and_terminate|>
209 catch_all <||continue> 210 catch_all <||continue>
210 211
211 <<MultiLineComment>> 212 <<MultiLineComment>>
212 "*/" <|skip|> 213 "*/" <|skip|>
213 # TODO find a way to generate the below rule 214 # TODO find a way to generate the below rule
214 /\*[^\/]/ <||continue> 215 /\*[^\/]/ <||continue>
215 line_terminator <push_line_terminator||continue> 216 line_terminator <push_line_terminator||continue>
216 catch_all <||continue> 217 catch_all <||continue>
217 218
218 <<HtmlComment>> 219 <<HtmlComment>>
219 "-->" <|skip|> 220 "-->" <|skip|>
220 # TODO find a way to generate the below rules 221 # TODO find a way to generate the below rules
221 /--./ <||continue> 222 /--./ <||continue>
222 /-./ <||continue> 223 /-./ <||continue>
223 line_terminator <push_line_terminator||continue> 224 line_terminator <push_line_terminator||continue>
224 catch_all <||continue> 225 catch_all <||continue>
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