summaryrefslogtreecommitdiff
path: root/giscanner
Commit message (Collapse)AuthorAgeFilesLines
...
* giscanner: store indentation before the '*' of each lineDieter Verfaillie2013-10-083-14/+326
|
* giscanner: fix description field storage in .gir filesDieter Verfaillie2013-10-084-11/+48
| | | | | | | | | | | | | | | | | | GTK-Doc description fields for tags can contain multiple lines and even multiple paragraphs. Whitespace cannot be preserved in XML attributes, so we move the "deprecated" description text into a "<doc-deprecated />" element right next to where we already have the "<doc />" element. Keep the "deprecated" attribute around for backwards compatibility though, but set its value to "1" (analogous to the "writable", "contruct", etc attributes) if the annotated symbol is marked as deprecated. While at it, add <doc-version /> and <doc-stability /> which was not yet available in the .gir files... This takes care of the "Since:", "Stability:" and "Deprecated:" GTK-Doc tags. Nothing needs to be done for the "Returns:" tag as as we already write a "<doc />" child element on "<return-value />".
* giscanner: store code before and after comment blockDieter Verfaillie2013-10-081-32/+76
| | | | | | so we can later use them to re-write source files containing broken GTK-Doc comment blocks where /** is preceded by and/or */ is followed by code...
* giscanner: accept different forms of line breaksDieter Verfaillie2013-10-081-4/+4
|
* giscanner: merge _parse_comment_block() into parse_comment_block()Dieter Verfaillie2013-10-081-26/+0
|
* giscanner: refactor annotation validationDieter Verfaillie2013-10-082-270/+392
| | | | | | | | - annotations on the identifier (formerly g-i specific tags) have never been validated before, so fix this - removes duplicate validation code from GtkDocTag and GtkDocParameter - remove repeated validation code doing the same thing as annotationparser from maintransformer...
* giscanner: give parameters their own storage classDieter Verfaillie2013-10-081-40/+221
|
* giscanner: deprecate GObject-Introspection GTK-Doc tagsDieter Verfaillie2013-10-082-69/+85
| | | | | | | | | | | | | | | | | | | | | After discussing a different issue with the GTK-Doc maintainers, we learned that our g-i specific top level tags should never have existed in the first place. The prefered notation for annotations that apply to the identifier should be written on the identifier line, for example like what we already do with (skip). As a result, this patch deprecates g-i specific top level tags and implements them as annotations on the identifier instead but still keeps support for malformed comment blocks using g-i specific top level tags. This means that all annotated code "out there" will continue to work just fine with this version of g-i, but when a developer decides to fix deprecation warnings in his/her comment blocks, the dependency on g-i needs to be raised to a version that contains at least this patch. #676133 https://bugzilla.gnome.org/show_bug.cgi?id=676133
* giscanner: flesh out annotation parsing and storageDieter Verfaillie2013-10-082-426/+669
| | | | | | | | | | - remove annotations regex, restore proper parens parsing - drop weird DocOption() storage class and use lists/dicts as appropriate - make GtkDocAnnotations a simple OrderedDict subclass instead of a weird hybrid dict/list storage class - Deprecate Attribute: tag, replace with (attributes) annotation on the identifier
* giscanner: extract tag valuesDieter Verfaillie2013-10-082-27/+62
|
* giscanner: use Position and warn directlyDieter Verfaillie2013-10-081-75/+75
|
* giscanner: remove unused GtkDocCommentBlock.valueDieter Verfaillie2013-10-081-2/+1
|
* giscanner: remove unused backrefsDieter Verfaillie2013-10-081-10/+8
|
* giscanner: bring some order into our constantsDieter Verfaillie2013-10-081-47/+60
| | | | | Write them in alphabetical order and explain what they are used for a bit more clearly.
* giscanner: fix GTK-Doc section parsingDieter Verfaillie2013-10-081-6/+4
|
* giscanner: fix GTK-Doc identifier parsingDieter Verfaillie2013-10-081-51/+33
| | | | | | No need to track what type of identifier we've found as we don't use that information later on. Continue searching for an identifier if it's not found on the first line like gtkdoc-mkdb does.
* giscanner: rename DocAnnotations to GtkDocAnnotationsDieter Verfaillie2013-10-081-44/+44
| | | | and move it below DocOption for easier reading
* giscanner: rename DocTag to GtkDocTagDieter Verfaillie2013-10-081-85/+85
| | | | | and move it downwards after DocOption and DocAnnotations for easier reading
* giscanner: rename DocBlock to GtkDocCommentBlockDieter Verfaillie2013-10-081-64/+77
| | | | | and move it downwards after DocTag, DocOptions etc for easier reading
* giscanner: restore support for 'Return:' and 'Returns value:' tagsDieter Verfaillie2013-10-081-5/+13
| | | | | Accepted by old version of annotationparser.py and actually encountered in the wild. Internaly normalize to 'Returns:'.
* giscanner: only warn about missing delimiter when necessaryDieter Verfaillie2013-10-081-9/+9
| | | | | | | | Turns out gtkdoc-mkdb has always accepted identifier parts with and without a delimiter after the identifier_name field, so it is safe to only require it when annotations are present or in other words, when there are actually multiple fields to be seperated...
* giscanner: give message.ERROR a purposeDieter Verfaillie2013-10-082-19/+33
| | | | | | | | | | | | | | | | | | | It's not yet being used but will be in the future by annotationparser.py to signal the difference between message.WARNING: something is wrong but the comment block can still be parsed and serialized back into a comment block without information being lost message.ERROR: something is wrong and the comment block can *not* be parsed and serialized back into a comment block without information being lost Different tools can then act accordingly. Nothing will change for g-ir-scanner but this will be important for the GTK-Doc comment block rewriting tool to prevent extremely broken input leading to even more broken output...
* giscanner: remove Position.offset()Dieter Verfaillie2013-10-081-3/+0
| | | | It's never used...
* giscanner: give pointer to original comment block...Dieter Verfaillie2013-10-082-12/+17
| | | | | ...when complaining about multiple comment blocks documenting the same identifier.
* giscanner: complete vararg parameter parsingDieter Verfaillie2013-10-082-6/+9
| | | | | | | | | | Normalize deprecated @Varargs [1] and named __VA_ARGS__ [2] notations in as single location, add tests. Remove special casing in maintransformer as it is no longer a special case (tests/warn/unknown-parameter.h passes). [1] https://git.gnome.org/browse/gtk-doc/commit/gtkdoc-mkdb.in?id=4c9d4db0e264d403b301dad9be1c290134846d03 [1] https://git.gnome.org/browse/gtk-doc/commit/gtkdoc-mkdb.in?id=55c78181d6ae1606bdf7885e9caed70a484127ec
* giscanner: define __slots__ on some classesDieter Verfaillie2013-10-082-0/+12
| | | | | | For example, when creating Gtk-3.0.gir, thousands of instances of these classes get created. This makes us waste less space for these instances by not having their __dict__ being created.
* giscanner: always use re.UNICODE modeDieter Verfaillie2013-10-081-16/+12
| | | | | should prevent us from running into locale specific issues wrt what's whitespace, alpha, numeric, etc.
* giscanner: use "\s" instead of "[^\S\n\r]"Dieter Verfaillie2013-10-081-48/+48
| | | | | The original idea was to only match non breaking space, but there's really no reason to do things differently than gtkdoc-mkdb.
* giscanner: expand parse_comment_block() parametersDieter Verfaillie2013-10-081-7/+7
| | | | | Makes it consistent with the parse_comment_blocks() and _parse_comment_block() methods.
* giscanner: rename the parse() method to parse_comment_blocks()Dieter Verfaillie2013-10-083-3/+3
| | | | | | We already have a parse_comment_block() method parsing a single GTK-Doc comment block so it only seems natural to have a plural parse_comment_blocks() to go along with that.
* giscanner: rename AnnotationParser() to GtkDocCommentBlockParser()Dieter Verfaillie2013-10-083-8/+8
| | | | | | Clarify the purpose of what up until now was know as the AnnotationParser() class, as it does more than just extracting annotations, it parses the complete GTK-Doc comment block.
* giscanner: rename "comment" to "description"Dieter Verfaillie2013-10-082-26/+26
| | | | Simply because they are called description fields on GTK-Doc parts...
* giscanner: rename "colon" to "delimiter"Dieter Verfaillie2013-10-082-22/+22
| | | | | | | It serves as a GTK-Doc "field" separator, so delimiter seems like a better name. This also makes the distinction between the colon used in property/signal names (which is not a "field" separator) and the GTK-Doc "field" separator a bit more clear.
* giscanner: rename "options" to "annotations"Dieter Verfaillie2013-10-082-199/+195
| | | | | | | Makes it easier to understand the difference between an annotation and an option, which are written as "(annotation option1=value1 option2=value2 ...)" in GTK-Doc comment blocks.
* giscanner: reindent re documentationDieter Verfaillie2013-10-081-101/+101
|
* giscanner: fix parameter name checkDieter Verfaillie2013-10-081-1/+1
| | | | | | It's been impossible to have a TAG_RETURNS in GTK-Doc comment block parameters for a long while now as we transform those into valid tags in parse_comment_block()...
* giscanner: tiny MainTransformer cleanupDieter Verfaillie2013-10-081-6/+3
|
* giscanner: improve inline docsDieter Verfaillie2013-10-081-23/+106
|
* giscanner: fix typoDieter Verfaillie2013-10-081-1/+1
|
* giscanner: remove dead codeDieter Verfaillie2013-10-084-62/+0
| | | | | Last call sites where removed in 36aa515f1036978ced8d4ffb808260844f7229e0 about 3 years ago.
* tests: Update misc/pep8.py to 1.4.6Dieter Verfaillie2013-10-083-54/+42
| | | | | Updated from: https://raw.github.com/jcrocholl/pep8/1.4.6/pep8.py
* Revert "scannerlexer: don't reject __volatile__ tokens"Giovanni Campagna2013-09-241-2/+2
| | | | | This reverts commit ebffefb27ed81b095106056698dd8db9a21fb6f9. Pushed by mistake
* scannerlexer: don't reject __volatile__ tokensGiovanni Campagna2013-09-241-2/+2
| | | | | They should be treated the same as regular volatile specifiers, not like __attribute__() or __asm__().
* 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