summaryrefslogtreecommitdiff
path: root/giscanner
Commit message (Collapse)AuthorAgeFilesLines
* dumper: Attempt to identify MSVC/'cl' more preciselyColin Walters2013-08-221-3/+3
| | | | | | | | | Checking for 'cl' in the whole compiler string trips up people who do CC='gcc --command-with-cl-in-the-name'. We should (probably) only look at the first argument, although this will break for people doing CC='ccache cl', but would someone do that? See: https://bugzilla.gnome.org/show_bug.cgi?id=698090
* scanner: Consistently use realpath() on input filenamesColin Walters2013-07-281-1/+1
| | | | | | | | | | | | | | | | The scanner has some logic to compare the filenames specified on the command line against files it will parse. For the latter, it uses g_realpath(). With this patch, we also use g_realpath() on the command line arguments. This fixes g-i when used inside jhbuild in a gnome-ostree VM, which has a symbolic link /home -> /sysroot/home. This caused a realpath mismatch, and then we'd ignore the input source files. It'd be best to get out of the realpath business entirely...but a patch to do that seems more likely to break. https://bugzilla.gnome.org/show_bug.cgi?id=704864
* giscanner: Fix PEP-8 issueRico Tzschichholz2013-06-191-0/+2
|
* giscanner: Add a simple automatic sections file generatorJasper St. Pierre2013-06-162-2/+72
| | | | | | | | | This is a very basic sections file generator, and isn't too smart. It's simply intended to be a base to build docs on, and will be used if the user doesn't provide a sections file when calling g-ir-doc-tool, for convenience purposes. https://bugzilla.gnome.org/show_bug.cgi?id=699856
* scanner: Only warn about signal parameters if there are someColin Walters2013-05-071-1/+3
| | | | We don't want to emit a warning if there are actually no parameters.
* tests: Update misc/pep8.py to 1.4.5Dieter Verfaillie2013-05-0722-240/+296
| | | | | | | | | | | | | | | | | Version in our tree is a wee bit outdated. For example, later work will introduce an utf8 encoded python source file which our old pep8.py does not yet understand (yeah, it really was *that* ancient)... Updated from: https://raw.github.com/jcrocholl/pep8/1.4.5/pep8.py Takes 552c1f1525e37a30376790151c1ba437776682c5, f941537d1c0a40f0906490ed160db6c79af572d3, 5a4afe2a77d0ff7d9fea13dd93c3304a6ca993de and a17f157e19bd6792c00321c8020dca5e5a281f45 into account... https://bugzilla.gnome.org/show_bug.cgi?id=699535
* giscanner: emit 'incorrect number of parameters in comment block' warningDieter Verfaillie2013-05-071-12/+18
| | | | | | | instead of silently ignoring parameter names on signals when the number of parameters doesn't match our expectations. https://bugzilla.gnome.org/show_bug.cgi?id=697623
* sectionparser: Ignore other directives to gtk-docJasper St. Pierre2013-05-071-0/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=699856
* sectionparser: Remove the main subsectionJasper St. Pierre2013-05-071-2/+2
| | | | | | This isn't how subsections work https://bugzilla.gnome.org/show_bug.cgi?id=699856
* sectionparser: Add support for <INCLUDE>Jasper St. Pierre2013-05-071-0/+6
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=699856
* sectionparser: RenameJasper St. Pierre2013-05-071-2/+2
| | | | | | It's called a sections file, not a section file. https://bugzilla.gnome.org/show_bug.cgi?id=699856
* sectionparser: Allow subsections with no nameJasper St. Pierre2013-05-071-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=699856
* sectionparser: Fix subsection regexJasper St. Pierre2013-05-071-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=699856
* sectionparser: Fix regex matchingJasper St. Pierre2013-05-071-3/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=699856
* sectionparser: Construct Subsections, not SectionsJasper St. Pierre2013-05-071-1/+1
| | | | | | Whoops! https://bugzilla.gnome.org/show_bug.cgi?id=699856
* transformer: Remove annotationsJasper St. Pierre2013-05-072-5/+0
| | | | | | | The transformer doesn't need the annotations, so why are we giving it to it? https://bugzilla.gnome.org/show_bug.cgi?id=699854
* annotationparser: Remove get_tag/get_paramJasper St. Pierre2013-05-073-24/+18
| | | | | | They're useless if we can just access the dict directly. https://bugzilla.gnome.org/show_bug.cgi?id=688897
* giscanner: move odict.OrderedDict into a collections packageDieter Verfaillie2013-05-074-2/+27
| | | | | | because we'll add more related code to collections later on https://bugzilla.gnome.org/show_bug.cgi?id=699536
* giscanner: remove unneeded encode('utf-8').decode('utf-8') roundtripDieter Verfaillie2013-05-071-1/+1
| | | | | | | | | line is a unicode() instance, xml.sax.saxutils.escape() does nothing more than call a couple of replace() methods on said unicode() instance so it makes little sense to encode line into a str() and decode the escaped result back into a unicode(). https://bugzilla.gnome.org/show_bug.cgi?id=699533
* giscanner: simplify the MainTransformer().transform() methodDieter Verfaillie2013-05-071-6/+4
| | | | | | | | | | The ast.Namespace.names instance attribute is an OrderedDict which itself is a specialised dict() subclass. There are any number of ways to test if a dict() is empty or not. Creating a copy of it's keys by iterating over them just to count the number of items in the copy is not the most elegant way though. https://bugzilla.gnome.org/show_bug.cgi?id=699533
* giscanner: small cpp_args cleanupDieter Verfaillie2013-05-071-11/+9
| | | | | | No need for two variables... https://bugzilla.gnome.org/show_bug.cgi?id=699533
* giscanner: Define source and header filename extensions only onceDieter Verfaillie2013-05-072-7/+7
| | | | | | | Enables us to to use a more effecient list membership test instead of testing the end of some string multiple times. https://bugzilla.gnome.org/show_bug.cgi?id=699533
* giscanner: make _pass_read_annotations2() more readableDieter Verfaillie2013-05-071-26/+22
| | | | | | | | | | | _apply_annotations2_function() is only ever called by _pass_read_annotations2() so there's no need to go and hide what's being done behind an extra method call. Also change the 'if not something; return' into a more readable 'if something: do something'... https://bugzilla.gnome.org/show_bug.cgi?id=697622
* scanner: Parse __int128 and friends as "int"Colin Walters2013-05-071-0/+4
| | | | | | | | | This is a hack, but all we really want to do is ignore them for now. See https://mail.gnome.org/archives/gtk-devel-list/2013-May/msg00013.html https://bugzilla.gnome.org/show_bug.cgi?id=699722
* giscanner: Fix for PEP-8 style checkRico Tzschichholz2013-05-031-1/+2
|
* Fix scanning libraries with no GObjects and linker using --as-neededRobert Ancell2013-05-021-0/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=699442
* Do not misdetect clang as the Microsoft C compilerEmmanuele Bassi2013-05-011-2/+3
| | | | | | Just because they both start with 'cl'. https://bugzilla.gnome.org/show_bug.cgi?id=698090
* giscanner/scannerlexer.l: Parse and ignore more __asm and __volatilePatrick Welche2013-04-201-0/+4
| | | | | | | | | | | | | | In the spirit of c9708af2 also parse and ignore __asm [whitespace] volatile __asm__ [whitespace] volatile __volatile __volatile__ Ignoring __volatile is cosmetic, but the __asm cases avoid an unwanted VOLATILE token. Extension of https://bugzilla.gnome.org/show_bug.cgi?id=678794
* giscanner: only parse GTK-Doc comment blocks, ignore the restDieter Verfaillie2013-04-091-3/+25
| | | | | | | | | | For example, GTK+ has over 15.000 comment blocks (/* ... */) of which only about 5.000 are GTK-Doc comment blocks (/** ... */). No need to store and parse those +-10.000 comment blocks just to find out we don't care about them anyway. https://bugzilla.gnome.org/show_bug.cgi?id=697625
* giscanner: use mkstemp() instead of mktemp()Dieter Verfaillie2013-04-091-3/+3
| | | | | | mktemp was deprecated in Python 2.3... https://bugzilla.gnome.org/show_bug.cgi?id=697624
* giscanner: make _pass_fixup_hidden_fields() more readableDieter Verfaillie2013-04-091-8/+5
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=697621
* giscanner: fix broken xml:whitespace attributes in .gir filesDieter Verfaillie2013-04-091-1/+1
| | | | | | | The XML specification clearly states it's xml:space http://www.w3.org/TR/xml/#sec-white-space https://bugzilla.gnome.org/show_bug.cgi?id=628739
* giscanner: use SqlAlchemy's OrderedDict implementationDieter Verfaillie2013-04-093-28/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | g-ir-scanner can be a bit on the slow side. While true we now do a bit more work parsing GTK-Doc comment blocks and more is still to come, one of the biggest hotspots besides what's going on in _giscanner.SourceScanner() comes from the OrderedDict implementations we have been using. For example, time needed to build Gtk-3.0.gir on a relatively slow machine using "python2 -m cProfile -o $prefix/bin/g-ir-scanner ...": 1) Our original DictMixin sublass: 92,79867 seconds 2) Python's collections.OrderedDict class: 88,65786 seconds 3) Larosa/Foord implementation from http://www.voidspace.org.uk/python/odict.html : 71,64323 seconds 4) SqlAlchemy's implementation: 66,12449 seconds Looks like we have a clear winner with the SqlAclchemy implementation, which comes in at around 20 seconds without profiling on the same machine. Not bad. https://bugzilla.gnome.org/show_bug.cgi?id=697620
* giscanner: don't shadow built-in 'type' symbolDieter Verfaillie2013-04-091-1/+1
| | | | | | use the documented __exit__ signature instead https://bugzilla.gnome.org/show_bug.cgi?id=697619
* giscanner: prefer "except X as e" over "except X, e"Dieter Verfaillie2013-04-095-34/+34
| | | | | | It's more readable and as an added bonus Python 3 compatible. https://bugzilla.gnome.org/show_bug.cgi?id=697616
* giscanner: remove unused variables and importsDieter Verfaillie2013-04-093-7/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=697615
* giscanner: fix string formatting tuplesDieter Verfaillie2013-04-091-10/+10
| | | | | | | | | | | | | | | | | | | | During review Colin Walters mentioned: """ One thing I should probably explain is my habit of *always* passing a tuple for %. The reason is pretty simple...a long time ago I had an error handler that did: print "unexpected data: %s" % foo. And I'd changed the type of "foo" from a string to a tuple at some point. But this obviously caused "print" to fail because it was expecting multiple format strings. Basically always using tuples is safer in case you change the type of a variable to a tuple. """ This fixes violations of this rule introduced up until now. https://bugzilla.gnome.org/show_bug.cgi?id=697614
* scannermodule: Fix a bad checkJasper St. Pierre2013-04-071-1/+1
| | | | Spotted by Coverity
* Unbreak giscanner on OpenBSD.Jasper Lievisse Adriaanse2013-03-281-1/+1
| | | | | | | Commit 9a1e0c63c13f3567e75553d2d07dd914d5b81287 broke this as os.name doesn't return 'OpenBSD', but 'posix' https://bugzilla.gnome.org/show_bug.cgi?id=696765
* scanner: Allow CFLAGS to contain arbitrary preprocessor commands like -includeColin Walters2013-03-062-2/+19
| | | | | | | | | Newer spidermonkey .pc file contains a -include argument, which g-ir-scanner doesn't understand. Rather than us attempting to replicate all of cpp's options, use wrapper arguments in Makefile.introspection to pass them through. https://bugzilla.gnome.org/show_bug.cgi?id=695182
* Revert "gi-r-scanner: add support for raw CFLAGS flags option"Colin Walters2013-03-052-8/+2
| | | | | | Doesn't work with arguments that have shell quotes. This reverts commit 95b03cf87efbd4fea4b7d55601c9752cefd29bfc.
* gi-r-scanner: add support for raw CFLAGS flags optionTim Lunn2013-03-062-2/+8
| | | | | | | | gi-r-scanner chokes when gir_CFLAGS have an '-include <header>' since this is not a recognised option. This commit adds a new --cflags option that passes cflags directly to the spawned gcc. https://bugzilla.gnome.org/show_bug.cgi?id=695182
* scanner: Don't re-parse includes we already foundColin Walters2013-02-271-2/+3
| | | | | | | This fixes the Pango build where it has a chain of two --include-uninstalled. https://bugzilla.gnome.org/show_bug.cgi?id=694593
* scanner: internals cleanup: Move pkgconfig list to NamespaceColin Walters2013-02-265-17/+10
| | | | Continuation of previous work.
* scanner: internals cleanup: Move c_includes to NamespaceColin Walters2013-02-264-14/+9
| | | | Continuation of previous work.
* scanner: internals cleanup: Move shared libraries to NamespaceColin Walters2013-02-264-15/+11
| | | | Continuing on with previous commit.
* scanner: internals cleanup: Key more things off NamespaceColin Walters2013-02-265-30/+22
| | | | | | | | | | | The .gir format has a weird legacy where stuff like the includes are outside of the <namespace>. But conceptually they're tied together, so let's start reflecting this in the code. This way we can just pass around and look at a Namespace object instead of a 4-tuple of (namespace, includes, c_includes, pkg_config). https://bugzilla.gnome.org/show_bug.cgi?id=694593
* doctool: Use builtin namespace walkerColin Walters2013-02-261-22/+31
| | | | | | Rather than hand-rolling our own. This ensures we traverse all nodes. https://bugzilla.gnome.org/show_bug.cgi?id=694593
* scanner: Also traverse GObject properties when walking namespaceColin Walters2013-02-261-0/+2
| | | | | | | This could be done manually by the caller, but it's better if we're consistent here, since we do traverse fields. https://bugzilla.gnome.org/show_bug.cgi?id=694593
* doctool: Switch default language to CColin Walters2013-02-261-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=694593