Skip to content

Commit

Permalink
Fix check which was failing
Browse files Browse the repository at this point in the history
  • Loading branch information
sgranjoux committed Oct 18, 2009
1 parent e4c2e9f commit 68ff9fd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
8 changes: 8 additions & 0 deletions libanjuta/anjuta-token.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,14 @@ AnjutaToken *anjuta_token_group (AnjutaToken *parent, AnjutaToken *last)

}

AnjutaToken *anjuta_token_new_group (AnjutaTokenType type, AnjutaToken* first)
{
AnjutaToken *parent = anjuta_token_new_static (type, NULL);

g_node_insert_before ((GNode *)first->parent, (GNode *)first, (GNode *)parent);
return anjuta_token_group (parent, first);
}

AnjutaToken *anjuta_token_ungroup (AnjutaToken *token)
{
GNode *last = (GNode *)token;
Expand Down
2 changes: 2 additions & 0 deletions libanjuta/anjuta-token.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ AnjutaToken *anjuta_token_delete (AnjutaToken *token);
AnjutaToken *anjuta_token_group (AnjutaToken *parent, AnjutaToken *last);
AnjutaToken *anjuta_token_ungroup (AnjutaToken *parent);

AnjutaToken *anjuta_token_new_group (AnjutaTokenType type, AnjutaToken* first);

AnjutaToken *anjuta_token_split (AnjutaToken *token, guint size);

AnjutaToken * anjuta_token_insert_child (AnjutaToken *parent, AnjutaToken *child);
Expand Down
8 changes: 4 additions & 4 deletions src/ac-parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ raw_string_body:

arg_string:
LEFT_BRACE arg_string_body RIGHT_BRACE {
$$ = anjuta_token_group_new (NAME, $1);
$$ = anjuta_token_new_group (NAME, $1);
anjuta_token_set_type ($1, ANJUTA_TOKEN_OPEN_QUOTE);
anjuta_token_set_type ($3, ANJUTA_TOKEN_CLOSE_QUOTE);
anjuta_token_group ($$, $3);
Expand Down Expand Up @@ -354,7 +354,7 @@ arg:
$$ = NULL;
}
| arg_part arg_body {
$$ = anjuta_token_group_new (ANJUTA_TOKEN_ARGUMENT, $1);
$$ = anjuta_token_new_group (ANJUTA_TOKEN_ARGUMENT, $1);
if ($2 != NULL) anjuta_token_group ($$, $2);
}
;
Expand Down Expand Up @@ -388,10 +388,10 @@ arg_part:

separator:
COMMA {
$$ = anjuta_token_group_new (ANJUTA_TOKEN_NEXT, $1);
$$ = anjuta_token_new_group (ANJUTA_TOKEN_NEXT, $1);
}
| COMMA spaces {
$$ = anjuta_token_group_new (ANJUTA_TOKEN_NEXT, $1);
$$ = anjuta_token_new_group (ANJUTA_TOKEN_NEXT, $1);
anjuta_token_group ($$, $2);
}
;
Expand Down
4 changes: 2 additions & 2 deletions tests/makefile.lst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
VARIABLE: OBJECTS = foobar.o
VARIABLE: LDFLAGS = -Wl,-rpath,/usr/local/lib
VARIABLE: CC = gcc
VARIABLE: LIBS = (null)
VARIABLE: INCFLAGS = (null)
VARIABLE: LIBS =
VARIABLE: INCFLAGS =
GROUP (0): makefile
TARGET (0:0): foobar
SOURCE (0:0:0): foobar.c

0 comments on commit 68ff9fd

Please sign in to comment.