| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Reduce total number of memory allocations and increase data locality.
|
|
|
|
|
|
|
|
|
|
|
| |
It just printed errors to stderr and always returns success even if parsing
fails. This prevents us to write any tests for it.
As a first step collect all lexing/parsing error messages and print them to stderr after
the scanner is done. This allows us to add some regression tests for !78.
In the future we probably want to raise an exception with those errors if parsing
fails.
|
|
|
|
|
|
|
|
| |
Where it's easy add dummy args to match the cast; where the target is a subset just
prevent the warning with a cast to void*.
Provide a real copy function for the boxed type code in regress_foo.
This code is never executed afaics, but why not.
|
|
|
|
|
|
|
|
| |
Macro constants may now refer to constants defined in source files.
Test case provided by Philip Chimento.
Fixes issues #173 and #75.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use g_slist_copy prior to returning the lists run through g_slist_reverse.
This preserves the source scanners internally held lists where previously
they would only point to a single element after a call, leaking memory and
breaking subsequent calls. Note the functions as (transfer container) and
use g_slist_free after calls in the Python bindings.
Add new unittest file: test_sourcescanner.py for isolated unittesting of the
SourceScanner.
https://bugzilla.gnome.org/show_bug.cgi?id=581525
|
|
|
|
|
|
|
|
| |
Aliasing TRUE or FALSE is not very common, but done occasionally
for extra clarity. Namely G_SOURCE_REMOVE / G_SOURCE_CONTINUE are
self-explanatory, unlike the "raw" booleans.
https://bugzilla.gnome.org/show_bug.cgi?id=719566
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=710560
|
|
|
|
|
|
|
|
|
| |
When scanning for macros respect ifdefs of __GI_SCANNER__
in the various header files. Only #ifdef and #ifndef are supported.
If __GI_SCANNER__ appears in plain #if statements, a warning is
printed.
https://bugzilla.gnome.org/show_bug.cgi?id=698367
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Was looking around a bit and noticed about 2/3 of
g-ir-scanner time is spent in SourceScanner().parse_files().
Some profiling quickly shows most of that 2/3 is used
by gi_source_scanner_add_symbol() where it creates a whole
bunch of GFile instances just to compare paths and throw
them away again. With this a scanner instance now maintains
a hash table of GFile instances instead of a list of file
names, so comparing those paths can be reduced to a fast
g_hash_table_contains() call.
This makes "g-ir-scanner <whole_bunch_of_options> --output Gtk-3.0.gir"
complete in about 10 seconds on my box instead of about
30 seconds (both best of 3 runs).
https://bugzilla.gnome.org/show_bug.cgi?id=710320
|
|
|
|
|
|
|
| |
This reverts commit 77fcc8fa47d63f58b2c3f6216a0493e42f6d44b3.
Will be not needed in about 2 patches...
https://bugzilla.gnome.org/show_bug.cgi?id=710320
|
|
|
|
|
|
|
|
|
| |
This reverts commit 8c0ca4717d834a6c578579656683c55ea22a06f4.
The "fast" path doesn't seem to work at all. Testing shows creating
Gtk-3.0.gir still takes about 30 seconds with this (even on
a Linux box)...
https://bugzilla.gnome.org/show_bug.cgi?id=710320
|
|
|
|
|
|
| |
Going through the VFS layer is substantially slower, so check against
the base filenames first. This speeds things up on case-sensitive
filesystems.
|
|
|
|
| |
We already know the condition will be TRUE.
|
| |
|
|
|
|
| |
This fixes complex constants.
|
| |
|
|
|
|
|
|
|
| |
We need to copy the source symbols, otherwise we'll
overwrite their values. This isn't good.
https://bugzilla.gnome.org/show_bug.cgi?id=693939
|
|
|
|
|
|
| |
Makes it work on case-sensitive file systems such as HFS+.
https://bugzilla.gnome.org/show_bug.cgi?id=667405
|
|
|
|
|
|
|
|
|
|
|
| |
* Due to the way that flex/bison works, the symbols were being added
to the scanner after additional lines are parsed.
* If these lines are #line directives, then scanner->current_filename
can change between when the symbol is parsed and when it's added.
* Change so that symbol gets filename when parsing rather than when
being added to the scanner.
https://bugzilla.gnome.org/show_bug.cgi?id=650200
|
| |
|
|
|
|
|
| |
Add line numbers to symbols, which can be useful
in later stages of the scanner.
|
|
|
|
|
| |
We keep track of the source filename for every symbol. This enables
us to later filter symbols based on that name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2009-01-12 Johan Dahlin <jdahlin@async.com.br>
Bug 563591 – Flags not recognized when there is no introspection data
* giscanner/ast.py:
* giscanner/girwriter.py:
* giscanner/giscannermodule.c (type_get_is_bitfield):
* giscanner/glibast.py:
* giscanner/glibtransformer.py:
* giscanner/scannerparser.y:
* giscanner/sourcescanner.c (gi_source_type_copy):
* giscanner/sourcescanner.h:
* giscanner/sourcescanner.py:
* giscanner/transformer.py:
* tests/scanner/foo-1.0-expected.gir:
* tests/scanner/foo-1.0-expected.tgir:
* tests/scanner/foo.h:
Large parts of this patch was done by Jürg Billeter.
svn path=/trunk/; revision=1025
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2008-11-04 Johan Dahlin <jdahlin@async.com.br>
* giscanner/__init__.py:
* giscanner/ast.py:
* giscanner/cachestore.py:
* giscanner/cgobject.py:
* giscanner/girparser.py:
* giscanner/girwriter.py:
* giscanner/giscannermodule.c:
* giscanner/glibast.py:
* giscanner/glibtransformer.py:
* giscanner/libtoolimporter.py:
* giscanner/minixpath.py:
* giscanner/odict.py:
* giscanner/sourcescanner.c:
* giscanner/sourcescanner.h:
* giscanner/sourcescanner.py:
* giscanner/transformer.py:
* giscanner/utils.py:
* giscanner/xmlwriter.py:
* COPYING:
Relicense the giscanner library under LGPLv2+.
This has been approved by all contributors.
svn path=/trunk/; revision=862
|
|
|
|
| |
svn path=/trunk/; revision=814
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2008-10-16 Tommi Komulainen <tommi.komulainen@iki.fi>
Bug 556543 – reduce compiler warnings
* girepository/ginfo.c:
* girepository/girepository.c (register_internal,
count_interfaces, find_interface, find_namespace_version,
parse_version, g_irepository_require):
* girepository/girmodule.c (g_ir_module_build_typelib):
* girepository/girnode.c (init_stats, dump_stats,
_g_irnode_init_stats, _g_irnode_dump_stats,
g_ir_node_can_have_member):
* girepository/girparser.c (firstpass_end_element_handler,
locate_gir, parse_basic, parse_type_internal, resolve_aliases,
start_alias, start_type, end_type_top, parse_include, cleanup,
post_filter):
* girepository/gtypelib.c (validate_function_blob, validate_enum_blob):
* giscanner/giscannermodule.c (directive_get_options,
type_get_child_list):
* giscanner/scannerlexer.l (parse_gtkdoc):
* giscanner/scannerparser.y (ctype_free):
* giscanner/sourcescanner.c:
* giscanner/sourcescanner.h (gi_source_scanner_parse_macros):
* tests/types/gitesttypes.c:
* tools/compiler.c (main):
* tools/generate.c (write_repository): Remove unused variables
and code, add missing includes, declarations and case
statements.
svn path=/trunk/; revision=730
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2008-08-08 Johan Dahlin <johan@gnome.org>
* girepository/gtypelib.c (validate_header):
* girepository/gtypelib.h:
* giscanner/ast.py:
* giscanner/girwriter.py:
* giscanner/sourcescanner.c (gi_source_symbol_ref),
(gi_source_symbol_unref):
* tests/array.test:
* tests/boxed.test:
* tests/constant.test:
* tests/enum.test:
* tests/errors.test:
* tests/function.test:
* tests/gobject.test:
* tests/interface.test:
* tests/invoke/Makefile.am:
* tests/invoke/testfns.xml:
* tests/object.test:
* tests/parser/Makefile.am:
* tests/roundtrips.sh:
* tests/struct.test:
* tests/types.test:
* tests/union.test:
* tests/xref1.test:
* tests/xref2.test:
* tools/Makefile.am:
* tools/compiler.c (main):
* tools/generate.c (write_callable_info), (write_function_info),
(write_repository):
* tools/gidlmodule.c:
* tools/gidlmodule.h:
* tools/gidlnode.c:
* tools/gidlnode.h:
* tools/gidlparser.c:
* tools/gidlparser.h:
* tools/gidlwriter.c:
* tools/gidlwriter.h:
* tools/scanner.c (create_node_from_gtype),
(create_node_from_ctype), (g_igenerator_process_properties),
(g_igenerator_process_signals), (g_igenerator_create_object),
(g_igenerator_create_interface), (g_igenerator_create_boxed),
(g_igenerator_create_enum), (g_igenerator_create_flags),
(g_igenerator_process_function_symbol),
(g_igenerator_process_unregistered_struct_typedef),
(g_igenerator_process_struct_typedef),
(g_igenerator_process_union_typedef),
(g_igenerator_process_enum_typedef),
(g_igenerator_process_function_typedef),
(g_igenerator_process_constant), (g_igenerator_process_symbols),
(g_igenerator_add_module), (g_igenerator_add_include_idl):
Merge in the gir-compiler branch.
Thanks to Philip and Colin for their help.
svn path=/trunk/; revision=325
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2008-04-24 Johan Dahlin <jdahlin@async.com.br>
* giscanner/gidlwriter.py:
* giscanner/girwriter.py:
* giscanner/giscannermodule.c (directive_get_name),
(directive_get_value), (directive_get_options),
(symbol_get_directives), (symbol_set_directives),
(pygi_source_scanner_parse_file),
(pygi_source_scanner_lex_filename),
(pygi_source_scanner_get_directives), (init_giscanner):
* giscanner/sourcescanner.c (gi_source_scanner_get_directives):
* giscanner/sourcescanner.h:
* giscanner/sourcescanner.py:
* giscanner/treebuilder.py:
* tools/g-ir-scanner:
Add support for source/header annotations.
svn path=/trunk/; revision=224
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2008-03-27 Johan Dahlin <johan@gnome.org>
* giscanner/giscannermodule.c:
* giscanner/scannerlexer.l:
* giscanner/sourcescanner.c:
* tools/g-ir-scanner:
Add simple pre-processor using subprocess and a PIPE.
Change the parse_file apis to accept a file descriptor.
svn path=/trunk/; revision=169
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2008-03-25 Johan Dahlin <johan@gnome.org>
* giscanner/__init__.py:
* giscanner/giscannermodule.c:
* giscanner/sourcescanner.c:
* giscanner/sourcescanner.h:
Add constants and wrap a few more SymbolType fields
svn path=/trunk/; revision=166
|
|
2008-03-25 Johan Dahlin <johan@gnome.org>
* Makefile.am:
* configure.ac:
* giscanner/Makefile.am:
* giscanner/sourcescanner.c:
* giscanner/sourcescanner.h:
* tools/Makefile.am:
* tools/grealpath.h:
* tools/sourcescanner.c:
* tools/sourcescanner.h:
Move the scanner to a separate library.
svn path=/trunk/; revision=164
|