Page MenuHomePhabricator

D13969.id.diff
No OneTemporary

D13969.id.diff

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.5.9';
+ const EXPECTED_VERSION = '5.6.0';
/**
* The XHPAST build version.
diff --git a/support/xhpast/Makefile b/support/xhpast/Makefile
--- a/support/xhpast/Makefile
+++ b/support/xhpast/Makefile
@@ -1,19 +1,25 @@
+BISONFLAGS = --verbose -d
+CPPFLAGS = -fPIC -Wall
+FLEXFLAGS = -C
+
ifdef DEBUG
-CPPFLAGS = -fPIC -ggdb -Wall -DDEBUG
+ BISONFLAGS += --debug
+ CPPFLAGS += -ggdb -DDEBUG
+ FLEXFLAGS += --debug
else
-CPPFLAGS = -fPIC -Wall -O3 -minline-all-stringops
+ CPPFLAGS += -O3 -minline-all-stringops
endif
ifdef PROFILE
-CPPFLAGS += -pg
+ CPPFLAGS += -pg
endif
ifdef STATIC
-CPPFLAGS += -static
+ CPPFLAGS += -static
endif
ifdef MSYSTEM
-CPPFLAGS += -static-libgcc -static-libstdc++
+ CPPFLAGS += -static-libgcc -static-libstdc++
endif
ROOT = ../../src/parser/xhpast
@@ -30,12 +36,12 @@
cp xhpast $(ROOT)/bin/xhpast
scanner: scanner.l
- flex -C --header-file=scanner.lex.hpp -o scanner.lex.cpp -d $<
+ flex $(FLEXFLAGS) --header-file=scanner.lex.hpp --outfile=scanner.lex.cpp $<
echo '/* @gen''er''ated */' >> scanner.lex.cpp
echo '/* @gen''er''ated */' >> scanner.lex.hpp
parser: parser.y
- bison --debug --verbose -d -o parser.yacc.cpp $<
+ bison $(BISONFLAGS) --output=parser.yacc.cpp $<
echo '/* @gen''er''ated */' >> parser.yacc.cpp
echo '/* @gen''er''ated */' >> parser.yacc.hpp
diff --git a/support/xhpast/parser.yacc.hpp b/support/xhpast/parser.yacc.hpp
--- a/support/xhpast/parser.yacc.hpp
+++ b/support/xhpast/parser.yacc.hpp
@@ -34,7 +34,7 @@
# define YY_XHPAST_PARSER_YACC_HPP_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
-# define YYDEBUG 1
+# define YYDEBUG 0
#endif
#if YYDEBUG
extern int xhpastdebug;
diff --git a/support/xhpast/parser.yacc.cpp b/support/xhpast/parser.yacc.cpp
--- a/support/xhpast/parser.yacc.cpp
+++ b/support/xhpast/parser.yacc.cpp
@@ -159,7 +159,7 @@
# define YY_XHPAST_PARSER_YACC_HPP_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
-# define YYDEBUG 1
+# define YYDEBUG 0
#endif
#if YYDEBUG
extern int xhpastdebug;
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
@@ -10,8 +10,6 @@
/* A lexical scanner generated by flex */
-/* %not-for-header */
-
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
@@ -20,32 +18,16 @@
#define FLEX_BETA
#endif
-/* %if-c++-only */
-/* %endif */
-
-/* %if-c-only */
-
-/* %endif */
-
-/* %if-c-only */
-
-/* %endif */
-
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
-/* %if-c-only */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
-/* %endif */
-/* %if-tables-serialization */
-/* %endif */
/* end standard C headers. */
-/* %if-c-or-c++ */
/* flex integer type definitions */
#ifndef FLEXINT_H
@@ -110,11 +92,6 @@
#endif /* ! FLEXINT_H */
-/* %endif */
-
-/* %if-c++-only */
-/* %endif */
-
#ifdef __cplusplus
/* The "const" storage-class-modifier is valid. */
@@ -136,12 +113,6 @@
#define yyconst
#endif
-/* %not-for-header */
-
-/* %not-for-header */
-
-/* %if-reentrant */
-
/* An opaque pointer. */
#ifndef YY_TYPEDEF_YY_SCANNER_T
#define YY_TYPEDEF_YY_SCANNER_T
@@ -159,11 +130,6 @@
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
#define yy_flex_debug yyg->yy_flex_debug_r
-/* %endif */
-
-/* %if-not-reentrant */
-/* %endif */
-
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
@@ -187,24 +153,11 @@
typedef size_t yy_size_t;
#endif
-/* %if-not-reentrant */
-/* %endif */
-
-/* %if-c-only */
-/* %if-not-reentrant */
-/* %endif */
-/* %endif */
-
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
{
-/* %if-c-only */
FILE *yy_input_file;
-/* %endif */
-
-/* %if-c++-only */
-/* %endif */
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
@@ -251,18 +204,6 @@
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-/* %if-c-only Standard (non-C++) definition */
-/* %not-for-header */
-
-/* %endif */
-
-/* %if-c-only Standard (non-C++) definition */
-
-/* %if-not-reentrant */
-/* %not-for-header */
-
-/* %endif */
-
void xhpastrestart (FILE *input_file ,yyscan_t yyscanner );
void xhpast_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
YY_BUFFER_STATE xhpast_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
@@ -275,26 +216,17 @@
YY_BUFFER_STATE xhpast_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
YY_BUFFER_STATE xhpast_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
-/* %endif */
-
void *xhpastalloc (yy_size_t ,yyscan_t yyscanner );
void *xhpastrealloc (void *,yy_size_t ,yyscan_t yyscanner );
void xhpastfree (void * ,yyscan_t yyscanner );
-/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
/* Begin user sect3 */
#define xhpastwrap(yyscanner) 1
#define YY_SKIP_YYWRAP
-#define FLEX_DEBUG
-
#define yytext_ptr yytext_r
-/* %if-c-only Standard (non-C++) definition */
-
-/* %endif */
-
#ifdef YY_HEADER_EXPORT_START_CONDITIONS
#define INITIAL 0
#define PHP 1
@@ -315,34 +247,17 @@
* down here because we want the user's section 1 to have been scanned first.
* The user has a chance to override it with an option.
*/
-/* %if-c-only */
#include <unistd.h>
-/* %endif */
-/* %if-c++-only */
-/* %endif */
#endif
#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif
-/* %if-c-only Reentrant structure and macros (non-C++). */
-/* %if-reentrant */
-
-/* %if-c-only */
-
-/* %endif */
-
-/* %if-reentrant */
-
int xhpastlex_init (yyscan_t* scanner);
int xhpastlex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
-/* %endif */
-
-/* %endif End reentrant structures and macros. */
-
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
@@ -376,14 +291,10 @@
void xhpastset_column (int column_no ,yyscan_t yyscanner );
-/* %if-bison-bridge */
-
YYSTYPE * xhpastget_lval (yyscan_t yyscanner );
void xhpastset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
-/* %endif */
-
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
@@ -396,10 +307,6 @@
#endif
#endif
-/* %not-for-header */
-
-/* %endif */
-
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
#endif
@@ -409,16 +316,9 @@
#endif
#ifndef YY_NO_INPUT
-/* %if-c-only Standard (non-C++) definition */
-/* %not-for-header */
-/* %endif */
#endif
-/* %if-c-only */
-
-/* %endif */
-
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
@@ -434,40 +334,21 @@
#define YY_START_STACK_INCR 25
#endif
-/* %if-tables-serialization structures and prototypes */
-/* %not-for-header */
-
-/* %not-for-header */
-
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-/* %if-c-only Standard (non-C++) definition */
extern int xhpastlex \
(YYSTYPE * yylval_param ,yyscan_t yyscanner);
#define YY_DECL int xhpastlex \
(YYSTYPE * yylval_param , yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only C++ definition */
-/* %endif */
#endif /* !YY_DECL */
-/* %not-for-header */
-
-/* %if-c++-only */
-/* %not-for-header */
-
-/* %endif */
-
/* yy_get_previous_state - get the state just before the EOB char was reached */
-/* %if-c-only */
-/* %not-for-header */
-
#undef YY_NEW_FILE
#undef YY_FLUSH_BUFFER
#undef yy_set_bol
@@ -483,7 +364,7 @@
#line 403 "scanner.l"
-#line 487 "scanner.lex.hpp"
+#line 368 "scanner.lex.hpp"
#undef xhpastIN_HEADER
#endif /* xhpastHEADER_H */
/* @generated */
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
@@ -6,14 +6,6 @@
/* A lexical scanner generated by flex */
-/* %not-for-header */
-
-/* %if-c-only */
-/* %if-not-reentrant */
-/* %endif */
-/* %endif */
-/* %ok-for-header */
-
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
@@ -22,32 +14,16 @@
#define FLEX_BETA
#endif
-/* %if-c++-only */
-/* %endif */
-
-/* %if-c-only */
-
-/* %endif */
-
-/* %if-c-only */
-
-/* %endif */
-
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
-/* %if-c-only */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
-/* %endif */
-/* %if-tables-serialization */
-/* %endif */
/* end standard C headers. */
-/* %if-c-or-c++ */
/* flex integer type definitions */
#ifndef FLEXINT_H
@@ -112,11 +88,6 @@
#endif /* ! FLEXINT_H */
-/* %endif */
-
-/* %if-c++-only */
-/* %endif */
-
#ifdef __cplusplus
/* The "const" storage-class-modifier is valid. */
@@ -138,13 +109,8 @@
#define yyconst
#endif
-/* %not-for-header */
-
/* Returned upon end-of-file. */
#define YY_NULL 0
-/* %ok-for-header */
-
-/* %not-for-header */
/* Promotes a possibly negative, possibly signed char to an unsigned
* integer for use as an array index. If the signed char is negative,
@@ -152,9 +118,6 @@
* double cast.
*/
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-/* %ok-for-header */
-
-/* %if-reentrant */
/* An opaque pointer. */
#ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -173,11 +136,6 @@
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
#define yy_flex_debug yyg->yy_flex_debug_r
-/* %endif */
-
-/* %if-not-reentrant */
-/* %endif */
-
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
@@ -226,14 +184,6 @@
typedef size_t yy_size_t;
#endif
-/* %if-not-reentrant */
-/* %endif */
-
-/* %if-c-only */
-/* %if-not-reentrant */
-/* %endif */
-/* %endif */
-
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
@@ -261,12 +211,7 @@
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
{
-/* %if-c-only */
FILE *yy_input_file;
-/* %endif */
-
-/* %if-c++-only */
-/* %endif */
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
@@ -327,15 +272,6 @@
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-/* %if-c-only Standard (non-C++) definition */
-/* %not-for-header */
-
-/* %if-not-reentrant */
-/* %endif */
-/* %ok-for-header */
-
-/* %endif */
-
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
@@ -351,15 +287,6 @@
*/
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
-/* %if-c-only Standard (non-C++) definition */
-
-/* %if-not-reentrant */
-/* %not-for-header */
-
-/* %ok-for-header */
-
-/* %endif */
-
void xhpastrestart (FILE *input_file ,yyscan_t yyscanner );
void xhpast_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
YY_BUFFER_STATE xhpast_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
@@ -378,8 +305,6 @@
YY_BUFFER_STATE xhpast_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
YY_BUFFER_STATE xhpast_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
-/* %endif */
-
void *xhpastalloc (yy_size_t ,yyscan_t yyscanner );
void *xhpastrealloc (void *,yy_size_t ,yyscan_t yyscanner );
void xhpastfree (void * ,yyscan_t yyscanner );
@@ -408,45 +333,33 @@
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
/* Begin user sect3 */
#define xhpastwrap(yyscanner) 1
#define YY_SKIP_YYWRAP
-#define FLEX_DEBUG
-
typedef unsigned char YY_CHAR;
typedef int yy_state_type;
#define yytext_ptr yytext_r
-/* %% [1.5] DFA */
-
-/* %if-c-only Standard (non-C++) definition */
-
static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
static int yy_get_next_buffer (yyscan_t yyscanner );
static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
-/* %endif */
-
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
yyg->yytext_ptr = yy_bp; \
-/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
yyg->yytext_ptr -= yyg->yy_more_len; \
yyleng = (size_t) (yy_cp - yyg->yytext_ptr); \
yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
-/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
yyg->yy_c_buf_p = yy_cp;
-/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
#define YY_NUM_RULES 143
#define YY_END_OF_BUFFER 144
/* This struct is not used in this scanner,
@@ -3470,26 +3383,6 @@
0, 0, 0, 0, 0, 0, 0
} ;
-static yyconst flex_int16_t yy_rule_linenum[143] =
- { 0,
- 80, 85, 92, 99, 106, 113, 119, 123, 135, 139,
- 144, 148, 158, 163, 164, 169, 172, 176, 178, 186,
- 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
- 207, 208, 209, 210, 211, 212, 213, 214, 215, 216,
- 217, 218, 219, 220, 221, 222, 223, 224, 225, 226,
- 227, 228, 229, 230, 231, 232, 233, 234, 235, 236,
- 237, 238, 239, 240, 241, 242, 243, 244, 245, 246,
- 247, 248, 249, 250, 251, 252, 253, 254, 255, 256,
- 257, 258, 259, 260, 261, 262, 263, 264, 265, 266,
- 267, 268, 269, 270, 275, 276, 277, 278, 279, 280,
-
- 281, 282, 283, 284, 285, 286, 287, 288, 289, 290,
- 291, 292, 293, 294, 295, 296, 297, 298, 299, 300,
- 301, 306, 307, 308, 309, 310, 311, 312, 318, 319,
- 320, 321, 322, 326, 333, 340, 352, 359, 365, 385,
- 389, 397
- } ;
-
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
*/
@@ -3547,7 +3440,7 @@
-#line 3551 "scanner.lex.cpp"
+#line 3444 "scanner.lex.cpp"
#define INITIAL 0
#define PHP 1
@@ -3566,20 +3459,13 @@
* down here because we want the user's section 1 to have been scanned first.
* The user has a chance to override it with an option.
*/
-/* %if-c-only */
#include <unistd.h>
-/* %endif */
-/* %if-c++-only */
-/* %endif */
#endif
#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif
-/* %if-c-only Reentrant structure and macros (non-C++). */
-/* %if-reentrant */
-
/* Holds the entire state of the reentrant scanner. */
struct yyguts_t
{
@@ -3616,14 +3502,8 @@
}; /* end struct yyguts_t */
-/* %if-c-only */
-
static int yy_init_globals (yyscan_t yyscanner );
-/* %endif */
-
-/* %if-reentrant */
-
/* This must go here because YYSTYPE and YYLTYPE are included
* from bison output in section 1.*/
# define yylval yyg->yylval_r
@@ -3632,10 +3512,6 @@
int xhpastlex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
-/* %endif */
-
-/* %endif End reentrant structures and macros. */
-
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
@@ -3669,14 +3545,10 @@
void xhpastset_column (int column_no ,yyscan_t yyscanner );
-/* %if-bison-bridge */
-
YYSTYPE * xhpastget_lval (yyscan_t yyscanner );
void xhpastset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
-/* %endif */
-
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
@@ -3689,14 +3561,8 @@
#endif
#endif
-/* %not-for-header */
-
static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
-/* %ok-for-header */
-
-/* %endif */
-
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
#endif
@@ -3706,29 +3572,21 @@
#endif
#ifndef YY_NO_INPUT
-/* %if-c-only Standard (non-C++) definition */
-/* %not-for-header */
#ifdef __cplusplus
static int yyinput (yyscan_t yyscanner );
#else
static int input (yyscan_t yyscanner );
#endif
-/* %ok-for-header */
-/* %endif */
#endif
-/* %if-c-only */
-
static void yy_push_state (int new_state ,yyscan_t yyscanner);
static void yy_pop_state (yyscan_t yyscanner );
static int yy_top_state (yyscan_t yyscanner );
-/* %endif */
-
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
@@ -3741,14 +3599,10 @@
/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
-/* %if-c-only Standard (non-C++) definition */
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
-/* %endif */
-/* %if-c++-only C++ definition */
-/* %endif */
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -3756,7 +3610,6 @@
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
-/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
@@ -3785,8 +3638,6 @@
} \
}\
\
-/* %if-c++-only C++ definition \ */\
-/* %endif */
#endif
@@ -3805,41 +3656,22 @@
/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
-/* %if-c-only */
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
#endif
-/* %if-tables-serialization structures and prototypes */
-/* %not-for-header */
-
-/* %ok-for-header */
-
-/* %not-for-header */
-
-/* %tables-yydmap generated elements */
-/* %endif */
/* end tables serialization structures and prototypes */
-/* %ok-for-header */
-
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-/* %if-c-only Standard (non-C++) definition */
extern int xhpastlex \
(YYSTYPE * yylval_param ,yyscan_t yyscanner);
#define YY_DECL int xhpastlex \
(YYSTYPE * yylval_param , yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only C++ definition */
-/* %endif */
#endif /* !YY_DECL */
/* Code executed at the beginning of each rule, after yytext and yyleng
@@ -3854,12 +3686,9 @@
#define YY_BREAK break;
#endif
-/* %% [6.0] YY_RULE_SETUP definition goes here */
#define YY_RULE_SETUP \
YY_USER_ACTION
-/* %not-for-header */
-
/** The main scanner function which does all the work.
*/
YY_DECL
@@ -3883,18 +3712,10 @@
yyg->yy_start = 1; /* first start state */
if ( ! yyin )
-/* %if-c-only */
yyin = stdin;
-/* %endif */
-/* %if-c++-only */
-/* %endif */
if ( ! yyout )
-/* %if-c-only */
yyout = stdout;
-/* %endif */
-/* %if-c++-only */
-/* %endif */
if ( ! YY_CURRENT_BUFFER ) {
xhpastensure_buffer_stack (yyscanner);
@@ -3906,16 +3727,14 @@
}
{
-/* %% [7.0] user's declarations go here */
#line 76 "scanner.l"
/* Open / close PHP + inline HTML */
-#line 3915 "scanner.lex.cpp"
+#line 3735 "scanner.lex.cpp"
while ( 1 ) /* loops until end-of-file is reached */
{
-/* %% [8.0] yymore()-related code goes here */
yyg->yy_more_len = 0;
if ( yyg->yy_more_flag )
{
@@ -3932,7 +3751,6 @@
*/
yy_bp = yy_cp;
-/* %% [9.0] code to set up and find next match goes here */
yy_current_state = yyg->yy_start;
yy_match:
do
@@ -3953,7 +3771,6 @@
while ( yy_base[yy_current_state] != 12079 );
yy_find_action:
-/* %% [10.0] code to find the action number goes here */
yy_act = yy_accept[yy_current_state];
if ( yy_act == 0 )
{ /* have to back up */
@@ -3964,30 +3781,10 @@
YY_DO_BEFORE_ACTION;
-/* %% [11.0] code for yylineno update goes here */
-
do_action: /* This label is used only to access EOF actions. */
-/* %% [12.0] debug code goes here */
- if ( yy_flex_debug )
- {
- if ( yy_act == 0 )
- fprintf( stderr, "--scanner backing up\n" );
- else if ( yy_act < 143 )
- fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
- (long)yy_rule_linenum[yy_act], yytext );
- else if ( yy_act == 143 )
- fprintf( stderr, "--accepting default rule (\"%s\")\n",
- yytext );
- else if ( yy_act == 144 )
- fprintf( stderr, "--(end of buffer or a NUL)\n" );
- else
- fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
- }
-
switch ( yy_act )
{ /* beginning of action switch */
-/* %% [13.0] actions go here */
case 0: /* must back up */
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = yyg->yy_hold_char;
@@ -4906,7 +4703,7 @@
#line 404 "scanner.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 4910 "scanner.lex.cpp"
+#line 4707 "scanner.lex.cpp"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(PHP):
case YY_STATE_EOF(PHP_HEREDOC_START):
@@ -4980,7 +4777,6 @@
else
{
-/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
yy_cp = yyg->yy_c_buf_p;
goto yy_find_action;
}
@@ -5047,14 +4843,6 @@
} /* end of scanning one token */
} /* end of user's declarations */
} /* end of xhpastlex */
-/* %ok-for-header */
-
-/* %if-c++-only */
-/* %not-for-header */
-
-/* %ok-for-header */
-
-/* %endif */
/* yy_get_next_buffer - try to read in a new buffer
*
@@ -5063,11 +4851,7 @@
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
*/
-/* %if-c-only */
static int yy_get_next_buffer (yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
@@ -5202,24 +4986,16 @@
/* yy_get_previous_state - get the state just before the EOB char was reached */
-/* %if-c-only */
-/* %not-for-header */
-
static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
register yy_state_type yy_current_state;
register char *yy_cp;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-/* %% [15.0] code to get the start state into yy_current_state goes here */
yy_current_state = yyg->yy_start;
for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
{
-/* %% [16.0] code to find the next state goes here */
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
@@ -5251,15 +5027,10 @@
* synopsis
* next_state = yy_try_NUL_trans( current_state );
*/
-/* %if-c-only */
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
register int yy_is_jam;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
-/* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
yy_current_state = yy_NUL_trans[yy_current_state];
yy_is_jam = (yy_current_state == 0);
@@ -5268,12 +5039,7 @@
return yy_is_jam ? 0 : yy_current_state;
}
-/* %if-c-only */
-
static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
register char *yy_cp;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -5306,17 +5072,11 @@
*--yy_cp = (char) c;
-/* %% [18.0] update yylineno here */
-
yyg->yytext_ptr = yy_bp;
yyg->yy_hold_char = *yy_cp;
yyg->yy_c_buf_p = yy_cp;
}
-/* %if-c-only */
-
-/* %endif */
-/* %if-c-only */
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput (yyscan_t yyscanner)
@@ -5324,9 +5084,6 @@
static int input (yyscan_t yyscanner)
#endif
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
int c;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -5391,24 +5148,16 @@
*yyg->yy_c_buf_p = '\0'; /* preserve yytext */
yyg->yy_hold_char = *++yyg->yy_c_buf_p;
-/* %% [19.0] update BOL and yylineno */
-
return c;
}
-/* %if-c-only */
#endif /* ifndef YY_NO_INPUT */
-/* %endif */
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
* @param yyscanner The scanner object.
* @note This function does not reset the start condition to @c INITIAL .
*/
-/* %if-c-only */
void xhpastrestart (FILE * input_file , yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -5426,11 +5175,7 @@
* @param new_buffer The new input buffer.
* @param yyscanner The scanner object.
*/
-/* %if-c-only */
void xhpast_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -5462,11 +5207,7 @@
yyg->yy_did_buffer_switch_on_eof = 1;
}
-/* %if-c-only */
static void xhpast_load_buffer_state (yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
@@ -5481,11 +5222,7 @@
* @param yyscanner The scanner object.
* @return the allocated buffer state.
*/
-/* %if-c-only */
YY_BUFFER_STATE xhpast_create_buffer (FILE * file, int size , yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
YY_BUFFER_STATE b;
@@ -5513,11 +5250,7 @@
* @param b a buffer created with xhpast_create_buffer()
* @param yyscanner The scanner object.
*/
-/* %if-c-only */
void xhpast_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -5537,11 +5270,7 @@
* This function is sometimes called more than once on the same buffer,
* such as during a xhpastrestart() or at EOF.
*/
-/* %if-c-only */
static void xhpast_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
int oerrno = errno;
@@ -5561,13 +5290,8 @@
b->yy_bs_column = 0;
}
-/* %if-c-only */
-
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-/* %endif */
-/* %if-c++-only */
-/* %endif */
errno = oerrno;
}
@@ -5575,11 +5299,7 @@
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
* @param yyscanner The scanner object.
*/
-/* %if-c-only */
void xhpast_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! b )
@@ -5603,18 +5323,13 @@
xhpast_load_buffer_state(yyscanner );
}
-/* %if-c-or-c++ */
/** Pushes the new state onto the stack. The new state becomes
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
* @param yyscanner The scanner object.
*/
-/* %if-c-only */
void xhpastpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (new_buffer == NULL)
@@ -5640,18 +5355,12 @@
xhpast_load_buffer_state(yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
-/* %endif */
-/* %if-c-or-c++ */
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
* @param yyscanner The scanner object.
*/
-/* %if-c-only */
void xhpastpop_buffer_state (yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!YY_CURRENT_BUFFER)
@@ -5667,17 +5376,11 @@
yyg->yy_did_buffer_switch_on_eof = 1;
}
}
-/* %endif */
-/* %if-c-or-c++ */
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
-/* %if-c-only */
static void xhpastensure_buffer_stack (yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
yy_size_t num_to_alloc;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -5720,9 +5423,7 @@
yyg->yy_buffer_stack_max = num_to_alloc;
}
}
-/* %endif */
-/* %if-c-only */
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
@@ -5757,9 +5458,7 @@
return b;
}
-/* %endif */
-/* %if-c-only */
/** Setup the input buffer state to scan a string. The next call to xhpastlex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
@@ -5773,9 +5472,7 @@
return xhpast_scan_bytes(yystr,strlen(yystr) ,yyscanner);
}
-/* %endif */
-/* %if-c-only */
/** Setup the input buffer state to scan the given bytes. The next call to xhpastlex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
@@ -5812,13 +5509,8 @@
return b;
}
-/* %endif */
-/* %if-c-only */
static void yy_push_state (int new_state , yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth )
@@ -5843,11 +5535,7 @@
BEGIN(new_state);
}
-/* %if-c-only */
static void yy_pop_state (yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( --yyg->yy_start_stack_ptr < 0 )
@@ -5856,11 +5544,7 @@
BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]);
}
-/* %if-c-only */
static int yy_top_state (yyscan_t yyscanner)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1];
@@ -5870,15 +5554,11 @@
#define YY_EXIT_FAILURE 2
#endif
-/* %if-c-only */
static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
{
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
-/* %endif */
-/* %if-c++-only */
-/* %endif */
/* Redefine yyless() so it works in section 3 code. */
@@ -5899,9 +5579,6 @@
/* Accessor methods (get/set functions) to struct members. */
-/* %if-c-only */
-/* %if-reentrant */
-
/** Get the user-defined data for this scanner.
* @param yyscanner The scanner object.
*/
@@ -5911,8 +5588,6 @@
return yyextra;
}
-/* %endif */
-
/** Get the current line number.
* @param yyscanner The scanner object.
*/
@@ -5976,8 +5651,6 @@
return yytext;
}
-/* %if-reentrant */
-
/** Set the user-defined data. This data is never touched by the scanner.
* @param user_defined The data to be associated with this scanner.
* @param yyscanner The scanner object.
@@ -5988,8 +5661,6 @@
yyextra = user_defined ;
}
-/* %endif */
-
/** Set the current line number.
* @param line_number
* @param yyscanner The scanner object.
@@ -6050,13 +5721,8 @@
yy_flex_debug = bdebug ;
}
-/* %endif */
-
-/* %if-reentrant */
/* Accessor methods for yylval and yylloc */
-/* %if-bison-bridge */
-
YYSTYPE * xhpastget_lval (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -6069,8 +5735,6 @@
yylval = yylval_param;
}
-/* %endif */
-
/* User-visible API */
/* xhpastlex_init is special because it creates the scanner itself, so it is
@@ -6135,9 +5799,6 @@
return yy_init_globals ( *ptr_yy_globals );
}
-/* %endif if-c-only */
-
-/* %if-c-only */
static int yy_init_globals (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -6170,9 +5831,7 @@
*/
return 0;
}
-/* %endif */
-/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
/* xhpastlex_destroy is for both reentrant and non-reentrant scanners. */
int xhpastlex_destroy (yyscan_t yyscanner)
{
@@ -6197,14 +5856,11 @@
* xhpastlex() is called, initialization will occur. */
yy_init_globals( yyscanner);
-/* %if-reentrant */
/* Destroy the main struct (reentrant only). */
xhpastfree ( yyscanner , yyscanner );
yyscanner = NULL;
-/* %endif */
return 0;
}
-/* %endif */
/*
* Internal utility routines.
@@ -6252,12 +5908,7 @@
free( (char *) ptr ); /* see xhpastrealloc() for (char *) cast */
}
-/* %if-tables-serialization definitions */
-/* %define-yytables The name for this specific scanner's tables. */
#define YYTABLES_NAME "yytables"
-/* %endif */
-
-/* %ok-for-header */
#line 403 "scanner.l"
diff --git a/support/xhpast/xhpast.cpp b/support/xhpast/xhpast.cpp
--- a/support/xhpast/xhpast.cpp
+++ b/support/xhpast/xhpast.cpp
@@ -14,7 +14,7 @@
int main(int argc, char* argv[]) {
if (argc != 1) {
// Coupling: modify also src/parser/xhpast/bin/PhutilXHPASTBinary.php
- cout << "5.5.9\n";
+ cout << "5.6.0\n";
return 0;
}

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 27, 12:01 PM (1 h, 30 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7060590
Default Alt Text
D13969.id.diff (32 KB)

Event Timeline