merge with lr1 branch
authorThadeu Lima de Souza Cascardo <cascardo@dcc.ufmg.br>
Sun, 23 Oct 2005 22:28:36 +0000 (22:28 +0000)
committerThadeu Lima de Souza Cascardo <cascardo@dcc.ufmg.br>
Sun, 23 Oct 2005 22:28:36 +0000 (22:28 +0000)
Patches applied:

 * cascardo@tlscascardo--private/libgrammatic--lr1--0.1--patch-4
   Item collection building returns the collection

git-archimport-id: cascardo@tlscascardo--private/libgrammatic--nogobject-lr1--0.1--patch-3

1  2 
item.c

diff --cc item.c
--- 1/item.c
--- 2/item.c
+++ b/item.c
@@@ -407,20 -432,18 +407,21 @@@ GHashTable* item_collection_goto (GHash
        return NULL;
      }
    goto_item_set = item_set_goto (item_set, grammar, first, symbol);
 -  if (!item_collection_add (collection, goto_item_set))
 -    return_item_set = NULL;
 +  if (!item_collection_add (collection, goto_item_set, &old_item_set))
 +    {
 +      g_hash_table_insert (symbols, symbol, old_item_set);
 +      g_hash_table_destroy (goto_item_set);
 +      return NULL;
 +    }
    else
 -    return_item_set = goto_item_set;
 -  goto_state = item_collection_lookup (collection, goto_item_set);
 -  g_hash_table_insert (state->symbols, symbol,
 -                     GINT_TO_POINTER (goto_state->code));
 -  return return_item_set;
 +    {
 +      g_hash_table_insert (symbols, symbol, goto_item_set);
 +      return goto_item_set;
 +    }
  }
  
- void item_set_collection (grammar_t* grammar, GHashTable* first, symbol_t* start)
 -GHashTable* item_set_collection (Grammar* grammar, GHashTable* first,
++GHashTable* item_set_collection (grammar_t* grammar, GHashTable* first,
+                                symbol_t* start)
  {
    GHashTable* collection;
    GHashTable* item_set;