| OLD | NEW |
| 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 Loading... |
| 58 "%=" <|push_token(ASSIGN_MOD)|> | 58 "%=" <|push_token(ASSIGN_MOD)|> |
| 59 | 59 |
| 60 "===" <|push_token(EQ_STRICT)|> | 60 "===" <|push_token(EQ_STRICT)|> |
| 61 "==" <|push_token(EQ)|> | 61 "==" <|push_token(EQ)|> |
| 62 "=" <|push_token(ASSIGN)|> | 62 "=" <|push_token(ASSIGN)|> |
| 63 "!==" <|push_token(NE_STRICT)|> | 63 "!==" <|push_token(NE_STRICT)|> |
| 64 "!=" <|push_token(NE)|> | 64 "!=" <|push_token(NE)|> |
| 65 "!" <|push_token(NOT)|> | 65 "!" <|push_token(NOT)|> |
| 66 | 66 |
| 67 "//" <||SingleLineComment> | 67 "//" <||SingleLineComment> |
| 68 "/*" <||MultiLineComment> | 68 "/*" <{marker_ = cursor_ - 2;}||MultiLineComment> |
| 69 "<!--" <||SingleLineComment> | 69 "<!--" <||SingleLineComment> |
| 70 | 70 |
| 71 "<!-" <|{ | 71 "<!-" <|{ |
| 72 cursor_ -= 2; | 72 cursor_ -= 2; |
| 73 yych = *(cursor_); | 73 yych = *(cursor_); |
| 74 PUSH_TOKEN(Token::LT); | 74 PUSH_TOKEN(Token::LT); |
| 75 }|> | 75 }|> |
| 76 | 76 |
| 77 "<!" <|{ | 77 "<!" <|{ |
| 78 cursor_ -= 1; | 78 cursor_ -= 1; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 if (V8_UNLIKELY(!ValidIdentifierStart())) { | 188 if (V8_UNLIKELY(!ValidIdentifierStart())) { |
| 189 goto default_action; | 189 goto default_action; |
| 190 } | 190 } |
| 191 }|push_token(IDENTIFIER)|Identifier> | 191 }|push_token(IDENTIFIER)|Identifier> |
| 192 | 192 |
| 193 eof <|terminate|> | 193 eof <|terminate|> |
| 194 default_action <push_token_and_go_forward(ILLEGAL)> | 194 default_action <push_token_and_go_forward(ILLEGAL)> |
| 195 | 195 |
| 196 <<DoubleQuoteString>> | 196 <<DoubleQuoteString>> |
| 197 "\\" line_terminator_sequence <||continue> | 197 "\\" line_terminator_sequence <||continue> |
| 198 /\\[xX][:hex_digit:]{2}/ <||continue> | 198 /\\[x][:hex_digit:]{2}/ <||continue> |
| 199 /\\[u][:hex_digit:]{4}/ <||continue> | 199 /\\[u][:hex_digit:]{4}/ <||continue> |
| 200 /\\[^xXu\r\n]/ <||continue> | 200 /\\[^xu\r\n]/ <||continue> |
| 201 "\\" <|push_token(ILLEGAL)|> | 201 "\\" <|push_token(ILLEGAL)|> |
| 202 /\n|\r/ <|push_token(ILLEGAL)|> | 202 /\n|\r/ <|push_token(ILLEGAL)|> |
| 203 "\"" <|push_token(STRING)|> | 203 "\"" <|push_token(STRING)|> |
| 204 eof <|terminate_illegal|> | 204 eof <|terminate_illegal|> |
| 205 catch_all <||continue> | 205 catch_all <||continue> |
| 206 | 206 |
| 207 <<SingleQuoteString>> | 207 <<SingleQuoteString>> |
| 208 # TODO subgraph for '\' | 208 # TODO subgraph for '\' |
| 209 "\\" line_terminator_sequence <||continue> | 209 "\\" line_terminator_sequence <||continue> |
| 210 /\\[xX][:hex_digit:]{2}/ <||continue> | 210 /\\[x][:hex_digit:]{2}/ <||continue> |
| 211 /\\[u][:hex_digit:]{4}/ <||continue> | 211 /\\[u][:hex_digit:]{4}/ <||continue> |
| 212 /\\[^xXu\r\n]/ <||continue> | 212 /\\[^xu\r\n]/ <||continue> |
| 213 "\\" <|push_token(ILLEGAL)|> | 213 "\\" <|push_token(ILLEGAL)|> |
| 214 /\n|\r/ <|push_token(ILLEGAL)|> | 214 /\n|\r/ <|push_token(ILLEGAL)|> |
| 215 "'" <|push_token(STRING)|> | 215 "'" <|push_token(STRING)|> |
| 216 eof <|terminate_illegal|> | 216 eof <|terminate_illegal|> |
| 217 catch_all <||continue> | 217 catch_all <||continue> |
| 218 | 218 |
| 219 <<Identifier>> | 219 <<Identifier>> |
| 220 identifier_char <|push_token(IDENTIFIER)|continue> | 220 identifier_char <|push_token(IDENTIFIER)|continue> |
| 221 /\\u[:hex_digit:]{4}/ <{ | 221 /\\u[:hex_digit:]{4}/ <{ |
| 222 if (V8_UNLIKELY(!ValidIdentifierPart())) { | 222 if (V8_UNLIKELY(!ValidIdentifierPart())) { |
| 223 goto default_action; | 223 goto default_action; |
| 224 } | 224 } |
| 225 }|push_token(IDENTIFIER)|continue> | 225 }|push_token(IDENTIFIER)|continue> |
| 226 | 226 |
| 227 <<SingleLineComment>> | 227 <<SingleLineComment>> |
| 228 line_terminator <|push_line_terminator|> | 228 line_terminator <|push_line_terminator|> |
| 229 eof <|skip_and_terminate|> | 229 eof <|skip_and_terminate|> |
| 230 catch_all <||continue> | 230 catch_all <||continue> |
| 231 | 231 |
| 232 <<MultiLineComment>> | 232 <<MultiLineComment>> |
| 233 /\*+\// <|skip|> | 233 /\*+\// <|skip|> |
| 234 # TODO find a way to generate the below rule | 234 # TODO find a way to generate the below rule |
| 235 /\*+[^\/*]/ <||continue> | 235 /\*+[^\/*]/ <||continue> |
| 236 line_terminator <push_line_terminator||continue> | 236 line_terminator <push_line_terminator||continue> |
| 237 eof <|skip_and_terminate|> | 237 eof <|{start_ = marker_; BACKWARD(); PUSH_TOKEN(Token::ILLEGAL);}|> |
| 238 catch_all <||continue> | 238 catch_all <||continue> |
| OLD | NEW |