diff --git a/hphp/test/quick/hh_type_args4.php b/hphp/test/quick/hh_type_args4.php index f74230a33..16e6872f1 100644 --- a/hphp/test/quick/hh_type_args4.php +++ b/hphp/test/quick/hh_type_args4.php @@ -8,5 +8,8 @@ class B extends A { } function foo >(Q $thing, T $item): T { return $thing->getT($item); } +class C> {} +class D {} +class E> {} echo "Done\n"; diff --git a/hphp/util/parser/hphp.ll b/hphp/util/parser/hphp.ll index f19e258e5..1f271edf1 100644 --- a/hphp/util/parser/hphp.ll +++ b/hphp/util/parser/hphp.ll @@ -113,6 +113,7 @@ static int getNextTokenType(int t) { case T_BOOL_CAST: case T_UNSET_CAST: case T_UNRESOLVED_LT: + case T_AS: return NextTokenType::XhpTag | NextTokenType::XhpClassName; case ',': case '(': case '|': diff --git a/hphp/util/parser/lex.yy.cpp b/hphp/util/parser/lex.yy.cpp index 6150fc7c4..b23ccc9db 100644 --- a/hphp/util/parser/lex.yy.cpp +++ b/hphp/util/parser/lex.yy.cpp @@ -77965,6 +77965,7 @@ static int getNextTokenType(int t) { case T_BOOL_CAST: case T_UNSET_CAST: case T_UNRESOLVED_LT: + case T_AS: return NextTokenType::XhpTag | NextTokenType::XhpClassName; case ',': case '(': case '|': @@ -78033,7 +78034,7 @@ static int getNextTokenType(int t) { * For heredocs, matching continues across/after newlines if/when it's known * that the next line doesn't contain a possible ending label */ -#line 78021 "lex.yy.cpp" +#line 78022 "lex.yy.cpp" #define INITIAL 0 #define ST_IN_HTML 1 @@ -78288,10 +78289,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 210 "hphp.ll" +#line 211 "hphp.ll" -#line 78279 "lex.yy.cpp" +#line 78280 "lex.yy.cpp" yylval = yylval_param; @@ -78374,232 +78375,232 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 212 "hphp.ll" +#line 213 "hphp.ll" { SETTOKEN; return T_EXIT;} YY_BREAK case 2: YY_RULE_SETUP -#line 213 "hphp.ll" +#line 214 "hphp.ll" { SETTOKEN; return T_EXIT;} YY_BREAK case 3: YY_RULE_SETUP -#line 214 "hphp.ll" +#line 215 "hphp.ll" { SETTOKEN; return T_FUNCTION;} YY_BREAK case 4: YY_RULE_SETUP -#line 215 "hphp.ll" +#line 216 "hphp.ll" { SETTOKEN; return T_CONST;} YY_BREAK case 5: YY_RULE_SETUP -#line 216 "hphp.ll" +#line 217 "hphp.ll" { SETTOKEN; return T_RETURN;} YY_BREAK case 6: YY_RULE_SETUP -#line 217 "hphp.ll" +#line 218 "hphp.ll" { SETTOKEN; return T_YIELD;} YY_BREAK case 7: YY_RULE_SETUP -#line 218 "hphp.ll" +#line 219 "hphp.ll" { SETTOKEN; return T_TRY;} YY_BREAK case 8: YY_RULE_SETUP -#line 219 "hphp.ll" +#line 220 "hphp.ll" { SETTOKEN; return T_CATCH;} YY_BREAK case 9: YY_RULE_SETUP -#line 220 "hphp.ll" +#line 221 "hphp.ll" { SETTOKEN; return T_FINALLY;} YY_BREAK case 10: YY_RULE_SETUP -#line 221 "hphp.ll" +#line 222 "hphp.ll" { SETTOKEN; return T_THROW;} YY_BREAK case 11: YY_RULE_SETUP -#line 222 "hphp.ll" +#line 223 "hphp.ll" { SETTOKEN; return T_IF;} YY_BREAK case 12: YY_RULE_SETUP -#line 223 "hphp.ll" +#line 224 "hphp.ll" { SETTOKEN; return T_ELSEIF;} YY_BREAK case 13: YY_RULE_SETUP -#line 224 "hphp.ll" +#line 225 "hphp.ll" { SETTOKEN; return T_ENDIF;} YY_BREAK case 14: YY_RULE_SETUP -#line 225 "hphp.ll" +#line 226 "hphp.ll" { SETTOKEN; return T_ELSE;} YY_BREAK case 15: YY_RULE_SETUP -#line 226 "hphp.ll" +#line 227 "hphp.ll" { SETTOKEN; return T_WHILE;} YY_BREAK case 16: YY_RULE_SETUP -#line 227 "hphp.ll" +#line 228 "hphp.ll" { SETTOKEN; return T_ENDWHILE;} YY_BREAK case 17: YY_RULE_SETUP -#line 228 "hphp.ll" +#line 229 "hphp.ll" { SETTOKEN; return T_DO;} YY_BREAK case 18: YY_RULE_SETUP -#line 229 "hphp.ll" +#line 230 "hphp.ll" { SETTOKEN; return T_FOR;} YY_BREAK case 19: YY_RULE_SETUP -#line 230 "hphp.ll" +#line 231 "hphp.ll" { SETTOKEN; return T_ENDFOR;} YY_BREAK case 20: YY_RULE_SETUP -#line 231 "hphp.ll" +#line 232 "hphp.ll" { SETTOKEN; return T_FOREACH;} YY_BREAK case 21: YY_RULE_SETUP -#line 232 "hphp.ll" +#line 233 "hphp.ll" { SETTOKEN; return T_ENDFOREACH;} YY_BREAK case 22: YY_RULE_SETUP -#line 233 "hphp.ll" +#line 234 "hphp.ll" { SETTOKEN; return T_DECLARE;} YY_BREAK case 23: YY_RULE_SETUP -#line 234 "hphp.ll" +#line 235 "hphp.ll" { SETTOKEN; return T_ENDDECLARE;} YY_BREAK case 24: YY_RULE_SETUP -#line 235 "hphp.ll" +#line 236 "hphp.ll" { SETTOKEN; return T_INSTANCEOF;} YY_BREAK case 25: YY_RULE_SETUP -#line 236 "hphp.ll" +#line 237 "hphp.ll" { SETTOKEN; return T_AS;} YY_BREAK case 26: YY_RULE_SETUP -#line 237 "hphp.ll" +#line 238 "hphp.ll" { SETTOKEN; return T_SWITCH;} YY_BREAK case 27: YY_RULE_SETUP -#line 238 "hphp.ll" +#line 239 "hphp.ll" { SETTOKEN; return T_ENDSWITCH;} YY_BREAK case 28: YY_RULE_SETUP -#line 239 "hphp.ll" +#line 240 "hphp.ll" { SETTOKEN; return T_CASE;} YY_BREAK case 29: YY_RULE_SETUP -#line 240 "hphp.ll" +#line 241 "hphp.ll" { SETTOKEN; return T_DEFAULT;} YY_BREAK case 30: YY_RULE_SETUP -#line 241 "hphp.ll" +#line 242 "hphp.ll" { SETTOKEN; return T_BREAK;} YY_BREAK case 31: YY_RULE_SETUP -#line 242 "hphp.ll" +#line 243 "hphp.ll" { SETTOKEN; return T_CONTINUE;} YY_BREAK case 32: YY_RULE_SETUP -#line 243 "hphp.ll" +#line 244 "hphp.ll" { SETTOKEN; return T_GOTO;} YY_BREAK case 33: YY_RULE_SETUP -#line 244 "hphp.ll" +#line 245 "hphp.ll" { SETTOKEN; return T_ECHO;} YY_BREAK case 34: YY_RULE_SETUP -#line 245 "hphp.ll" +#line 246 "hphp.ll" { SETTOKEN; return T_PRINT;} YY_BREAK case 35: YY_RULE_SETUP -#line 246 "hphp.ll" +#line 247 "hphp.ll" { SETTOKEN; return T_CLASS;} YY_BREAK case 36: YY_RULE_SETUP -#line 247 "hphp.ll" +#line 248 "hphp.ll" { SETTOKEN; return T_INTERFACE;} YY_BREAK case 37: YY_RULE_SETUP -#line 248 "hphp.ll" +#line 249 "hphp.ll" { SETTOKEN; return T_TRAIT;} YY_BREAK case 38: YY_RULE_SETUP -#line 249 "hphp.ll" +#line 250 "hphp.ll" { SETTOKEN; return T_INSTEADOF;} YY_BREAK case 39: YY_RULE_SETUP -#line 250 "hphp.ll" +#line 251 "hphp.ll" { SETTOKEN; return T_EXTENDS;} YY_BREAK case 40: YY_RULE_SETUP -#line 251 "hphp.ll" +#line 252 "hphp.ll" { SETTOKEN; return T_IMPLEMENTS;} YY_BREAK case 41: YY_RULE_SETUP -#line 252 "hphp.ll" +#line 253 "hphp.ll" { SETTOKEN; return T_XHP_ATTRIBUTE;} YY_BREAK case 42: YY_RULE_SETUP -#line 253 "hphp.ll" +#line 254 "hphp.ll" { SETTOKEN; return T_XHP_CATEGORY;} YY_BREAK case 43: YY_RULE_SETUP -#line 254 "hphp.ll" +#line 255 "hphp.ll" { SETTOKEN; return T_XHP_CHILDREN;} YY_BREAK case 44: YY_RULE_SETUP -#line 255 "hphp.ll" +#line 256 "hphp.ll" { SETTOKEN; return T_XHP_REQUIRED;} YY_BREAK case 45: YY_RULE_SETUP -#line 256 "hphp.ll" +#line 257 "hphp.ll" { SETTOKEN; return T_XHP_ENUM;} YY_BREAK case 46: YY_RULE_SETUP -#line 258 "hphp.ll" +#line 259 "hphp.ll" { STEPPOS; yy_push_state(ST_LOOKING_FOR_PROPERTY, yyscanner); @@ -78608,7 +78609,7 @@ YY_RULE_SETUP YY_BREAK case 47: YY_RULE_SETUP -#line 264 "hphp.ll" +#line 265 "hphp.ll" { STEPPOS; return T_OBJECT_OPERATOR; @@ -78616,7 +78617,7 @@ YY_RULE_SETUP YY_BREAK case 48: YY_RULE_SETUP -#line 269 "hphp.ll" +#line 270 "hphp.ll" { SETTOKEN; yy_pop_state(yyscanner); @@ -78626,7 +78627,7 @@ YY_RULE_SETUP case 49: /* rule 49 can match eol */ YY_RULE_SETUP -#line 275 "hphp.ll" +#line 276 "hphp.ll" { yyless(0); yy_pop_state(yyscanner); @@ -78634,32 +78635,32 @@ YY_RULE_SETUP YY_BREAK case 50: YY_RULE_SETUP -#line 280 "hphp.ll" +#line 281 "hphp.ll" { STEPPOS;return T_PAAMAYIM_NEKUDOTAYIM;} YY_BREAK case 51: YY_RULE_SETUP -#line 281 "hphp.ll" +#line 282 "hphp.ll" { SETTOKEN;return T_NS_SEPARATOR;} YY_BREAK case 52: YY_RULE_SETUP -#line 282 "hphp.ll" +#line 283 "hphp.ll" { SETTOKEN;return T_NEW;} YY_BREAK case 53: YY_RULE_SETUP -#line 283 "hphp.ll" +#line 284 "hphp.ll" { SETTOKEN;return T_CLONE;} YY_BREAK case 54: YY_RULE_SETUP -#line 284 "hphp.ll" +#line 285 "hphp.ll" { SETTOKEN;return T_VAR;} YY_BREAK case 55: YY_RULE_SETUP -#line 286 "hphp.ll" +#line 287 "hphp.ll" { if (_scanner->lastToken() != T_FUNCTION) { STEPPOS; @@ -78672,7 +78673,7 @@ YY_RULE_SETUP YY_BREAK case 56: YY_RULE_SETUP -#line 296 "hphp.ll" +#line 297 "hphp.ll" { if (_scanner->lastToken() != T_FUNCTION) { STEPPOS; @@ -78685,7 +78686,7 @@ YY_RULE_SETUP YY_BREAK case 57: YY_RULE_SETUP -#line 306 "hphp.ll" +#line 307 "hphp.ll" { if (_scanner->lastToken() != T_FUNCTION) { STEPPOS; @@ -78698,7 +78699,7 @@ YY_RULE_SETUP YY_BREAK case 58: YY_RULE_SETUP -#line 316 "hphp.ll" +#line 317 "hphp.ll" { if (_scanner->lastToken() != T_FUNCTION) { STEPPOS; @@ -78711,7 +78712,7 @@ YY_RULE_SETUP YY_BREAK case 59: YY_RULE_SETUP -#line 326 "hphp.ll" +#line 327 "hphp.ll" { if (_scanner->lastToken() != T_FUNCTION) { STEPPOS; @@ -78724,7 +78725,7 @@ YY_RULE_SETUP YY_BREAK case 60: YY_RULE_SETUP -#line 336 "hphp.ll" +#line 337 "hphp.ll" { if (_scanner->lastToken() != T_FUNCTION) { STEPPOS; @@ -78737,7 +78738,7 @@ YY_RULE_SETUP YY_BREAK case 61: YY_RULE_SETUP -#line 346 "hphp.ll" +#line 347 "hphp.ll" { if (_scanner->lastToken() != T_FUNCTION) { STEPPOS; @@ -78750,62 +78751,62 @@ YY_RULE_SETUP YY_BREAK case 62: YY_RULE_SETUP -#line 356 "hphp.ll" +#line 357 "hphp.ll" { SETTOKEN; return T_EVAL;} YY_BREAK case 63: YY_RULE_SETUP -#line 357 "hphp.ll" +#line 358 "hphp.ll" { SETTOKEN; return T_INCLUDE;} YY_BREAK case 64: YY_RULE_SETUP -#line 358 "hphp.ll" +#line 359 "hphp.ll" { SETTOKEN; return T_INCLUDE_ONCE;} YY_BREAK case 65: YY_RULE_SETUP -#line 359 "hphp.ll" +#line 360 "hphp.ll" { SETTOKEN; return T_REQUIRE;} YY_BREAK case 66: YY_RULE_SETUP -#line 360 "hphp.ll" +#line 361 "hphp.ll" { SETTOKEN; return T_REQUIRE_ONCE;} YY_BREAK case 67: YY_RULE_SETUP -#line 361 "hphp.ll" +#line 362 "hphp.ll" { SETTOKEN; return T_NAMESPACE;} YY_BREAK case 68: YY_RULE_SETUP -#line 362 "hphp.ll" +#line 363 "hphp.ll" { SETTOKEN; return T_USE;} YY_BREAK case 69: YY_RULE_SETUP -#line 363 "hphp.ll" +#line 364 "hphp.ll" { SETTOKEN; return T_GLOBAL;} YY_BREAK case 70: YY_RULE_SETUP -#line 364 "hphp.ll" +#line 365 "hphp.ll" { SETTOKEN; return T_ISSET;} YY_BREAK case 71: YY_RULE_SETUP -#line 365 "hphp.ll" +#line 366 "hphp.ll" { SETTOKEN; return T_EMPTY;} YY_BREAK case 72: YY_RULE_SETUP -#line 366 "hphp.ll" +#line 367 "hphp.ll" { SETTOKEN; return T_HALT_COMPILER;} YY_BREAK case 73: YY_RULE_SETUP -#line 367 "hphp.ll" +#line 368 "hphp.ll" { SETTOKEN; return T_COMPILER_HALT_OFFSET; @@ -78813,202 +78814,202 @@ YY_RULE_SETUP YY_BREAK case 74: YY_RULE_SETUP -#line 371 "hphp.ll" +#line 372 "hphp.ll" { SETTOKEN; return T_STATIC;} YY_BREAK case 75: YY_RULE_SETUP -#line 372 "hphp.ll" +#line 373 "hphp.ll" { SETTOKEN; return T_ABSTRACT;} YY_BREAK case 76: YY_RULE_SETUP -#line 373 "hphp.ll" +#line 374 "hphp.ll" { SETTOKEN; return T_FINAL;} YY_BREAK case 77: YY_RULE_SETUP -#line 374 "hphp.ll" +#line 375 "hphp.ll" { SETTOKEN; return T_PRIVATE;} YY_BREAK case 78: YY_RULE_SETUP -#line 375 "hphp.ll" +#line 376 "hphp.ll" { SETTOKEN; return T_PROTECTED;} YY_BREAK case 79: YY_RULE_SETUP -#line 376 "hphp.ll" +#line 377 "hphp.ll" { SETTOKEN; return T_PUBLIC;} YY_BREAK case 80: YY_RULE_SETUP -#line 377 "hphp.ll" +#line 378 "hphp.ll" { SETTOKEN; return T_UNSET;} YY_BREAK case 81: YY_RULE_SETUP -#line 378 "hphp.ll" +#line 379 "hphp.ll" { STEPPOS; return T_DOUBLE_ARROW;} YY_BREAK case 82: YY_RULE_SETUP -#line 379 "hphp.ll" +#line 380 "hphp.ll" { SETTOKEN; return T_LIST;} YY_BREAK case 83: YY_RULE_SETUP -#line 380 "hphp.ll" +#line 381 "hphp.ll" { SETTOKEN; return T_ARRAY;} YY_BREAK case 84: YY_RULE_SETUP -#line 381 "hphp.ll" +#line 382 "hphp.ll" { STEPPOS; return T_INC;} YY_BREAK case 85: YY_RULE_SETUP -#line 382 "hphp.ll" +#line 383 "hphp.ll" { STEPPOS; return T_DEC;} YY_BREAK case 86: YY_RULE_SETUP -#line 383 "hphp.ll" +#line 384 "hphp.ll" { STEPPOS; return T_IS_IDENTICAL;} YY_BREAK case 87: YY_RULE_SETUP -#line 384 "hphp.ll" +#line 385 "hphp.ll" { STEPPOS; return T_IS_NOT_IDENTICAL;} YY_BREAK case 88: YY_RULE_SETUP -#line 385 "hphp.ll" +#line 386 "hphp.ll" { STEPPOS; return T_IS_EQUAL;} YY_BREAK case 89: YY_RULE_SETUP -#line 386 "hphp.ll" +#line 387 "hphp.ll" { STEPPOS; return T_IS_NOT_EQUAL;} YY_BREAK case 90: YY_RULE_SETUP -#line 387 "hphp.ll" +#line 388 "hphp.ll" { STEPPOS; return T_IS_SMALLER_OR_EQUAL;} YY_BREAK case 91: YY_RULE_SETUP -#line 388 "hphp.ll" +#line 389 "hphp.ll" { STEPPOS; return T_IS_GREATER_OR_EQUAL;} YY_BREAK case 92: YY_RULE_SETUP -#line 389 "hphp.ll" +#line 390 "hphp.ll" { STEPPOS; return T_PLUS_EQUAL;} YY_BREAK case 93: YY_RULE_SETUP -#line 390 "hphp.ll" +#line 391 "hphp.ll" { STEPPOS; return T_MINUS_EQUAL;} YY_BREAK case 94: YY_RULE_SETUP -#line 391 "hphp.ll" +#line 392 "hphp.ll" { STEPPOS; return T_MUL_EQUAL;} YY_BREAK case 95: YY_RULE_SETUP -#line 392 "hphp.ll" +#line 393 "hphp.ll" { STEPPOS; return T_DIV_EQUAL;} YY_BREAK case 96: YY_RULE_SETUP -#line 393 "hphp.ll" +#line 394 "hphp.ll" { STEPPOS; return T_CONCAT_EQUAL;} YY_BREAK case 97: YY_RULE_SETUP -#line 394 "hphp.ll" +#line 395 "hphp.ll" { STEPPOS; return T_MOD_EQUAL;} YY_BREAK case 98: YY_RULE_SETUP -#line 395 "hphp.ll" +#line 396 "hphp.ll" { STEPPOS; return T_SL_EQUAL;} YY_BREAK case 99: YY_RULE_SETUP -#line 396 "hphp.ll" +#line 397 "hphp.ll" { STEPPOS; return T_SR_EQUAL;} YY_BREAK case 100: YY_RULE_SETUP -#line 397 "hphp.ll" +#line 398 "hphp.ll" { STEPPOS; return T_AND_EQUAL;} YY_BREAK case 101: YY_RULE_SETUP -#line 398 "hphp.ll" +#line 399 "hphp.ll" { STEPPOS; return T_OR_EQUAL;} YY_BREAK case 102: YY_RULE_SETUP -#line 399 "hphp.ll" +#line 400 "hphp.ll" { STEPPOS; return T_XOR_EQUAL;} YY_BREAK case 103: YY_RULE_SETUP -#line 400 "hphp.ll" +#line 401 "hphp.ll" { STEPPOS; return T_BOOLEAN_OR;} YY_BREAK case 104: YY_RULE_SETUP -#line 401 "hphp.ll" +#line 402 "hphp.ll" { STEPPOS; return T_BOOLEAN_AND;} YY_BREAK case 105: YY_RULE_SETUP -#line 402 "hphp.ll" +#line 403 "hphp.ll" { SETTOKEN; return T_LOGICAL_OR;} YY_BREAK case 106: YY_RULE_SETUP -#line 403 "hphp.ll" +#line 404 "hphp.ll" { SETTOKEN; return T_LOGICAL_AND;} YY_BREAK case 107: YY_RULE_SETUP -#line 404 "hphp.ll" +#line 405 "hphp.ll" { SETTOKEN; return T_LOGICAL_XOR;} YY_BREAK case 108: YY_RULE_SETUP -#line 405 "hphp.ll" +#line 406 "hphp.ll" { STEPPOS; return T_SL;} YY_BREAK case 109: YY_RULE_SETUP -#line 406 "hphp.ll" +#line 407 "hphp.ll" { SETTOKEN; return T_VARARG; } YY_BREAK case 110: YY_RULE_SETUP -#line 408 "hphp.ll" +#line 409 "hphp.ll" { HH_ONLY_KEYWORD(T_SHAPE); } YY_BREAK case 111: YY_RULE_SETUP -#line 409 "hphp.ll" +#line 410 "hphp.ll" { HH_ONLY_KEYWORD(T_UNRESOLVED_TYPE); } YY_BREAK case 112: YY_RULE_SETUP -#line 410 "hphp.ll" +#line 411 "hphp.ll" { HH_ONLY_KEYWORD(T_UNRESOLVED_NEWTYPE); } YY_BREAK case 113: YY_RULE_SETUP -#line 412 "hphp.ll" +#line 413 "hphp.ll" { if (_scanner->getLookaheadLtDepth() < 2) { STEPPOS; @@ -79021,7 +79022,7 @@ YY_RULE_SETUP YY_BREAK case 114: YY_RULE_SETUP -#line 422 "hphp.ll" +#line 423 "hphp.ll" { int ntt = getNextTokenType(_scanner->lastToken()); if (ntt & NextTokenType::XhpTag) { @@ -79049,7 +79050,7 @@ YY_RULE_SETUP YY_BREAK case 115: YY_RULE_SETUP -#line 447 "hphp.ll" +#line 448 "hphp.ll" { STEPPOS; if (_scanner->hipHopSyntaxEnabled()) { @@ -79066,7 +79067,7 @@ YY_RULE_SETUP case 116: /* rule 116 can match eol */ YY_RULE_SETUP -#line 460 "hphp.ll" +#line 461 "hphp.ll" { BEGIN(ST_IN_SCRIPTING); yyless(1); @@ -79077,7 +79078,7 @@ YY_RULE_SETUP YY_BREAK case 117: YY_RULE_SETUP -#line 468 "hphp.ll" +#line 469 "hphp.ll" { BEGIN(ST_IN_SCRIPTING); STEPPOS; @@ -79086,7 +79087,7 @@ YY_RULE_SETUP YY_BREAK case 118: YY_RULE_SETUP -#line 474 "hphp.ll" +#line 475 "hphp.ll" { int ntt = getNextTokenType(_scanner->lastToken()); if (ntt & NextTokenType::XhpClassName) { @@ -79101,7 +79102,7 @@ YY_RULE_SETUP YY_BREAK case 119: YY_RULE_SETUP -#line 486 "hphp.ll" +#line 487 "hphp.ll" { int ntt = getNextTokenType(_scanner->lastToken()); if (ntt & NextTokenType::XhpCategoryName) { @@ -79116,12 +79117,12 @@ YY_RULE_SETUP YY_BREAK case 120: YY_RULE_SETUP -#line 498 "hphp.ll" +#line 499 "hphp.ll" {STEPPOS; return yytext[0];} YY_BREAK case 121: YY_RULE_SETUP -#line 500 "hphp.ll" +#line 501 "hphp.ll" { STEPPOS; yy_push_state(ST_IN_SCRIPTING, yyscanner); @@ -79130,7 +79131,7 @@ YY_RULE_SETUP YY_BREAK case 122: YY_RULE_SETUP -#line 506 "hphp.ll" +#line 507 "hphp.ll" { STEPPOS; yy_push_state(ST_LOOKING_FOR_VARNAME, yyscanner); @@ -79139,7 +79140,7 @@ YY_RULE_SETUP YY_BREAK case 123: YY_RULE_SETUP -#line 512 "hphp.ll" +#line 513 "hphp.ll" { STEPPOS; // We need to be robust against a '}' in PHP code with @@ -79151,7 +79152,7 @@ YY_RULE_SETUP YY_BREAK case 124: YY_RULE_SETUP -#line 521 "hphp.ll" +#line 522 "hphp.ll" { SETTOKEN; // Change state to IN_SCRIPTING; current state will be popped @@ -79163,7 +79164,7 @@ YY_RULE_SETUP case 125: /* rule 125 can match eol */ YY_RULE_SETUP -#line 529 "hphp.ll" +#line 530 "hphp.ll" { yyless(0); // Change state to IN_SCRIPTING; current state will be popped @@ -79173,7 +79174,7 @@ YY_RULE_SETUP YY_BREAK case 126: YY_RULE_SETUP -#line 536 "hphp.ll" +#line 537 "hphp.ll" { SETTOKEN; errno = 0; @@ -79189,7 +79190,7 @@ YY_RULE_SETUP YY_BREAK case 127: YY_RULE_SETUP -#line 549 "hphp.ll" +#line 550 "hphp.ll" { SETTOKEN; errno = 0; @@ -79205,7 +79206,7 @@ YY_RULE_SETUP YY_BREAK case 128: YY_RULE_SETUP -#line 562 "hphp.ll" +#line 563 "hphp.ll" { /* Offset could be treated as a long */ SETTOKEN; errno = 0; @@ -79221,7 +79222,7 @@ YY_RULE_SETUP YY_BREAK case 129: YY_RULE_SETUP -#line 575 "hphp.ll" +#line 576 "hphp.ll" { /* Offset must be treated as a string */ SETTOKEN; return T_NUM_STRING; @@ -79229,7 +79230,7 @@ YY_RULE_SETUP YY_BREAK case 130: YY_RULE_SETUP -#line 580 "hphp.ll" +#line 581 "hphp.ll" { SETTOKEN; return T_DNUMBER; @@ -79237,48 +79238,48 @@ YY_RULE_SETUP YY_BREAK case 131: YY_RULE_SETUP -#line 585 "hphp.ll" +#line 586 "hphp.ll" { SETTOKEN; return T_CLASS_C; } YY_BREAK case 132: YY_RULE_SETUP -#line 586 "hphp.ll" +#line 587 "hphp.ll" { SETTOKEN; return T_TRAIT_C; } YY_BREAK case 133: YY_RULE_SETUP -#line 587 "hphp.ll" +#line 588 "hphp.ll" { SETTOKEN; return T_FUNC_C; } YY_BREAK case 134: YY_RULE_SETUP -#line 588 "hphp.ll" +#line 589 "hphp.ll" { SETTOKEN; return T_METHOD_C;} YY_BREAK case 135: YY_RULE_SETUP -#line 589 "hphp.ll" +#line 590 "hphp.ll" { SETTOKEN; return T_LINE; } YY_BREAK case 136: YY_RULE_SETUP -#line 590 "hphp.ll" +#line 591 "hphp.ll" { SETTOKEN; return T_FILE; } YY_BREAK case 137: YY_RULE_SETUP -#line 591 "hphp.ll" +#line 592 "hphp.ll" { SETTOKEN; return T_DIR; } YY_BREAK case 138: YY_RULE_SETUP -#line 592 "hphp.ll" +#line 593 "hphp.ll" { SETTOKEN; return T_NS_C; } YY_BREAK case 139: /* rule 139 can match eol */ YY_RULE_SETUP -#line 594 "hphp.ll" +#line 595 "hphp.ll" { _scanner->setHashBang(yytext, yyleng); BEGIN(ST_IN_SCRIPTING); @@ -79289,7 +79290,7 @@ YY_RULE_SETUP case 140: /* rule 140 can match eol */ YY_RULE_SETUP -#line 601 "hphp.ll" +#line 602 "hphp.ll" { SETTOKEN; BEGIN(ST_IN_SCRIPTING); @@ -79300,7 +79301,7 @@ YY_RULE_SETUP case 141: /* rule 141 can match eol */ YY_RULE_SETUP -#line 608 "hphp.ll" +#line 609 "hphp.ll" { SETTOKEN; BEGIN(ST_IN_HTML); @@ -79310,7 +79311,7 @@ YY_RULE_SETUP case 142: /* rule 142 can match eol */ YY_RULE_SETUP -#line 614 "hphp.ll" +#line 615 "hphp.ll" { SETTOKEN; if (_scanner->shortTags() || yyleng > 2) { @@ -79333,7 +79334,7 @@ YY_RULE_SETUP YY_BREAK case 143: YY_RULE_SETUP -#line 634 "hphp.ll" +#line 635 "hphp.ll" { SETTOKEN; if ((yytext[1]=='%' && _scanner->aspTags()) || @@ -79357,7 +79358,7 @@ YY_RULE_SETUP YY_BREAK case 144: YY_RULE_SETUP -#line 655 "hphp.ll" +#line 656 "hphp.ll" { SETTOKEN; if (_scanner->aspTags()) { @@ -79381,7 +79382,7 @@ YY_RULE_SETUP case 145: /* rule 145 can match eol */ YY_RULE_SETUP -#line 675 "hphp.ll" +#line 676 "hphp.ll" { if (YY_START == INITIAL) { BEGIN(ST_IN_SCRIPTING); @@ -79398,7 +79399,7 @@ YY_RULE_SETUP YY_BREAK case 146: YY_RULE_SETUP -#line 689 "hphp.ll" +#line 690 "hphp.ll" { _scanner->setToken(yytext, yyleng, yytext+1, yyleng-1); return T_VARIABLE; @@ -79406,7 +79407,7 @@ YY_RULE_SETUP YY_BREAK case 147: YY_RULE_SETUP -#line 694 "hphp.ll" +#line 695 "hphp.ll" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY, yyscanner); @@ -79416,7 +79417,7 @@ YY_RULE_SETUP YY_BREAK case 148: YY_RULE_SETUP -#line 701 "hphp.ll" +#line 702 "hphp.ll" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET, yyscanner); @@ -79426,7 +79427,7 @@ YY_RULE_SETUP YY_BREAK case 149: YY_RULE_SETUP -#line 708 "hphp.ll" +#line 709 "hphp.ll" { yy_pop_state(yyscanner); return ']'; @@ -79434,7 +79435,7 @@ YY_RULE_SETUP YY_BREAK case 150: YY_RULE_SETUP -#line 713 "hphp.ll" +#line 714 "hphp.ll" { /* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */ @@ -79444,7 +79445,7 @@ YY_RULE_SETUP case 151: /* rule 151 can match eol */ YY_RULE_SETUP -#line 719 "hphp.ll" +#line 720 "hphp.ll" { /* Invalid rule to return a more explicit parse error with proper line number */ @@ -79456,7 +79457,7 @@ YY_RULE_SETUP YY_BREAK case 152: YY_RULE_SETUP -#line 728 "hphp.ll" +#line 729 "hphp.ll" { SETTOKEN; return T_STRING; @@ -79465,7 +79466,7 @@ YY_RULE_SETUP case 153: /* rule 153 can match eol */ YY_RULE_SETUP -#line 733 "hphp.ll" +#line 734 "hphp.ll" { STEPPOS; return T_WHITESPACE; @@ -79473,7 +79474,7 @@ YY_RULE_SETUP YY_BREAK case 154: YY_RULE_SETUP -#line 738 "hphp.ll" +#line 739 "hphp.ll" { yy_push_state(ST_ONE_LINE_COMMENT, yyscanner); yymore(); @@ -79481,7 +79482,7 @@ YY_RULE_SETUP YY_BREAK case 155: YY_RULE_SETUP -#line 743 "hphp.ll" +#line 744 "hphp.ll" { yymore(); } @@ -79489,7 +79490,7 @@ YY_RULE_SETUP case 156: /* rule 156 can match eol */ YY_RULE_SETUP -#line 747 "hphp.ll" +#line 748 "hphp.ll" { switch (yytext[yyleng-1]) { case '?': @@ -79508,7 +79509,7 @@ YY_RULE_SETUP case 157: /* rule 157 can match eol */ YY_RULE_SETUP -#line 762 "hphp.ll" +#line 763 "hphp.ll" { STEPPOS; yy_pop_state(yyscanner); @@ -79517,7 +79518,7 @@ YY_RULE_SETUP YY_BREAK case 158: YY_RULE_SETUP -#line 768 "hphp.ll" +#line 769 "hphp.ll" { if (_scanner->isHackMode()) { _scanner->error("Hack mode: ?> not allowed"); @@ -79536,7 +79537,7 @@ YY_RULE_SETUP case 159: /* rule 159 can match eol */ YY_RULE_SETUP -#line 783 "hphp.ll" +#line 784 "hphp.ll" { yy_push_state(ST_DOC_COMMENT, yyscanner); yymore(); @@ -79544,7 +79545,7 @@ YY_RULE_SETUP YY_BREAK case 160: YY_RULE_SETUP -#line 788 "hphp.ll" +#line 789 "hphp.ll" { yy_push_state(ST_COMMENT, yyscanner); yymore(); @@ -79553,14 +79554,14 @@ YY_RULE_SETUP case 161: /* rule 161 can match eol */ YY_RULE_SETUP -#line 793 "hphp.ll" +#line 794 "hphp.ll" { yymore(); } YY_BREAK case 162: YY_RULE_SETUP -#line 797 "hphp.ll" +#line 798 "hphp.ll" { SETTOKEN; yy_pop_state(yyscanner); @@ -79569,7 +79570,7 @@ YY_RULE_SETUP YY_BREAK case 163: YY_RULE_SETUP -#line 803 "hphp.ll" +#line 804 "hphp.ll" { STEPPOS; yy_pop_state(yyscanner); @@ -79578,7 +79579,7 @@ YY_RULE_SETUP YY_BREAK case 164: YY_RULE_SETUP -#line 809 "hphp.ll" +#line 810 "hphp.ll" { yymore(); } @@ -79586,7 +79587,7 @@ YY_RULE_SETUP case 165: /* rule 165 can match eol */ YY_RULE_SETUP -#line 813 "hphp.ll" +#line 814 "hphp.ll" { if (_scanner->isHackMode()) { _scanner->error("Hack mode: ?> not allowed"); @@ -79604,7 +79605,7 @@ YY_RULE_SETUP case 166: /* rule 166 can match eol */ YY_RULE_SETUP -#line 827 "hphp.ll" +#line 828 "hphp.ll" { STEPPOS; yy_push_state(ST_IN_HTML, yyscanner); @@ -79618,7 +79619,7 @@ YY_RULE_SETUP case 167: /* rule 167 can match eol */ YY_RULE_SETUP -#line 837 "hphp.ll" +#line 838 "hphp.ll" { if (_scanner->aspTags()) { STEPPOS; @@ -79638,7 +79639,7 @@ YY_RULE_SETUP case 168: /* rule 168 can match eol */ YY_RULE_SETUP -#line 853 "hphp.ll" +#line 854 "hphp.ll" { int bprefix = (yytext[0] != '"') ? 1 : 0; std::string strval = @@ -79651,7 +79652,7 @@ YY_RULE_SETUP case 169: /* rule 169 can match eol */ YY_RULE_SETUP -#line 862 "hphp.ll" +#line 863 "hphp.ll" { int bprefix = (yytext[0] != '\'') ? 1 : 0; int closed = (yytext[yyleng - 1] == '\''); @@ -79664,7 +79665,7 @@ YY_RULE_SETUP YY_BREAK case 170: YY_RULE_SETUP -#line 872 "hphp.ll" +#line 873 "hphp.ll" { int bprefix = (yytext[0] != '"') ? 1 : 0; _scanner->setToken(yytext, yyleng, yytext + bprefix, yyleng - bprefix); @@ -79675,7 +79676,7 @@ YY_RULE_SETUP case 171: /* rule 171 can match eol */ YY_RULE_SETUP -#line 879 "hphp.ll" +#line 880 "hphp.ll" { int bprefix = (yytext[0] != '<') ? 1 : 0; int label_len = yyleng-bprefix-3-1-(yytext[yyleng-2]=='\r'?1:0); @@ -79702,7 +79703,7 @@ YY_RULE_SETUP YY_BREAK case 172: YY_RULE_SETUP -#line 903 "hphp.ll" +#line 904 "hphp.ll" { STEPPOS; BEGIN(ST_BACKQUOTE); @@ -79711,7 +79712,7 @@ YY_RULE_SETUP YY_BREAK case 173: YY_RULE_SETUP -#line 909 "hphp.ll" +#line 910 "hphp.ll" { SETTOKEN; return T_XHP_LABEL; @@ -79719,7 +79720,7 @@ YY_RULE_SETUP YY_BREAK case 174: YY_RULE_SETUP -#line 914 "hphp.ll" +#line 915 "hphp.ll" { STEPPOS; return yytext[0]; @@ -79728,7 +79729,7 @@ YY_RULE_SETUP case 175: /* rule 175 can match eol */ YY_RULE_SETUP -#line 919 "hphp.ll" +#line 920 "hphp.ll" { _scanner->setToken(yytext, yyleng, yytext+1, yyleng-2); return T_XHP_TEXT; @@ -79736,7 +79737,7 @@ YY_RULE_SETUP YY_BREAK case 176: YY_RULE_SETUP -#line 924 "hphp.ll" +#line 925 "hphp.ll" { STEPPOS; yy_push_state(ST_IN_SCRIPTING, yyscanner); @@ -79745,7 +79746,7 @@ YY_RULE_SETUP YY_BREAK case 177: YY_RULE_SETUP -#line 930 "hphp.ll" +#line 931 "hphp.ll" { STEPPOS; BEGIN(ST_XHP_CHILD); @@ -79754,7 +79755,7 @@ YY_RULE_SETUP YY_BREAK case 178: YY_RULE_SETUP -#line 936 "hphp.ll" +#line 937 "hphp.ll" { BEGIN(ST_XHP_END_SINGLETON_TAG); yyless(1); @@ -79764,7 +79765,7 @@ YY_RULE_SETUP case 179: /* rule 179 can match eol */ YY_RULE_SETUP -#line 942 "hphp.ll" +#line 943 "hphp.ll" { // This rule ensures we get a reasonable syntax error message // when unexpected characters occur inside XHP tags @@ -79776,7 +79777,7 @@ YY_RULE_SETUP YY_BREAK case 180: YY_RULE_SETUP -#line 951 "hphp.ll" +#line 952 "hphp.ll" { STEPPOS; yy_pop_state(yyscanner); @@ -79786,7 +79787,7 @@ YY_RULE_SETUP case 181: /* rule 181 can match eol */ YY_RULE_SETUP -#line 957 "hphp.ll" +#line 958 "hphp.ll" { SETTOKEN; return T_XHP_TEXT; @@ -79794,7 +79795,7 @@ YY_RULE_SETUP YY_BREAK case 182: YY_RULE_SETUP -#line 962 "hphp.ll" +#line 963 "hphp.ll" { STEPPOS; yy_push_state(ST_IN_SCRIPTING, yyscanner); @@ -79803,7 +79804,7 @@ YY_RULE_SETUP YY_BREAK case 183: YY_RULE_SETUP -#line 968 "hphp.ll" +#line 969 "hphp.ll" { BEGIN(ST_XHP_END_CLOSE_TAG); yyless(1); @@ -79813,7 +79814,7 @@ YY_RULE_SETUP YY_BREAK case 184: YY_RULE_SETUP -#line 975 "hphp.ll" +#line 976 "hphp.ll" { STEPPOS; return '/'; @@ -79821,7 +79822,7 @@ YY_RULE_SETUP YY_BREAK case 185: YY_RULE_SETUP -#line 980 "hphp.ll" +#line 981 "hphp.ll" { SETTOKEN; return T_XHP_LABEL; @@ -79829,7 +79830,7 @@ YY_RULE_SETUP YY_BREAK case 186: YY_RULE_SETUP -#line 985 "hphp.ll" +#line 986 "hphp.ll" { STEPPOS; yy_pop_state(yyscanner); @@ -79838,7 +79839,7 @@ YY_RULE_SETUP YY_BREAK case 187: YY_RULE_SETUP -#line 991 "hphp.ll" +#line 992 "hphp.ll" { STEPPOS; yy_push_state(ST_XHP_IN_TAG, yyscanner); @@ -79848,7 +79849,7 @@ YY_RULE_SETUP case 188: /* rule 188 can match eol */ YY_RULE_SETUP -#line 997 "hphp.ll" +#line 998 "hphp.ll" { int refillResult = EOB_ACT_CONTINUE_SCAN; std::vector docPieces; @@ -80021,7 +80022,7 @@ doc_scan_done: YY_BREAK case 189: YY_RULE_SETUP -#line 1167 "hphp.ll" +#line 1168 "hphp.ll" { BEGIN(ST_IN_SCRIPTING); STEPPOS; @@ -80030,7 +80031,7 @@ YY_RULE_SETUP YY_BREAK case 190: YY_RULE_SETUP -#line 1173 "hphp.ll" +#line 1174 "hphp.ll" { _scanner->setToken(yytext, 1, yytext, 1); yy_push_state(ST_IN_SCRIPTING, yyscanner); @@ -80041,7 +80042,7 @@ YY_RULE_SETUP case 191: /* rule 191 can match eol */ YY_RULE_SETUP -#line 1180 "hphp.ll" +#line 1181 "hphp.ll" { std::string strval = _scanner->escape(yytext, yyleng, '"'); _scanner->setToken(yytext, yyleng, strval.c_str(), strval.length()); @@ -80051,7 +80052,7 @@ YY_RULE_SETUP case 192: /* rule 192 can match eol */ YY_RULE_SETUP -#line 1186 "hphp.ll" +#line 1187 "hphp.ll" { yyless(yyleng - 1); std::string strval = _scanner->escape(yytext, yyleng, '"'); @@ -80062,7 +80063,7 @@ YY_RULE_SETUP case 193: /* rule 193 can match eol */ YY_RULE_SETUP -#line 1193 "hphp.ll" +#line 1194 "hphp.ll" { std::string strval = _scanner->escape(yytext, yyleng, '`'); _scanner->setToken(yytext, yyleng, strval.c_str(), strval.length()); @@ -80072,7 +80073,7 @@ YY_RULE_SETUP case 194: /* rule 194 can match eol */ YY_RULE_SETUP -#line 1199 "hphp.ll" +#line 1200 "hphp.ll" { yyless(yyleng - 1); std::string strval = _scanner->escape(yytext, yyleng, '`'); @@ -80082,7 +80083,7 @@ YY_RULE_SETUP YY_BREAK case 195: YY_RULE_SETUP -#line 1206 "hphp.ll" +#line 1207 "hphp.ll" { BEGIN(ST_IN_SCRIPTING); return '"'; @@ -80090,7 +80091,7 @@ YY_RULE_SETUP YY_BREAK case 196: YY_RULE_SETUP -#line 1211 "hphp.ll" +#line 1212 "hphp.ll" { BEGIN(ST_IN_SCRIPTING); return '`'; @@ -80098,7 +80099,7 @@ YY_RULE_SETUP YY_BREAK case YY_STATE_EOF(ST_COMMENT): case YY_STATE_EOF(ST_DOC_COMMENT): -#line 1216 "hphp.ll" +#line 1217 "hphp.ll" { _scanner->error("Unterminated comment at end of file"); return 0; @@ -80107,7 +80108,7 @@ case YY_STATE_EOF(ST_DOC_COMMENT): case 197: /* rule 197 can match eol */ YY_RULE_SETUP -#line 1221 "hphp.ll" +#line 1222 "hphp.ll" { _scanner->error("Unexpected character in input: '%c' (ASCII=%d)", yytext[0], yytext[0]); @@ -80115,10 +80116,10 @@ YY_RULE_SETUP YY_BREAK case 198: YY_RULE_SETUP -#line 1226 "hphp.ll" +#line 1227 "hphp.ll" ECHO; YY_BREAK -#line 80106 "lex.yy.cpp" +#line 80107 "lex.yy.cpp" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(ST_IN_HTML): case YY_STATE_EOF(ST_IN_SCRIPTING): @@ -81349,7 +81350,7 @@ void hphpfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 1226 "hphp.ll" +#line 1227 "hphp.ll"