summaryrefslogtreecommitdiff
path: root/giscanner/sourcescanner.c
diff options
context:
space:
mode:
authorJohan Dahlin <jdahlin@async.com.br>2009-01-12 20:11:44 +0000
committerJohan Dahlin <johan@src.gnome.org>2009-01-12 20:11:44 +0000
commit7dbbda9abea9882d2c98726f382a905fa8738706 (patch)
treebdf438fc921de19ddee90d7f2c5972cf76fec48f /giscanner/sourcescanner.c
parentba4ee2e606545ac703941698aa25e6d865e6976f (diff)
downloadgobject-introspection-7dbbda9abea9882d2c98726f382a905fa8738706.tar.gz
Bug 563794 - Redo annotation parsing & applying
2009-01-12 Johan Dahlin <jdahlin@async.com.br> Bug 563794 - Redo annotation parsing & applying Thanks to Colin for helping out considerably in landing this. * giscanner/Makefile.am: * giscanner/ast.py: * giscanner/dumper.py: * giscanner/girparser.py: * giscanner/giscannermodule.c (pygi_source_scanner_get_comments), (calc_attrs_length), (pygi_collect_attributes), (init_giscanner): * giscanner/glibtransformer.py: * giscanner/scannerlexer.l: * giscanner/sourcescanner.c (gi_source_symbol_unref), (gi_source_scanner_new), (gi_source_scanner_free), (gi_source_scanner_get_comments): * giscanner/sourcescanner.h: * giscanner/sourcescanner.py: * giscanner/transformer.py: * giscanner/xmlwriter.py: * tests/scanner/annotation-1.0-expected.gir: * tests/scanner/annotation-1.0-expected.tgir: * tests/scanner/annotation.c: * tests/scanner/annotation.h: * tests/scanner/foo-1.0-expected.gir: * tests/scanner/foo-1.0-expected.tgir: * tests/scanner/foo.h: * tools/g-ir-scanner: This commit merges the annotation parser rewrite branch. It'll change the annotation parsing to be done completely in python code which will make it easier to do further annotation parsing easier. svn path=/trunk/; revision=1017
Diffstat (limited to 'giscanner/sourcescanner.c')
-rw-r--r--giscanner/sourcescanner.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/giscanner/sourcescanner.c b/giscanner/sourcescanner.c
index 08f4b586..cf412362 100644
--- a/giscanner/sourcescanner.c
+++ b/giscanner/sourcescanner.c
@@ -60,8 +60,6 @@ gi_source_symbol_unref (GISourceSymbol * symbol)
if (symbol->base_type)
ctype_free (symbol->base_type);
g_free (symbol->const_string);
- g_slist_foreach (symbol->directives, (GFunc)gi_source_directive_free, NULL);
- g_slist_free (symbol->directives);
g_slice_free (GISourceSymbol, symbol);
}
}
@@ -178,28 +176,6 @@ gi_source_function_new (void)
return func;
}
-GISourceDirective *
-gi_source_directive_new (const gchar *name,
- const gchar *value,
- GSList *options)
-{
- GISourceDirective *directive;
-
- directive = g_slice_new (GISourceDirective);
- directive->name = g_strdup (name);
- directive->value = g_strdup (value);
- directive->options = options;
- return directive;
-}
-
-void
-gi_source_directive_free (GISourceDirective *directive)
-{
- g_free (directive->name);
- g_free (directive->value);
- g_slice_free (GISourceDirective, directive);
-}
-
GISourceScanner *
gi_source_scanner_new (void)
{
@@ -208,7 +184,6 @@ gi_source_scanner_new (void)
scanner = g_slice_new0 (GISourceScanner);
scanner->typedef_table = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL);
- scanner->directives_map = g_hash_table_new (g_str_hash, g_str_equal);
scanner->struct_or_union_or_enum_table =
g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, (GDestroyNotify)gi_source_symbol_unref);
@@ -221,10 +196,11 @@ gi_source_scanner_free (GISourceScanner *scanner)
{
g_free (scanner->current_filename);
- g_hash_table_destroy (scanner->directives_map);
g_hash_table_destroy (scanner->typedef_table);
g_hash_table_destroy (scanner->struct_or_union_or_enum_table);
+ g_slist_foreach (scanner->comments, (GFunc)g_free, NULL);
+ g_slist_free (scanner->comments);
g_slist_foreach (scanner->symbols, (GFunc)gi_source_symbol_unref, NULL);
g_slist_free (scanner->symbols);
@@ -295,8 +271,7 @@ gi_source_scanner_get_symbols (GISourceScanner *scanner)
}
GSList *
-gi_source_scanner_get_directives(GISourceScanner *scanner,
- const gchar *name)
+gi_source_scanner_get_comments(GISourceScanner *scanner)
{
- return g_hash_table_lookup (scanner->directives_map, name);
+ return g_slist_reverse (scanner->comments);
}