wok-current diff xxdiff/stuff/bison-3.02.patch @ rev 24925
updated mpc (0.33 -> 0.34)
author | Hans-G?nter Theisgen |
---|---|
date | Wed Apr 13 13:55:09 2022 +0100 (2022-04-13) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xxdiff/stuff/bison-3.02.patch Wed Apr 13 13:55:09 2022 +0100 1.3 @@ -0,0 +1,106 @@ 1.4 +from f9f3270a4253144488f87a72bf941f510891dbb1 in https://github.com/blais/xxdiff/ 1.5 +--- xxdiff-401/src/resParser.cpp 1.6 ++++ xxdiff-401/src/resParser.cpp 1.7 +@@ -73,7 +73,7 @@ extern int resParserparse( void* ); 1.8 + 1.9 + //------------------------------------------------------------------------------ 1.10 + // 1.11 +-void resParsererror( const char* msg ) 1.12 ++void resParsererror( XxResources *, const char* msg ) 1.13 + { 1.14 + // Send errors to stdout so we can filter out the debug info shmeglu while 1.15 + // debugging parser. 1.16 +@@ -794,7 +794,7 @@ int parseFromKeywordList( 1.17 + QString os; 1.18 + QTextStream oss( &os ); 1.19 + oss << "Unknown " << errmsg << ": " << name << flush; 1.20 +- resParsererror( os.toLatin1().constData() ); 1.21 ++ resParsererror( NULL, os.toLatin1().constData() ); 1.22 + } 1.23 + num = ERROR_TOKEN; 1.24 + return ERROR_TOKEN; 1.25 +--- xxdiff-401/src/resParser.l 1.26 ++++ xxdiff-401/src/resParser.l 1.27 +@@ -76,7 +76,7 @@ if ( input_stream_ptr->atEnd() ) { 1.28 + result = YY_NULL; \ 1.29 + } \ 1.30 + else { \ 1.31 +- int ii = 0; \ 1.32 ++ unsigned ii = 0; \ 1.33 + for ( ; (ii < max_size) && (!input_stream_ptr->atEnd()); ++ii ) { \ 1.34 + (*input_stream_ptr) >> buf[ii]; \ 1.35 + } \ 1.36 +--- xxdiff-401/src/resParser.y 1.37 ++++ xxdiff-401/src/resParser.y 1.38 +@@ -20,11 +20,6 @@ 1.39 + * 1.40 + ******************************************************************************/ 1.41 + 1.42 +-%union 1.43 +-{ 1.44 +- int num; 1.45 +- char* str; 1.46 +-} 1.47 + %{ 1.48 + 1.49 + // xxdiff imports 1.50 +@@ -39,12 +34,22 @@ 1.51 + 1.52 + // The parser input is the resources object to fill in. 1.53 + #define RESOURCES ( static_cast<XxResources*>(resources) ) 1.54 +-#define YYPARSE_PARAM resources 1.55 ++%} 1.56 ++ 1.57 ++%define api.pure full 1.58 ++%parse-param {XxResources * resources} 1.59 + 1.60 ++%union 1.61 ++{ 1.62 ++ int num; 1.63 ++ char* str; 1.64 ++} 1.65 ++ 1.66 ++%{ 1.67 + // Declare lexer from other compilation unit. 1.68 + int resParserlex( YYSTYPE* yylval ); 1.69 + 1.70 +-void resParsererror( const char* msg ); 1.71 ++void resParsererror( XxResources *, const char* msg ); 1.72 + 1.73 + // Declare some parser functions and data defined in resParser.cpp 1.74 + namespace XxResParserNS { 1.75 +@@ -144,7 +149,6 @@ using namespace XxResParserNS; // Make s 1.76 + %type <num> boolkwd 1.77 + 1.78 + %start xxdiffrc 1.79 +-%pure_parser 1.80 + 1.81 + %% 1.82 + xxdiffrc : stmts 1.83 +@@ -188,7 +192,7 @@ prefgeometry : PREFGEOMETRY COLON GEOMSP 1.84 + RESOURCES->setPreferredGeometry( geometry ); 1.85 + } 1.86 + else { 1.87 +- yyerror( "Bad geometry specification." ); 1.88 ++ yyerror( NULL, "Bad geometry specification." ); 1.89 + // Should never happen, the lexer regexp should be tough 1.90 + // enough. 1.91 + } 1.92 +@@ -212,7 +216,7 @@ style : STYLE COLON STRING 1.93 + QString err = QString( "Requested style key does not exist." ); 1.94 + err += QString( "\nValid styles are: " ); 1.95 + err += styles.join( ", " ); 1.96 +- yyerror( err.toLatin1().constData() ); 1.97 ++ yyerror( NULL, err.toLatin1().constData() ); 1.98 + } 1.99 + } 1.100 + ; 1.101 +@@ -224,7 +228,7 @@ accel : ACCEL DOT ACCELNAME COLON STRIN 1.102 + char buf[2048]; 1.103 + ::snprintf( buf, 2048, 1.104 + "Unrecognized accelerator: %s\n", $5 ); 1.105 +- yyerror( buf ); 1.106 ++ yyerror( NULL, buf ); 1.107 + } 1.108 + } 1.109 + ;