Fix for Bug#144987

Andreas Pakulat apaku at gmx.de
Thu May 3 19:44:43 UTC 2007


Hi,

I'd like to apply the attached patch to the QMake parser, it fixes the
bug number 144987. It allows the parser to parse QMake Variable
assignments with EOF instead of newline at the end of the assignment.

Ok to commit?

Andreas

PS: The patch only contains the changes to the .yy and .ll files, I left
out the _yacc.* and _lex.cpp files as they are autogenerated anyway.

-- 
Good news.  Ten weeks from Friday will be a pretty good day.
-------------- next part --------------
Index: qmake.yy
===================================================================
--- qmake.yy	(Revision 660336)
+++ qmake.yy	(Arbeitskopie)
@@ -137,6 +137,7 @@ Don't forget to uncomment "yydebug = 1" 
 %token QUOTED_VARIABLE_VALUE
 %token VARIABLE_VALUE
 %token LIST_WS
+%token ENDOFFILE
 %%
 
 project :
@@ -188,6 +189,16 @@ variable_assignment : ID_SIMPLE operator
             node->indent = $<indent>3;
             $<node>$ = node;
         }
+    | ID_SIMPLE operator multiline_values listws ENDOFFILE
+        {
+            AssignmentAST *node = new AssignmentAST();
+            node->scopedID = $<value>1;
+            node->op = $<value>2;
+            node->values = $<values>3 ;
+            node->values.append( $<value>4 );
+            node->indent = $<indent>3;
+            $<node>$ = node;
+        }
     | ID_SIMPLE operator multiline_values listws CONT
         {
             AssignmentAST *node = new AssignmentAST();
@@ -219,6 +230,14 @@ variable_assignment : ID_SIMPLE operator
             node->values.append( $<value>4 );
             $<node>$ = node;
         }
+    | ID_SIMPLE operator listws ENDOFFILE
+        {
+            AssignmentAST *node = new AssignmentAST();
+            node->scopedID = $<value>1;
+            node->op = $<value>2;
+            node->values.append( $<value>3 );
+            $<node>$ = node;
+        }
     | ID_SIMPLE operator listws COMMENT
         {
             AssignmentAST *node = new AssignmentAST();
Index: qmake.ll
===================================================================
--- qmake.ll	(Revision 660336)
+++ qmake.ll	(Arbeitskopie)
@@ -74,9 +74,13 @@ comment_cont      \\{ws}*#[^\r\n]*{newli
 cont              \\{ws}*{newline}
 
 %%
+<vallist><<EOF>> {
+    BEGIN(INITIAL);
+    return Parser::token::token::ENDOFFILE;
+}
 <INITIAL>{ws} {
-    mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
-    return Parser::token::token::WS;
+    //mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+    //return Parser::token::token::WS;
 }
 
 <vallist>{ws} {


More information about the KDevelop-devel mailing list