[anjuta/newproject] Update am parser from the makefile parser and fix regression test



commit 327581637a1018479795c2a4d95fac23e79c2b7b
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Sat May 15 21:42:13 2010 +0200

    Update am parser from the makefile parser and fix regression test

 plugins/am-project/am-parser.y        |  360 ++++++++++++++++++++++++---------
 plugins/am-project/am-project.c       |    1 -
 plugins/am-project/am-scanner.l       |   36 +++-
 plugins/am-project/projectparser.c    |    2 +-
 plugins/am-project/tests/Makefile.am  |    3 +-
 plugins/am-project/tests/anjuta.lst   |  166 ++++++++-------
 plugins/am-project/tests/testsuite.at |    1 +
 plugins/am-project/tests/variable.at  |   18 ++
 plugins/mk-project/mk-parser.y        |    2 +-
 9 files changed, 411 insertions(+), 178 deletions(-)
---
diff --git a/plugins/am-project/am-parser.y b/plugins/am-project/am-parser.y
index 7e8f235..1c5b0b6 100644
--- a/plugins/am-project/am-parser.y
+++ b/plugins/am-project/am-parser.y
@@ -34,6 +34,7 @@
 %token	EOL	'\n'
 %token	SPACE
 %token	TAB '\t'
+%token	HASH '#'
 %token	MACRO
 %token	VARIABLE
 %token	COLON ':'
@@ -100,10 +101,16 @@
 
 %start file
 
+%expect 1
+
 %debug
 
+%verbose
+
 %{
 
+//amp_am_yydebug = 1;
+
 static gint
 amp_am_automake_variable (AnjutaToken *token)
 {
@@ -154,69 +161,163 @@ amp_am_automake_variable (AnjutaToken *token)
 %%
 
 file:
-	optional_space statement
-	| file EOL optional_space statement
+	statement
+	| file statement
 	;
-        
-statement:
-	/* empty */
-	| line
-	| am_variable
+
+/*statement:
+	end_of_line
+	| space  end_of_line
+	| definition  end_of_line
+	| am_variable  end_of_line
+	| rule  command_list
 	| include
-	;
+	;*/
 
-line:
-	name_token
-	| line token
+statement:
+	end_of_line
+	| space  end_of_line
+	| definition  end_of_line
+	| am_variable  end_of_line
+	| include  end_of_line
+	| line  end_of_line {
+		g_message ("line");
+	}
+	| rule  command_list {
+		g_message ("rule");
+	}
 	;
-		
+	
 am_variable:
-	automake_token space_list_value {
-		$$= anjuta_token_merge_previous ($2, $1);
-		amp_am_scanner_set_am_variable (scanner, amp_am_automake_variable ($1), $1, anjuta_token_last_item ($2));
+	optional_space  automake_token  optional_space  equal_token  value_list {
+		$$ = anjuta_token_new_static (ANJUTA_TOKEN_LIST, NULL);
+		anjuta_token_merge ($$, $2);
+		if ($3 != NULL) anjuta_token_set_type ($3, ANJUTA_TOKEN_START);
+		anjuta_token_merge ($$, $4);
+		anjuta_token_merge ($$, $5);
+		amp_am_scanner_set_am_variable (scanner, amp_am_automake_variable ($2), $2, anjuta_token_last_item ($$));
 	}
-	| automake_token optional_space equal_token optional_space
-    {
+	| optional_space automake_token optional_space equal_token
+	{
 		$$ = anjuta_token_new_static (ANJUTA_TOKEN_LIST, NULL);
-        anjuta_token_merge ($$, $1);
-    }
+		anjuta_token_merge ($$, $2);
+	}
 	;
 
 include:
-	include_token space value {
+	optional_space  include_token  value_list {
 		amp_am_scanner_include (scanner, $3);
 	}
 
-space_list_value: optional_space  equal_token   value_list  {
-		$$ = anjuta_token_new_static (ANJUTA_TOKEN_LIST, NULL);
-		if ($1 != NULL) anjuta_token_set_type ($1, ANJUTA_TOKEN_START);
-		anjuta_token_merge ($$, $1);
-		anjuta_token_merge ($$, $2);
+definition:
+	head_list  equal_token value_list {
+		g_message ("definition %s", anjuta_token_evaluate ($1));
+	}
+	| head_list  equal_token {
+		g_message ("definition %s", anjuta_token_evaluate ($1));
+	}
+	;
+
+rule:
+	depend_list  end_of_line
+	| depend_list  SEMI_COLON  command_line  EOL
+	;
+
+depend_list:
+	head_list  rule_token  prerequisite_list
+	;
+
+command_list:
+	/* empty */
+	| command_list TAB command_line EOL
+	;
+
+line:
+	head_list
+	;
+
+/* Lists
+ *----------------------------------------------------------------------------*/
+
+end_of_line:
+	EOL {
+		$$ = NULL;
+	}
+	| comment {
+		$$ = NULL;
+	}
+	;
+
+comment:
+	HASH not_eol_list EOL
+	;
+
+not_eol_list:
+	/* empty */
+	| not_eol_list not_eol_token
+	;
+
+prerequisite_list:
+	/* empty */
+	| space
+	| optional_space  prerequisite_list_body  optional_space
+	;
+
+prerequisite_list_body:
+	prerequisite
+	| prerequisite_list_body  space  prerequisite
+	;
+
+head_list:
+	optional_space head_list_body optional_space {
+		$$ = anjuta_token_merge_previous ($2, $1);
 		anjuta_token_merge ($$, $3);
 	}
 	;
 
+head_list_body:
+	head {
+		$$ = anjuta_token_new_static (ANJUTA_TOKEN_NAME, NULL);
+	anjuta_token_merge ($$, $1);
+	}
+	| head_list_body  space  head {
+		anjuta_token_merge ($1, $2);
+	anjuta_token_merge ($1, $3);
+	}
+	;
+
 value_list:
-	optional_space strip_value_list optional_space {
+	space
+	| optional_space value_list_body optional_space {
 		if ($1 != NULL) anjuta_token_set_type ($1, ANJUTA_TOKEN_START);
 		if ($3 != NULL) anjuta_token_set_type ($3, ANJUTA_TOKEN_LAST);
 		anjuta_token_merge_previous ($2, $1);
 		anjuta_token_merge ($2, $3);
 		$$ = $2;
 	}
-		
-strip_value_list:
+
+value_list_body:
 	value {
 		$$ = anjuta_token_new_static (ANJUTA_TOKEN_LIST, NULL);
 		anjuta_token_merge ($$, $1);
 	}
-	| strip_value_list  space  value {
+	| value_list_body space  value {
 		anjuta_token_set_type ($2, ANJUTA_TOKEN_NEXT);
 		anjuta_token_merge ($1, $2);
 		anjuta_token_merge ($1, $3);
 	}
 	;
 
+	
+	
+command_line:
+	/* empty */
+	| command_line command_token
+	;
+
+/* Items
+ *----------------------------------------------------------------------------*/
+
 optional_space:
 	/* empty */ {
 		$$ = NULL;
@@ -224,42 +325,110 @@ optional_space:
 	| space
 	;
 
-value:
+space:
+	space_token {
+		$$ = anjuta_token_new_static (ANJUTA_TOKEN_SPACE, NULL);
+		anjuta_token_merge ($$, $1);
+	}
+	| space space_token {
+		anjuta_token_merge ($1, $2);
+	}
+	;
+
+head:
+	head_token {
+		$$ = anjuta_token_new_static (ANJUTA_TOKEN_NAME, NULL);
+		anjuta_token_merge ($$, $1);
+	}
+	| head head_token {
+		anjuta_token_merge ($1, $2);
+	}
+	| head automake_token {
+		anjuta_token_merge ($1, $2);
+	}
+	| head include_token {
+		anjuta_token_merge ($1, $2);
+	}
+	| head variable_token
+	;
+
+/*value:
 	value_token {
 		$$ = anjuta_token_new_static (ANJUTA_TOKEN_ARGUMENT, NULL);
 		anjuta_token_merge ($$, $1);
 	}
+	| space_token {
+		$$ = anjuta_token_new_static (ANJUTA_TOKEN_ARGUMENT, NULL);
+		anjuta_token_merge ($$, $1);
+	}
 	| value value_token {
 		anjuta_token_merge ($1, $2);
 	}
-	;
+	| value space_token {
+		anjuta_token_merge ($1, $2);
+	}
+	;*/
 
-space:
-	space_token {
-		$$ = anjuta_token_new_static (ANJUTA_TOKEN_SPACE, NULL);
-		anjuta_token_merge ($$, $1);}
-	| space space_token	{
+value:
+	value_token {
+		$$ = anjuta_token_new_static (ANJUTA_TOKEN_ARGUMENT, NULL);
+		anjuta_token_merge ($$, $1);
+	}
+	| value value_token {
 		anjuta_token_merge ($1, $2);
 	}
 	;
 
-		
-token:
-	space_token
-	| value_token
-	;            
-	
-value_token:
-	equal_token
+prerequisite:
+	name_prerequisite
+	;
+
+name_prerequisite:
+	prerequisite_token
+	| variable_token
+	| name_prerequisite prerequisite_token
+	| name_prerequisite variable_token
+	;
+
+/* Tokens
+ *----------------------------------------------------------------------------*/
+
+not_eol_token:
+	word_token
+	| space_token
+	;
+
+prerequisite_token:
+	name_token
+	| equal_token
+	| rule_token
+	;
+
+command_token:
+	name_token
+	| variable_token
+	| automake_token
+	| equal_token
 	| rule_token
-	| target_token
+	| depend_token
+	| space_token
 	;
 
-target_token:
-	head_token
+value_token:
+	name_token
+	| variable_token
+	| equal_token
+	| rule_token
+	| depend_token
+	| include_token
 	| automake_token
 	;
 
+head_token:
+	name_token
+	| depend_token
+	;
+
 space_token:
 	SPACE
 	| TAB
@@ -276,59 +445,66 @@ rule_token:
 	COLON
 	| DOUBLE_COLON
 	;
-		
-head_token:
-	MACRO
-	| VARIABLE
-	| NAME
-	| CHARACTER
-	| ORDER
-	| SEMI_COLON
+
+depend_token:
+	SEMI_COLON
 	;
 
+word_token:
+	name_token
+	| equal_token
+	| rule_token
+	| depend_token
+	;
+
+
 name_token:
 	MACRO
-	| VARIABLE
 	| NAME
 	| CHARACTER
+	| ORDER
 	;
-		
+
+variable_token:
+	VARIABLE
+	;
+
 automake_token:
-    SUBDIRS
-    | DIST_SUBDIRS
-    | _DATA
-    | _HEADERS
-    | _LIBRARIES
-    | _LISP
-    | _LTLIBRARIES
-    | _MANS
-    | _PROGRAMS
-    | _PYTHON
-    | _JAVA
-    | _SCRIPTS
-    | _SOURCES
-    | _TEXINFOS
-    |  _DIR
-    |  _LDFLAGS
-    |  _CPPFLAGS
-    |  _CFLAGS
-    |  _CXXFLAGS
-    |  _JAVACFLAGS
-    |  _FCFLAGS
-    |  _OBJCFLAGS
-    |  _LFLAGS
-    |  _YFLAGS
-    |  TARGET_LDFLAGS
-    |  TARGET_CPPFLAGS
-    |  TARGET_CFLAGS
-    |  TARGET_CXXFLAGS
-    |  TARGET_JAVACFLAGS
-    |  TARGET_FCFLAGS
-    |  TARGET_OBJCFLAGS
-    |  TARGET_LFLAGS
-    |  TARGET_YFLAGS
-    |  TARGET_DEPENDENCIES
-    ;
+	SUBDIRS
+	| DIST_SUBDIRS
+	| _DATA
+	| _HEADERS
+	| _LIBRARIES
+	| _LISP
+	| _LTLIBRARIES
+	| _MANS
+	| _PROGRAMS
+	| _PYTHON
+	| _JAVA
+	| _SCRIPTS
+	| _SOURCES
+	| _TEXINFOS
+	|  _DIR
+	|  _LDFLAGS
+	|  _CPPFLAGS
+	|  _CFLAGS
+	|  _CXXFLAGS
+	|  _JAVACFLAGS
+	|  _FCFLAGS
+	|  _OBJCFLAGS
+	|  _LFLAGS
+	|  _YFLAGS
+	|  TARGET_LDFLAGS
+	|  TARGET_CPPFLAGS
+	|  TARGET_CFLAGS
+	|  TARGET_CXXFLAGS
+	|  TARGET_JAVACFLAGS
+	|  TARGET_FCFLAGS
+	|  TARGET_OBJCFLAGS
+	|  TARGET_LFLAGS
+	|  TARGET_YFLAGS
+	|  TARGET_DEPENDENCIES
+	;
 
 include_token:
 	INCLUDE
diff --git a/plugins/am-project/am-project.c b/plugins/am-project/am-project.c
index 9af9998..89052c2 100644
--- a/plugins/am-project/am-project.c
+++ b/plugins/am-project/am-project.c
@@ -1827,7 +1827,6 @@ project_load_makefile (AmpProject *project, GFile *file, AnjutaProjectNode *pare
 void
 amp_project_set_am_variable (AmpProject* project, AmpGroup* group, AnjutaTokenType variable, AnjutaToken *name, AnjutaToken *list, GHashTable *orphan_properties)
 {
-	
 	switch (variable)
 	{
 	case AM_TOKEN_SUBDIRS:
diff --git a/plugins/am-project/am-scanner.l b/plugins/am-project/am-scanner.l
index 4ceb724..29b77bb 100644
--- a/plugins/am-project/am-scanner.l
+++ b/plugins/am-project/am-scanner.l
@@ -35,7 +35,7 @@
 
 #define YY_DECL static int am_yylex (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner)
 
-//#define YY_USER_INIT {yy_flex_debug = 1;}
+#define YY_USER_INIT {yy_flex_debug = 1;}
 
 static int amp_am_scanner_parse_end (AmpAmScanner *scanner);
 
@@ -76,6 +76,10 @@ NAME          [^ \t\n\r:#=$"'`&@\\]*
 
 <INITIAL>\n 						{ RETURN (EOL); }
 
+<INITIAL>([ ]|\\\n)([ \t]|\\\n)*	{ RETURN (SPACE); }
+
+<INITIAL>#							{ RETURN (HASH); }
+
 <INITIAL>([ ]|\\\n)([ \t]|\\\n)* 	{ RETURN (SPACE); }
 
 <INITIAL>([ \t])*#.*\n 				{ RETURN (EOL); }
@@ -116,6 +120,8 @@ NAME          [^ \t\n\r:#=$"'`&@\\]*
 
 <INITIAL>include					{ RETURN (INCLUDE); }
 
+<INITIAL>\-include					{ RETURN (INCLUDE); }
+
 <INITIAL>SUBDIRS 					{ RETURN (SUBDIRS); }
 
 <INITIAL>DIST_SUBDIRS 				{ RETURN (DIST_SUBDIRS); }
@@ -233,6 +239,7 @@ amp_am_scanner_set_am_variable (AmpAmScanner *scanner, AnjutaTokenType variable,
 {
     amp_project_set_am_variable (scanner->project, scanner->group, variable, name, list, scanner->orphan_properties);
 }
+
 void
 amp_am_scanner_include (AmpAmScanner *scanner, AnjutaToken *name)
 {
@@ -241,8 +248,8 @@ amp_am_scanner_include (AmpAmScanner *scanner, AnjutaToken *name)
 	AnjutaToken *token;
 	gchar *filename;
 
-	filename = anjuta_token_evaluate (name);
-	//g_message ("read include =%s=", filename);
+	filename = g_strstrip (anjuta_token_evaluate (name));
+	g_message ("read include =%s=", filename);
 	file = g_file_resolve_relative_path (anjuta_token_stream_get_current_directory (scanner->stream), filename);
 	g_free (filename);
 	include = anjuta_token_file_new (file);
@@ -252,6 +259,27 @@ amp_am_scanner_include (AmpAmScanner *scanner, AnjutaToken *name)
 	g_object_unref (file);
 }
 
+void
+amp_am_scanner_parse_variable (AmpAmScanner *scanner, AnjutaToken *variable)
+{
+	AnjutaToken *group;
+	AnjutaToken *content;
+
+	anjuta_token_set_type (variable, ANJUTA_TOKEN_VARIABLE);
+	content = anjuta_token_new_static (ANJUTA_TOKEN_CONTENT, NULL);
+	anjuta_token_stream_append_token (scanner->stream, content);
+
+	/*group = mkp_project_get_variable_token (scanner->project, variable);
+	fprintf(stdout, "get variable %s is %p\n", anjuta_token_evaluate (variable), group);
+	if (group != NULL)
+	{
+		fprintf (stdout,"variable %s\n", anjuta_token_get_string (variable));
+		//anjuta_token_dump (group);
+		amp_am_scanner_parse_token (scanner, group, NULL, NULL);
+		//anjuta_token_free (token);
+	}*/
+}
+
 
 /* Public functions
  *---------------------------------------------------------------------------*/
@@ -323,7 +351,7 @@ amp_am_scanner_new (AmpProject *project, AmpGroup *group)
     yyset_extra (scanner, scanner->scanner);
 
 	return scanner;
-};
+}
 
 void
 amp_am_scanner_free (AmpAmScanner *scanner)
diff --git a/plugins/am-project/projectparser.c b/plugins/am-project/projectparser.c
index d8d5825..4c53dd7 100644
--- a/plugins/am-project/projectparser.c
+++ b/plugins/am-project/projectparser.c
@@ -360,7 +360,7 @@ get_project_property (AmpProject *project, AnjutaProjectNode *parent, const gcha
 int
 main(int argc, char *argv[])
 {
-	IAnjutaProject *project;
+	IAnjutaProject *project = NULL;
 	AnjutaProjectNode *node;
 	AnjutaProjectNode *sibling;
 	AnjutaProjectNode *root = NULL;
diff --git a/plugins/am-project/tests/Makefile.am b/plugins/am-project/tests/Makefile.am
index 35f0c8d..680d4dd 100644
--- a/plugins/am-project/tests/Makefile.am
+++ b/plugins/am-project/tests/Makefile.am
@@ -22,7 +22,8 @@ TESTSUITE_AT = \
 	$(srcdir)/source.at \
 	$(srcdir)/parser.at \
 	$(srcdir)/acinit.at \
-	$(srcdir)/include.at
+	$(srcdir)/include.at \
+	$(srcdir)/variable.at
 
 TESTSUITE = $(srcdir)/testsuite
 
diff --git a/plugins/am-project/tests/anjuta.lst b/plugins/am-project/tests/anjuta.lst
index 3c99492..7bee5e1 100644
--- a/plugins/am-project/tests/anjuta.lst
+++ b/plugins/am-project/tests/anjuta.lst
@@ -552,6 +552,8 @@
                         GROUP (19:5:9:0:5:1): po
                             TARGET (19:5:9:0:5:1:0): wizard_files
                                 SOURCE (19:5:9:0:5:1:0:0): plugins/project-wizard/templates/gtkmm/po/POTFILES.in
+                        TARGET (19:5:9:0:5:2): wizard_files
+                            SOURCE (19:5:9:0:5:2:0): plugins/project-wizard/templates/gtkmm/ 
                     GROUP (19:5:9:0:6): wxwin
                         GROUP (19:5:9:0:6:0): src
                             TARGET (19:5:9:0:6:0:0): wizard_files
@@ -722,32 +724,34 @@
                     SOURCE (19:5:9:1:0): plugins/project-wizard/anjuta-project-wizard.ui
                     SOURCE (19:5:9:1:1): plugins/project-wizard/applogo.png
                     SOURCE (19:5:9:1:2): plugins/project-wizard/appwizard.png
-                TARGET (19:5:9:2): wizard_pixmaps
-                    SOURCE (19:5:9:2:0): plugins/project-wizard/anjuta-project-wizard-plugin.svg
-                    SOURCE (19:5:9:2:1): plugins/project-wizard/anjuta-project-wizard-plugin-48.png
-                TARGET (19:5:9:3): wizard_plugin
-                    SOURCE (19:5:9:3:0): plugins/project-wizard/$(plugin_in_files:.plugin.in=.plugin)
-                TARGET (19:5:9:4): libanjuta-project-wizard.la
-                    SOURCE (19:5:9:4:0): plugins/project-wizard/plugin.c
-                    SOURCE (19:5:9:4:1): plugins/project-wizard/plugin.h
-                    SOURCE (19:5:9:4:2): plugins/project-wizard/druid.c
-                    SOURCE (19:5:9:4:3): plugins/project-wizard/druid.h
-                    SOURCE (19:5:9:4:4): plugins/project-wizard/header.c
-                    SOURCE (19:5:9:4:5): plugins/project-wizard/header.h
-                    SOURCE (19:5:9:4:6): plugins/project-wizard/property.c
-                    SOURCE (19:5:9:4:7): plugins/project-wizard/property.h
-                    SOURCE (19:5:9:4:8): plugins/project-wizard/values.c
-                    SOURCE (19:5:9:4:9): plugins/project-wizard/values.h
-                    SOURCE (19:5:9:4:10): plugins/project-wizard/file.c
-                    SOURCE (19:5:9:4:11): plugins/project-wizard/file.h
-                    SOURCE (19:5:9:4:12): plugins/project-wizard/action.c
-                    SOURCE (19:5:9:4:13): plugins/project-wizard/action.h
-                    SOURCE (19:5:9:4:14): plugins/project-wizard/parser.c
-                    SOURCE (19:5:9:4:15): plugins/project-wizard/parser.h
-                    SOURCE (19:5:9:4:16): plugins/project-wizard/install.c
-                    SOURCE (19:5:9:4:17): plugins/project-wizard/install.h
-                    SOURCE (19:5:9:4:18): plugins/project-wizard/autogen.c
-                    SOURCE (19:5:9:4:19): plugins/project-wizard/autogen.h
+                TARGET (19:5:9:2): wizard_ui
+                    SOURCE (19:5:9:2:0): plugins/project-wizard/  
+                TARGET (19:5:9:3): wizard_pixmaps
+                    SOURCE (19:5:9:3:0): plugins/project-wizard/anjuta-project-wizard-plugin.svg
+                    SOURCE (19:5:9:3:1): plugins/project-wizard/anjuta-project-wizard-plugin-48.png
+                TARGET (19:5:9:4): wizard_plugin
+                    SOURCE (19:5:9:4:0): plugins/project-wizard/$(plugin_in_files:.plugin.in=.plugin)
+                TARGET (19:5:9:5): libanjuta-project-wizard.la
+                    SOURCE (19:5:9:5:0): plugins/project-wizard/plugin.c
+                    SOURCE (19:5:9:5:1): plugins/project-wizard/plugin.h
+                    SOURCE (19:5:9:5:2): plugins/project-wizard/druid.c
+                    SOURCE (19:5:9:5:3): plugins/project-wizard/druid.h
+                    SOURCE (19:5:9:5:4): plugins/project-wizard/header.c
+                    SOURCE (19:5:9:5:5): plugins/project-wizard/header.h
+                    SOURCE (19:5:9:5:6): plugins/project-wizard/property.c
+                    SOURCE (19:5:9:5:7): plugins/project-wizard/property.h
+                    SOURCE (19:5:9:5:8): plugins/project-wizard/values.c
+                    SOURCE (19:5:9:5:9): plugins/project-wizard/values.h
+                    SOURCE (19:5:9:5:10): plugins/project-wizard/file.c
+                    SOURCE (19:5:9:5:11): plugins/project-wizard/file.h
+                    SOURCE (19:5:9:5:12): plugins/project-wizard/action.c
+                    SOURCE (19:5:9:5:13): plugins/project-wizard/action.h
+                    SOURCE (19:5:9:5:14): plugins/project-wizard/parser.c
+                    SOURCE (19:5:9:5:15): plugins/project-wizard/parser.h
+                    SOURCE (19:5:9:5:16): plugins/project-wizard/install.c
+                    SOURCE (19:5:9:5:17): plugins/project-wizard/install.h
+                    SOURCE (19:5:9:5:18): plugins/project-wizard/autogen.c
+                    SOURCE (19:5:9:5:19): plugins/project-wizard/autogen.h
             GROUP (19:5:10): project-manager
                 TARGET (19:5:10:0): project_ui
                     SOURCE (19:5:10:0:0): plugins/project-manager/anjuta-project-manager.xml
@@ -1588,60 +1592,66 @@
                     SOURCE (19:5:28:2:2): plugins/starter/starter.h
                     SOURCE (19:5:28:2:3): plugins/starter/starter.c
             GROUP (19:5:29): am-project
-                TARGET (19:5:29:0): plugin_pixmaps
-                    SOURCE (19:5:29:0:0): plugins/am-project/am-project-plugin-48.png
-                TARGET (19:5:29:1): plugin
-                    SOURCE (19:5:29:1:0): plugins/am-project/$(plugin_in_files:.plugin.in=.plugin)
-                TARGET (19:5:29:2): libam-project.la
-                    SOURCE (19:5:29:2:0): plugins/am-project/plugin.c
-                    SOURCE (19:5:29:2:1): plugins/am-project/plugin.h
-                    SOURCE (19:5:29:2:2): plugins/am-project/am-project.c
-                    SOURCE (19:5:29:2:3): plugins/am-project/am-project.h
-                    SOURCE (19:5:29:2:4): plugins/am-project/am-scanner.l
-                    SOURCE (19:5:29:2:5): plugins/am-project/am-parser.y
-                    SOURCE (19:5:29:2:6): plugins/am-project/am-scanner.h
-                    SOURCE (19:5:29:2:7): plugins/am-project/ac-scanner.l
-                    SOURCE (19:5:29:2:8): plugins/am-project/ac-parser.y
-                    SOURCE (19:5:29:2:9): plugins/am-project/ac-scanner.h
-                    SOURCE (19:5:29:2:10): plugins/am-project/ac-writer.h
-                    SOURCE (19:5:29:2:11): plugins/am-project/ac-writer.c
-                    SOURCE (19:5:29:2:12): plugins/am-project/am-writer.h
-                    SOURCE (19:5:29:2:13): plugins/am-project/am-writer.c
-                    SOURCE (19:5:29:2:14): plugins/am-project/am-project-private.h
-                    SOURCE (19:5:29:2:15): plugins/am-project/am-properties.c
-                    SOURCE (19:5:29:2:16): plugins/am-project/am-properties.h
-                TARGET (19:5:29:3): projectparser
-                    SOURCE (19:5:29:3:0): plugins/am-project/projectparser.c
+                TARGET (19:5:29:0): plugin_ui
+                    SOURCE (19:5:29:0:0): plugins/am-project/ 
+                TARGET (19:5:29:1): plugin_pixmaps
+                    SOURCE (19:5:29:1:0): plugins/am-project/am-project-plugin-48.png
+                TARGET (19:5:29:2): plugin
+                    SOURCE (19:5:29:2:0): plugins/am-project/$(plugin_in_files:.plugin.in=.plugin)
+                TARGET (19:5:29:3): libam-project.la
+                    SOURCE (19:5:29:3:0): plugins/am-project/plugin.c
+                    SOURCE (19:5:29:3:1): plugins/am-project/plugin.h
+                    SOURCE (19:5:29:3:2): plugins/am-project/am-project.c
+                    SOURCE (19:5:29:3:3): plugins/am-project/am-project.h
+                    SOURCE (19:5:29:3:4): plugins/am-project/am-scanner.l
+                    SOURCE (19:5:29:3:5): plugins/am-project/am-parser.y
+                    SOURCE (19:5:29:3:6): plugins/am-project/am-scanner.h
+                    SOURCE (19:5:29:3:7): plugins/am-project/ac-scanner.l
+                    SOURCE (19:5:29:3:8): plugins/am-project/ac-parser.y
+                    SOURCE (19:5:29:3:9): plugins/am-project/ac-scanner.h
+                    SOURCE (19:5:29:3:10): plugins/am-project/ac-writer.h
+                    SOURCE (19:5:29:3:11): plugins/am-project/ac-writer.c
+                    SOURCE (19:5:29:3:12): plugins/am-project/am-writer.h
+                    SOURCE (19:5:29:3:13): plugins/am-project/am-writer.c
+                    SOURCE (19:5:29:3:14): plugins/am-project/am-project-private.h
+                    SOURCE (19:5:29:3:15): plugins/am-project/am-properties.c
+                    SOURCE (19:5:29:3:16): plugins/am-project/am-properties.h
+                TARGET (19:5:29:4): projectparser
+                    SOURCE (19:5:29:4:0): plugins/am-project/projectparser.c
             GROUP (19:5:30): mk-project
-                TARGET (19:5:30:0): plugin_glade
-                    SOURCE (19:5:30:0:0): plugins/mk-project/mk-project.ui
-                TARGET (19:5:30:1): plugin_pixmaps
-                    SOURCE (19:5:30:1:0): plugins/mk-project/mk-project-plugin-48.png
-                TARGET (19:5:30:2): plugin
-                    SOURCE (19:5:30:2:0): plugins/mk-project/$(plugin_in_files:.plugin.in=.plugin)
-                TARGET (19:5:30:3): libmk-project.la
-                    SOURCE (19:5:30:3:0): plugins/mk-project/plugin.c
-                    SOURCE (19:5:30:3:1): plugins/mk-project/plugin.h
-                    SOURCE (19:5:30:3:2): plugins/mk-project/mk-project.c
-                    SOURCE (19:5:30:3:3): plugins/mk-project/mk-project.h
-                    SOURCE (19:5:30:3:4): plugins/mk-project/mk-scanner.l
-                    SOURCE (19:5:30:3:5): plugins/mk-project/mk-parser.y
-                    SOURCE (19:5:30:3:6): plugins/mk-project/mk-scanner.h
-                    SOURCE (19:5:30:3:7): plugins/mk-project/mk-rule.c
-                    SOURCE (19:5:30:3:8): plugins/mk-project/mk-rule.h
-                    SOURCE (19:5:30:3:9): plugins/mk-project/mk-project-private.h
+                TARGET (19:5:30:0): plugin_ui
+                    SOURCE (19:5:30:0:0): plugins/mk-project/ 
+                TARGET (19:5:30:1): plugin_glade
+                    SOURCE (19:5:30:1:0): plugins/mk-project/mk-project.ui
+                TARGET (19:5:30:2): plugin_pixmaps
+                    SOURCE (19:5:30:2:0): plugins/mk-project/mk-project-plugin-48.png
+                TARGET (19:5:30:3): plugin
+                    SOURCE (19:5:30:3:0): plugins/mk-project/$(plugin_in_files:.plugin.in=.plugin)
+                TARGET (19:5:30:4): libmk-project.la
+                    SOURCE (19:5:30:4:0): plugins/mk-project/plugin.c
+                    SOURCE (19:5:30:4:1): plugins/mk-project/plugin.h
+                    SOURCE (19:5:30:4:2): plugins/mk-project/mk-project.c
+                    SOURCE (19:5:30:4:3): plugins/mk-project/mk-project.h
+                    SOURCE (19:5:30:4:4): plugins/mk-project/mk-scanner.l
+                    SOURCE (19:5:30:4:5): plugins/mk-project/mk-parser.y
+                    SOURCE (19:5:30:4:6): plugins/mk-project/mk-scanner.h
+                    SOURCE (19:5:30:4:7): plugins/mk-project/mk-rule.c
+                    SOURCE (19:5:30:4:8): plugins/mk-project/mk-rule.h
+                    SOURCE (19:5:30:4:9): plugins/mk-project/mk-project-private.h
             GROUP (19:5:31): dir-project
-                TARGET (19:5:31:0): plugin_data
-                    SOURCE (19:5:31:0:0): plugins/dir-project/sources.list
-                TARGET (19:5:31:1): plugin_pixmaps
-                    SOURCE (19:5:31:1:0): plugins/dir-project/dir-project-plugin-48.png
-                TARGET (19:5:31:2): plugin
-                    SOURCE (19:5:31:2:0): plugins/dir-project/$(plugin_in_files:.plugin.in=.plugin)
-                TARGET (19:5:31:3): libdir-project.la
-                    SOURCE (19:5:31:3:0): plugins/dir-project/plugin.c
-                    SOURCE (19:5:31:3:1): plugins/dir-project/plugin.h
-                    SOURCE (19:5:31:3:2): plugins/dir-project/dir-project.c
-                    SOURCE (19:5:31:3:3): plugins/dir-project/dir-project.h
+                TARGET (19:5:31:0): plugin_ui
+                    SOURCE (19:5:31:0:0): plugins/dir-project/ 
+                TARGET (19:5:31:1): plugin_data
+                    SOURCE (19:5:31:1:0): plugins/dir-project/sources.list
+                TARGET (19:5:31:2): plugin_pixmaps
+                    SOURCE (19:5:31:2:0): plugins/dir-project/dir-project-plugin-48.png
+                TARGET (19:5:31:3): plugin
+                    SOURCE (19:5:31:3:0): plugins/dir-project/$(plugin_in_files:.plugin.in=.plugin)
+                TARGET (19:5:31:4): libdir-project.la
+                    SOURCE (19:5:31:4:0): plugins/dir-project/plugin.c
+                    SOURCE (19:5:31:4:1): plugins/dir-project/plugin.h
+                    SOURCE (19:5:31:4:2): plugins/dir-project/dir-project.c
+                    SOURCE (19:5:31:4:3): plugins/dir-project/dir-project.h
             GROUP (19:5:32): js-debugger
                 TARGET (19:5:32:0): js_debugger_pixmaps
                     SOURCE (19:5:32:0:0): plugins/js-debugger/js_debugger.png
diff --git a/plugins/am-project/tests/testsuite.at b/plugins/am-project/tests/testsuite.at
index 973bf63..adb7430 100644
--- a/plugins/am-project/tests/testsuite.at
+++ b/plugins/am-project/tests/testsuite.at
@@ -6,3 +6,4 @@ m4_include([source.at])
 m4_include([parser.at])
 m4_include([acinit.at])
 m4_include([include.at])
+m4_include([variable.at])
diff --git a/plugins/am-project/tests/variable.at b/plugins/am-project/tests/variable.at
new file mode 100644
index 0000000..d0429fd
--- /dev/null
+++ b/plugins/am-project/tests/variable.at
@@ -0,0 +1,18 @@
+AT_SETUP([Variable in Makefile.am])
+AS_MKDIR_P([variable])
+AT_DATA([variable/configure.ac],
+[[AC_CONFIG_FILES(Makefile)
+]])
+AT_DATA([variable/Makefile.am],
+[[
+TARGETS = target1
+bin_PROGRAMS = $(TARGETS)
+]])
+AT_DATA([expect],
+[[    GROUP (0): variable
+        TARGET (0:0): target1
+]])
+AT_PARSER_CHECK([load variable \
+		 list])
+AT_CHECK([diff -b output expect])
+AT_CLEANUP
diff --git a/plugins/mk-project/mk-parser.y b/plugins/mk-project/mk-parser.y
index ecf5289..1c087fa 100644
--- a/plugins/mk-project/mk-parser.y
+++ b/plugins/mk-project/mk-parser.y
@@ -244,7 +244,7 @@ command_list:
     }
 	;
 
-	
+
 /* Lists
  *----------------------------------------------------------------------------*/
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]