[anjuta] am-project: bgo#652773 - Anjuta (current git) fails to load abiword project



commit 25dbef94537257ae9315835e65d7482c2137b9a4
Author: SÃbastien Granjoux <seb sfo free fr>
Date:   Thu Jun 23 21:50:45 2011 +0200

    am-project: bgo#652773 - Anjuta (current git) fails to load abiword project

 libanjuta/anjuta-token.c        |    8 +++++++-
 plugins/am-project/ac-parser.y  |    7 +++++--
 plugins/am-project/am-project.c |    4 ++--
 3 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/libanjuta/anjuta-token.c b/libanjuta/anjuta-token.c
index 0ee8122..a1243e5 100644
--- a/libanjuta/anjuta-token.c
+++ b/libanjuta/anjuta-token.c
@@ -1058,8 +1058,14 @@ anjuta_token_merge_children (AnjutaToken *first, AnjutaToken *end)
 	anjuta_token_unlink_token (end);
 	if (end->last != NULL)
 	{
+		AnjutaToken *child;
+
 		first->last = end->last;
-		end->last->group = first;
+		for (child = anjuta_token_next (first); child != first->last; child = anjuta_token_next (child))
+		{
+			if (child->group == end) child->group = first;
+		}
+		first->last->group = first;
 	}
 	end->group = first;
 	anjuta_token_free (end);
diff --git a/plugins/am-project/ac-parser.y b/plugins/am-project/ac-parser.y
index 39066c4..5fa9f6a 100644
--- a/plugins/am-project/ac-parser.y
+++ b/plugins/am-project/ac-parser.y
@@ -338,8 +338,11 @@ arg_list:
     | spaces  arg_list_body  RIGHT_PAREN {
         $$ = anjuta_token_new_static (ANJUTA_TOKEN_LAST, NULL);
         anjuta_token_merge ($$, $3);
-        anjuta_token_merge ($1, $$);
-        $$ = $1;
+		anjuta_token_merge ($2, $$);
+		$$ = anjuta_token_new_static (ANJUTA_TOKEN_LIST, NULL);
+        anjuta_token_set_type ($1, ANJUTA_TOKEN_START);
+		anjuta_token_merge ($$, $1);
+		anjuta_token_merge_children ($$, $2);
     }
     ;
 
diff --git a/plugins/am-project/am-project.c b/plugins/am-project/am-project.c
index 9a1d5eb..a035204 100644
--- a/plugins/am-project/am-project.c
+++ b/plugins/am-project/am-project.c
@@ -787,13 +787,13 @@ amp_project_load_config (AmpProject *project, AnjutaToken *arg_list)
 		/* File list */
 		scanner = amp_ac_scanner_new (project);
 		
-		arg = anjuta_token_first_item (arg_list);
+		arg = anjuta_token_first_word (arg_list);
 		list = amp_ac_scanner_parse_token (scanner, arg, AC_SPACE_LIST_STATE, NULL);
 		anjuta_token_free_children (arg);
 		list = anjuta_token_delete_parent (list);
 		anjuta_token_prepend_items (arg, list);
 		amp_ac_scanner_free (scanner);
-		
+
 		for (item = anjuta_token_first_word (arg); item != NULL; item = anjuta_token_next_word (item))
 		{
 			gchar *value;



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