Page MenuHomePhabricator

D13890.diff
No OneTemporary

D13890.diff

diff --git a/src/parser/xhpast/__tests__/data/base-pass.php.expect b/src/parser/xhpast/__tests__/data/base-pass.php.expect
--- a/src/parser/xhpast/__tests__/data/base-pass.php.expect
+++ b/src/parser/xhpast/__tests__/data/base-pass.php.expect
@@ -2,7 +2,7 @@
"tree": [
9000,
0,
- 0,
+ 1,
[
[
9006,
@@ -21,7 +21,11 @@
"stream": [
[
371,
- 6
+ 5
+ ],
+ [
+ 375,
+ 1
]
]
}
diff --git a/src/parser/xhpast/__tests__/data/php-access-on-instanciation.expect b/src/parser/xhpast/__tests__/data/php-access-on-instanciation.expect
--- a/src/parser/xhpast/__tests__/data/php-access-on-instanciation.expect
+++ b/src/parser/xhpast/__tests__/data/php-access-on-instanciation.expect
@@ -340,11 +340,11 @@
"stream": [
[
371,
- 6
+ 5
],
[
375,
- 1
+ 2
],
[
356,
diff --git a/src/parser/xhpast/__tests__/data/php-array-dereference-2.expect b/src/parser/xhpast/__tests__/data/php-array-dereference-2.expect
--- a/src/parser/xhpast/__tests__/data/php-array-dereference-2.expect
+++ b/src/parser/xhpast/__tests__/data/php-array-dereference-2.expect
@@ -95,11 +95,11 @@
"stream": [
[
371,
- 6
+ 5
],
[
375,
- 1
+ 2
],
[
303,
diff --git a/src/parser/xhpast/__tests__/data/php-array-dereference-3.expect b/src/parser/xhpast/__tests__/data/php-array-dereference-3.expect
--- a/src/parser/xhpast/__tests__/data/php-array-dereference-3.expect
+++ b/src/parser/xhpast/__tests__/data/php-array-dereference-3.expect
@@ -2,12 +2,12 @@
"tree": [
9000,
0,
- 20,
+ 21,
[
[
9006,
0,
- 19,
+ 20,
[
[
9007,
@@ -16,77 +16,77 @@
],
[
9004,
- 1,
- 19,
+ 2,
+ 20,
[
[
9015,
- 1,
- 19,
+ 2,
+ 20,
[
[
9017,
- 1,
- 19,
+ 2,
+ 20,
[
[
9016,
- 3,
- 15,
+ 4,
+ 16,
[
[
9099,
- 4,
- 14,
+ 5,
+ 15,
[
[
9001,
- 4,
- 4
+ 5,
+ 5
],
[
9095,
- 5,
- 14,
+ 6,
+ 15,
[
[
9100,
- 6,
- 13,
+ 7,
+ 14,
[
[
9099,
- 6,
- 10,
+ 7,
+ 11,
[
[
9089,
- 6,
- 8,
+ 7,
+ 9,
[
[
9090,
- 6,
- 6
+ 7,
+ 7
],
[
9013,
- 8,
- 8
+ 9,
+ 9
]
]
],
[
9095,
- 9,
- 10
+ 10,
+ 11
]
]
],
[
9047,
- 12,
- 12
+ 13,
+ 13
]
]
]
@@ -98,8 +98,8 @@
],
[
9006,
- 17,
- 19
+ 18,
+ 20
]
]
]
@@ -114,7 +114,11 @@
"stream": [
[
371,
- 6
+ 5
+ ],
+ [
+ 375,
+ 1
],
[
303,
diff --git a/src/parser/xhpast/__tests__/data/php-array-dereference.expect b/src/parser/xhpast/__tests__/data/php-array-dereference.expect
--- a/src/parser/xhpast/__tests__/data/php-array-dereference.expect
+++ b/src/parser/xhpast/__tests__/data/php-array-dereference.expect
@@ -350,11 +350,11 @@
"stream": [
[
371,
- 6
+ 5
],
[
375,
- 1
+ 2
],
[
337,
diff --git a/src/parser/xhpast/__tests__/data/php-binary-literal.php.expect b/src/parser/xhpast/__tests__/data/php-binary-literal.php.expect
--- a/src/parser/xhpast/__tests__/data/php-binary-literal.php.expect
+++ b/src/parser/xhpast/__tests__/data/php-binary-literal.php.expect
@@ -2,12 +2,12 @@
"tree": [
9000,
0,
- 2,
+ 3,
[
[
9006,
0,
- 2,
+ 3,
[
[
9007,
@@ -16,13 +16,13 @@
],
[
9004,
- 1,
2,
+ 3,
[
[
9086,
- 1,
- 1
+ 2,
+ 2
]
]
]
@@ -33,7 +33,11 @@
"stream": [
[
371,
- 6
+ 5
+ ],
+ [
+ 375,
+ 1
],
[
307,
diff --git a/src/parser/xhpast/__tests__/data/php-callable-typehint.php.expect b/src/parser/xhpast/__tests__/data/php-callable-typehint.php.expect
--- a/src/parser/xhpast/__tests__/data/php-callable-typehint.php.expect
+++ b/src/parser/xhpast/__tests__/data/php-callable-typehint.php.expect
@@ -81,11 +81,11 @@
"stream": [
[
371,
- 6
+ 5
],
[
375,
- 1
+ 2
],
[
337,
diff --git a/src/parser/xhpast/__tests__/data/php-comments.php.expect b/src/parser/xhpast/__tests__/data/php-comments.php.expect
--- a/src/parser/xhpast/__tests__/data/php-comments.php.expect
+++ b/src/parser/xhpast/__tests__/data/php-comments.php.expect
@@ -21,11 +21,11 @@
"stream": [
[
371,
- 6
+ 5
],
[
375,
- 1
+ 2
],
[
369,
diff --git a/src/parser/xhpast/__tests__/data/php-empty-heredoc.php.expect b/src/parser/xhpast/__tests__/data/php-empty-heredoc.php.expect
--- a/src/parser/xhpast/__tests__/data/php-empty-heredoc.php.expect
+++ b/src/parser/xhpast/__tests__/data/php-empty-heredoc.php.expect
@@ -50,11 +50,11 @@
"stream": [
[
371,
- 6
+ 5
],
[
375,
- 1
+ 2
],
[
311,
diff --git a/src/parser/xhpast/__tests__/data/php-finally.php.expect b/src/parser/xhpast/__tests__/data/php-finally.php.expect
--- a/src/parser/xhpast/__tests__/data/php-finally.php.expect
+++ b/src/parser/xhpast/__tests__/data/php-finally.php.expect
@@ -2,12 +2,12 @@
"tree": [
9000,
0,
- 21,
+ 22,
[
[
9006,
0,
- 20,
+ 21,
[
[
9007,
@@ -16,43 +16,43 @@
],
[
9004,
- 1,
- 20,
+ 2,
+ 21,
[
[
9041,
- 1,
- 20,
+ 2,
+ 21,
[
[
9006,
- 3,
- 4
+ 4,
+ 5
],
[
9042,
- 6,
- 15,
+ 7,
+ 16,
[
[
9043,
- 6,
- 15,
+ 7,
+ 16,
[
[
9090,
- 9,
- 9
+ 10,
+ 10
],
[
9047,
- 11,
- 11
+ 12,
+ 12
],
[
9006,
- 14,
- 15
+ 15,
+ 16
]
]
]
@@ -60,8 +60,8 @@
],
[
9113,
- 17,
- 20,
+ 18,
+ 21,
[
[
9006
@@ -79,7 +79,11 @@
"stream": [
[
371,
- 6
+ 5
+ ],
+ [
+ 375,
+ 1
],
[
340,
diff --git a/src/parser/xhpast/__tests__/data/php-literal-index.php.expect b/src/parser/xhpast/__tests__/data/php-literal-index.php.expect
--- a/src/parser/xhpast/__tests__/data/php-literal-index.php.expect
+++ b/src/parser/xhpast/__tests__/data/php-literal-index.php.expect
@@ -2,12 +2,12 @@
"tree": [
9000,
0,
- 14,
+ 15,
[
[
9006,
0,
- 13,
+ 14,
[
[
9007,
@@ -16,36 +16,36 @@
],
[
9004,
- 1,
- 7,
+ 2,
+ 8,
[
[
9100,
- 1,
- 6,
+ 2,
+ 7,
[
[
9082,
- 1,
- 3,
+ 2,
+ 4,
[
[
9093,
- 1,
- 3,
+ 2,
+ 4,
[
[
9094,
- 2,
- 2,
+ 3,
+ 3,
[
[
9005
],
[
9086,
- 2,
- 2
+ 3,
+ 3
]
]
]
@@ -55,8 +55,8 @@
],
[
9086,
- 5,
- 5
+ 6,
+ 6
]
]
]
@@ -64,23 +64,23 @@
],
[
9004,
- 9,
- 13,
+ 10,
+ 14,
[
[
9100,
- 9,
- 12,
+ 10,
+ 13,
[
[
9087,
- 9,
- 9
+ 10,
+ 10
],
[
9086,
- 11,
- 11
+ 12,
+ 12
]
]
]
@@ -93,7 +93,11 @@
"stream": [
[
371,
- 6
+ 5
+ ],
+ [
+ 375,
+ 1
],
[
91,
diff --git a/src/parser/xhpast/__tests__/data/php-literals.php.expect b/src/parser/xhpast/__tests__/data/php-literals.php.expect
--- a/src/parser/xhpast/__tests__/data/php-literals.php.expect
+++ b/src/parser/xhpast/__tests__/data/php-literals.php.expect
@@ -189,11 +189,11 @@
"stream": [
[
371,
- 6
+ 5
],
[
375,
- 1
+ 2
],
[
307,
diff --git a/src/parser/xhpast/__tests__/data/php-short-array.php.expect b/src/parser/xhpast/__tests__/data/php-short-array.php.expect
--- a/src/parser/xhpast/__tests__/data/php-short-array.php.expect
+++ b/src/parser/xhpast/__tests__/data/php-short-array.php.expect
@@ -2,12 +2,12 @@
"tree": [
9000,
0,
- 4,
+ 5,
[
[
9006,
0,
- 3,
+ 4,
[
[
9007,
@@ -16,18 +16,18 @@
],
[
9004,
- 1,
- 3,
+ 2,
+ 4,
[
[
9082,
- 1,
2,
+ 3,
[
[
9093,
- 1,
- 2
+ 2,
+ 3
]
]
]
@@ -40,7 +40,11 @@
"stream": [
[
371,
- 6
+ 5
+ ],
+ [
+ 375,
+ 1
],
[
91,
diff --git a/src/parser/xhpast/__tests__/data/php-syntax.php.expect b/src/parser/xhpast/__tests__/data/php-syntax.php.expect
--- a/src/parser/xhpast/__tests__/data/php-syntax.php.expect
+++ b/src/parser/xhpast/__tests__/data/php-syntax.php.expect
@@ -5606,11 +5606,11 @@
"stream": [
[
371,
- 6
+ 5
],
[
375,
- 1
+ 2
],
[
307,
diff --git a/src/parser/xhpast/__tests__/data/php-tags.php.expect b/src/parser/xhpast/__tests__/data/php-tags.php.expect
--- a/src/parser/xhpast/__tests__/data/php-tags.php.expect
+++ b/src/parser/xhpast/__tests__/data/php-tags.php.expect
@@ -2,12 +2,12 @@
"tree": [
9000,
0,
- 20,
+ 21,
[
[
9006,
0,
- 20,
+ 21,
[
[
9007,
@@ -16,20 +16,20 @@
],
[
9004,
- 1,
2,
+ 3,
[
[
9086,
- 1,
- 1
+ 2,
+ 2
]
]
],
[
9004,
- 4,
- 4,
+ 5,
+ 5,
[
[
9005
@@ -38,25 +38,25 @@
],
[
9007,
- 5,
- 5
+ 6,
+ 6
],
[
9004,
- 7,
8,
+ 9,
[
[
9086,
- 7,
- 7
+ 8,
+ 8
]
]
],
[
9004,
- 10,
- 10,
+ 11,
+ 11,
[
[
9005
@@ -65,25 +65,25 @@
],
[
9007,
- 11,
- 11
+ 12,
+ 12
],
[
9004,
- 13,
14,
+ 15,
[
[
9086,
- 13,
- 13
+ 14,
+ 14
]
]
],
[
9004,
- 16,
- 16,
+ 17,
+ 17,
[
[
9005
@@ -92,11 +92,6 @@
],
[
9034,
- 17,
- 17
- ],
- [
- 9034,
18,
18
],
@@ -109,6 +104,11 @@
9034,
20,
20
+ ],
+ [
+ 9034,
+ 21,
+ 21
]
]
]
@@ -117,7 +117,11 @@
"stream": [
[
371,
- 6
+ 5
+ ],
+ [
+ 375,
+ 1
],
[
307,
diff --git a/src/parser/xhpast/__tests__/data/php-traits.php.expect b/src/parser/xhpast/__tests__/data/php-traits.php.expect
--- a/src/parser/xhpast/__tests__/data/php-traits.php.expect
+++ b/src/parser/xhpast/__tests__/data/php-traits.php.expect
@@ -429,11 +429,11 @@
"stream": [
[
371,
- 6
+ 5
],
[
375,
- 1
+ 2
],
[
390,
diff --git a/src/parser/xhpast/__tests__/data/php-yield.php.expect b/src/parser/xhpast/__tests__/data/php-yield.php.expect
--- a/src/parser/xhpast/__tests__/data/php-yield.php.expect
+++ b/src/parser/xhpast/__tests__/data/php-yield.php.expect
@@ -211,11 +211,11 @@
"stream": [
[
371,
- 6
+ 5
],
[
375,
- 1
+ 2
],
[
337,
diff --git a/src/parser/xhpast/bin/PhutilXHPASTBinary.php b/src/parser/xhpast/bin/PhutilXHPASTBinary.php
--- a/src/parser/xhpast/bin/PhutilXHPASTBinary.php
+++ b/src/parser/xhpast/bin/PhutilXHPASTBinary.php
@@ -8,7 +8,7 @@
* This is the version that would be obtained with an up-to-date XHPAST
* build. The //actual// XHPAST build version may vary.
*/
- const EXPECTED_VERSION = '5.7.1';
+ const EXPECTED_VERSION = '5.7.2';
/**
* The XHPAST build version.
diff --git a/support/xhpast/scanner.l b/support/xhpast/scanner.l
--- a/support/xhpast/scanner.l
+++ b/support/xhpast/scanner.l
@@ -68,7 +68,7 @@
/* Open / close PHP + inline HTML */
<INITIAL>{
- "<?php"([ \t]|{NEWLINE}) {
+ "<?php"/([ \t]|{NEWLINE}) {
yy_scan_newlines(yytext + 5, yyg);
// the state transition will be done in yy_token()
tok(T_OPEN_TAG);
@@ -318,7 +318,6 @@
/* (HERE|NOW)DOC's */
<PHP,PHP_NO_RESERVED_WORDS,PHP_NO_RESERVED_WORDS_PERSIST>b?"<<<"{TABS_AND_SPACES} {
-
push_state(PHP_HEREDOC_START);
yyextra->heredoc_yyleng = yyleng;
yymore();
diff --git a/support/xhpast/scanner.lex.hpp b/support/xhpast/scanner.lex.hpp
--- a/support/xhpast/scanner.lex.hpp
+++ b/support/xhpast/scanner.lex.hpp
@@ -361,7 +361,7 @@
#undef YY_DECL
#endif
-#line 390 "scanner.l"
+#line 389 "scanner.l"
#line 368 "scanner.lex.hpp"
diff --git a/support/xhpast/scanner.lex.cpp b/support/xhpast/scanner.lex.cpp
--- a/support/xhpast/scanner.lex.cpp
+++ b/support/xhpast/scanner.lex.cpp
@@ -24771,6 +24771,10 @@
case 1:
/* rule 1 can match eol */
+*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
+YY_LINENO_REWIND_TO(yy_bp + 5);
+yyg->yy_c_buf_p = yy_cp = yy_bp + 5;
+YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
#line 71 "scanner.l"
{
@@ -25570,7 +25574,6 @@
YY_RULE_SETUP
#line 320 "scanner.l"
{
-
push_state(PHP_HEREDOC_START);
yyextra->heredoc_yyleng = yyleng;
yymore();
@@ -25579,7 +25582,7 @@
case 136:
YY_RULE_SETUP
-#line 327 "scanner.l"
+#line 326 "scanner.l"
{
// Create a new string for the heredoc label. Since we're using yymore above
// yytext will actually start at the "<<<" and not the label. Use of
@@ -25595,7 +25598,7 @@
YY_BREAK
case 137:
YY_RULE_SETUP
-#line 339 "scanner.l"
+#line 338 "scanner.l"
{
yyextra->heredoc_label = string(yytext + yyextra->heredoc_yyleng);
set_state(PHP_HEREDOC_NSTART);
@@ -25607,7 +25610,7 @@
case 138:
/* rule 138 can match eol */
YY_RULE_SETUP
-#line 346 "scanner.l"
+#line 345 "scanner.l"
{
yyextra->heredoc_yyleng = yyleng;
set_state(PHP_HEREDOC_NEWLINE);
@@ -25618,7 +25621,7 @@
case 139:
/* rule 139 can match eol */
YY_RULE_SETUP
-#line 352 "scanner.l"
+#line 351 "scanner.l"
{
if (strncmp(
yyextra->heredoc_label.c_str(),
@@ -25642,7 +25645,7 @@
YY_BREAK
case 140:
YY_RULE_SETUP
-#line 372 "scanner.l"
+#line 371 "scanner.l"
{
yyextra->heredoc_yyleng = yyleng;
yymore();
@@ -25651,7 +25654,7 @@
case 141:
/* rule 141 can match eol */
YY_RULE_SETUP
-#line 376 "scanner.l"
+#line 375 "scanner.l"
{
++yyextra->lineno;
yyextra->heredoc_yyleng = yyleng;
@@ -25663,7 +25666,7 @@
case 142:
/* rule 142 can match eol */
YY_RULE_SETUP
-#line 384 "scanner.l"
+#line 383 "scanner.l"
{
tok(yytext[0]);
// fix unused function warnings
@@ -25673,10 +25676,10 @@
YY_BREAK
case 143:
YY_RULE_SETUP
-#line 391 "scanner.l"
+#line 390 "scanner.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 25680 "scanner.lex.cpp"
+#line 25683 "scanner.lex.cpp"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(PHP):
case YY_STATE_EOF(PHP_HEREDOC_START):
@@ -26882,7 +26885,7 @@
#define YYTABLES_NAME "yytables"
-#line 390 "scanner.l"
+#line 389 "scanner.l"
diff --git a/support/xhpast/xhpast.cpp b/support/xhpast/xhpast.cpp
--- a/support/xhpast/xhpast.cpp
+++ b/support/xhpast/xhpast.cpp
@@ -12,7 +12,7 @@
int main(int argc, char* argv[]) {
if (argc != 1) {
// Coupling: modify also src/parser/xhpast/bin/PhutilXHPASTBinary.php
- cout << "5.7.1\n";
+ cout << "5.7.2\n";
return 0;
}

File Metadata

Mime Type
text/plain
Expires
Wed, Feb 26, 6:46 PM (20 h, 4 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7209136
Default Alt Text
D13890.diff (22 KB)

Event Timeline