Page MenuHomePhabricator

Building xhpast is broken
Closed, ResolvedPublic

Description

In rPHUcc66c966346cdf68727f3f638f268f5a6f621a40#ffe7dcca scanner.l was changed. However, these changes introduced illegal constructs in the file.

richard @richard-pc[/opt/arc/libphutil/support/xhpast]
-> make scanner parser all
flex -C --header-file=scanner.lex.hpp -o scanner.lex.cpp -d scanner.l
scanner.l:316: unrecognized rule
scanner.l:316: unrecognized rule
scanner.l:316: unrecognized rule
scanner.l:317: unrecognized rule
scanner.l:317: unrecognized rule
scanner.l:317: unrecognized rule
scanner.l:334: missing quote
scanner.l:335: missing quote
scanner.l:339: unrecognized rule
scanner.l:339: unrecognized rule
scanner.l:339: unrecognized rule
scanner.l:340: unrecognized rule
scanner.l:340: unrecognized rule
Makefile:33: recipe for target 'scanner' failed
make: *** [scanner] Error 1

Revisions and Commits

Event Timeline

richardvanvelzen raised the priority of this task from to Needs Triage.
richardvanvelzen updated the task description. (Show Details)
richardvanvelzen added a project: XHPAST.
richardvanvelzen added a subscriber: richardvanvelzen.

These changes fix it:

diff --git a/support/xhpast/scanner.l b/support/xhpast/scanner.l
index 28cf40f..bbdde72 100644
--- a/support/xhpast/scanner.l
+++ b/support/xhpast/scanner.l
@@ -313,8 +313,8 @@ NEWLINE ("\r\n"|"\n"|"\r")
   "("{TABS_AND_SPACES}unset{TABS_AND_SPACES}")" tok(T_UNSET_CAST);
 }
 
-// Scalars (parsing these doesn't really matter since we just pass
-// them through literally)
+ /* Scalars (parsing these doesn't really matter since we just pass them
+    through literally) */
 <PHP,PHP_NO_RESERVED_WORDS,PHP_NO_RESERVED_WORDS_PERSIST>{
   {LNUM}|{HNUM}|{BNUM} tok(T_LNUMBER);
   {DNUM}|{EXPONENT_DNUM} tok(T_DNUMBER);
@@ -331,8 +331,7 @@ NEWLINE ("\r\n"|"\n"|"\r")
 }
 
  /* (HERE|NOW)DOC's */
-<PHP,PHP_NO_RESERVED_WORDS,PHP_NO_RESERVED_WORDS_PERSIST>b?"<<<
-  "{TABS_AND_SPACES} {
+<PHP,PHP_NO_RESERVED_WORDS,PHP_NO_RESERVED_WORDS_PERSIST>b?"<<<"{TABS_AND_SPACES} {
 
   push_state(PHP_HEREDOC_START);
   yyextra->heredoc_yyleng = yyleng;