Просмотр исходного кода

Merge pull request #14249 from ghalliday/issue24888

HPCC-24888 Support bison 3.7

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 4 лет назад
Родитель
Сommit
80e7af3b8c
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      ecl/hql/hqlgram.y

+ 8 - 1
ecl/hql/hqlgram.y

@@ -13208,6 +13208,13 @@ int yyuntranslate(int token)
     return '?';
 }
 
+//Recent versions of bison have switched to using an enumerated type
+#ifdef YYTERROR
+#define BISON_ERROR_TOKEN YYTERROR
+#else
+#define BISON_ERROR_TOKEN YYSYMBOL_YYerror
+#endif
+
 /* Cloned and modified from the verbose yyerror implementation */
 static void eclsyntaxerror(HqlGram * parser, const char * s, short yystate, int token)
 {
@@ -13229,7 +13236,7 @@ static void eclsyntaxerror(HqlGram * parser, const char * s, short yystate, int
   int curExpected = 0;
   for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
   {
-    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+    if (yycheck[yyx + yyn] == yyx && yyx != BISON_ERROR_TOKEN)
         expected[curExpected++] = yyuntranslate(yyx);
   }
   expected[curExpected++] = 0;