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

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

Issue 83243004: Experimental parser: cleanup code requiring calls to the unicode cache (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.jinja » ('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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 "=" <|push_token(ASSIGN)|> 61 "=" <|push_token(ASSIGN)|>
62 "!==" <|push_token(NE_STRICT)|> 62 "!==" <|push_token(NE_STRICT)|>
63 "!=" <|push_token(NE)|> 63 "!=" <|push_token(NE)|>
64 "!" <|push_token(NOT)|> 64 "!" <|push_token(NOT)|>
65 65
66 "//" <||SingleLineComment> 66 "//" <||SingleLineComment>
67 "/*" <set_marker(2)||MultiLineComment> 67 "/*" <set_marker(2)||MultiLineComment>
68 "<!--" <||SingleLineComment> 68 "<!--" <||SingleLineComment>
69 69
70 "<!-" <|{ 70 "<!-" <|{
71 cursor_ -= 2; 71 BACKWARD(2);
72 yych = *(cursor_);
73 PUSH_TOKEN(Token::LT); 72 PUSH_TOKEN(Token::LT);
74 }|> 73 }|>
75 74
76 "<!" <|{ 75 "<!" <|{
77 cursor_ -= 1; 76 BACKWARD(1);
78 yych = *(cursor_);
79 PUSH_TOKEN(Token::LT); 77 PUSH_TOKEN(Token::LT);
80 }|> 78 }|>
81 79
82 80
83 "-->" <{ 81 "-->" <{
84 if (!just_seen_line_terminator_) { 82 if (!just_seen_line_terminator_) {
85 yych = *(--cursor_); 83 BACKWARD(1);
86 PUSH_TOKEN(Token::DEC); 84 PUSH_TOKEN(Token::DEC);
87 } 85 }
88 }||SingleLineComment> 86 }||SingleLineComment>
89 87
90 ">>>=" <|push_token(ASSIGN_SHR)|> 88 ">>>=" <|push_token(ASSIGN_SHR)|>
91 ">>>" <|push_token(SHR)|> 89 ">>>" <|push_token(SHR)|>
92 "<<=" <|push_token(ASSIGN_SHL)|> 90 "<<=" <|push_token(ASSIGN_SHL)|>
93 ">>=" <|push_token(ASSIGN_SAR)|> 91 ">>=" <|push_token(ASSIGN_SAR)|>
94 "<=" <|push_token(LTE)|> 92 "<=" <|push_token(LTE)|>
95 ">=" <|push_token(GTE)|> 93 ">=" <|push_token(GTE)|>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 "&" <|push_token(BIT_AND)|> 125 "&" <|push_token(BIT_AND)|>
128 "+" <|push_token(ADD)|> 126 "+" <|push_token(ADD)|>
129 "-" <|push_token(SUB)|> 127 "-" <|push_token(SUB)|>
130 "*" <|push_token(MUL)|> 128 "*" <|push_token(MUL)|>
131 "/" <|push_token(DIV)|> 129 "/" <|push_token(DIV)|>
132 "%" <|push_token(MOD)|> 130 "%" <|push_token(MOD)|>
133 "~" <|push_token(BIT_NOT)|> 131 "~" <|push_token(BIT_NOT)|>
134 "," <|push_token(COMMA)|> 132 "," <|push_token(COMMA)|>
135 133
136 line_terminator+ <|push_line_terminator|> 134 line_terminator+ <|push_line_terminator|>
137 /[:whitespace::byte_order_mark:]+/ <|skip|> 135 /[:whitespace:]+/ <|skip|>
138 136
139 "\"" <set_marker(1)||DoubleQuoteString> 137 "\"" <set_marker(1)||DoubleQuoteString>
140 "'" <set_marker(1)||SingleQuoteString> 138 "'" <set_marker(1)||SingleQuoteString>
141 139
142 # all keywords 140 # all keywords
143 "break" <|push_token(BREAK)|> 141 "break" <|push_token(BREAK)|>
144 "case" <|push_token(CASE)|> 142 "case" <|push_token(CASE)|>
145 "catch" <|push_token(CATCH)|> 143 "catch" <|push_token(CATCH)|>
146 "class" <|push_token(FUTURE_RESERVED_WORD)|> 144 "class" <|push_token(FUTURE_RESERVED_WORD)|>
147 "const" <|push_token(CONST)|> 145 "const" <|push_token(CONST)|>
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 eos <|skip_and_terminate|> 230 eos <|skip_and_terminate|>
233 catch_all <||continue> 231 catch_all <||continue>
234 232
235 <<MultiLineComment>> 233 <<MultiLineComment>>
236 /\*+\// <|skip|> 234 /\*+\// <|skip|>
237 # TODO find a way to generate the below rule 235 # TODO find a way to generate the below rule
238 /\*+[^\/*]/ <||continue> 236 /\*+[^\/*]/ <||continue>
239 line_terminator <push_line_terminator||continue> 237 line_terminator <push_line_terminator||continue>
240 eos <|terminate_illegal|> 238 eos <|terminate_illegal|>
241 catch_all <||continue> 239 catch_all <||continue>
OLDNEW
« no previous file with comments | « no previous file | tools/lexer_generator/code_generator.jinja » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698