| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Up to now, section annotations had to match a class or interface
name in order to be serialized in the gir.
With this commit, they now get serialized as docsection nodes,
for potential use by documentation tools.
|
|
|
|
|
| |
This is useful for documentation tools, and other utilities that
rely on full introspection of the C API of a given library.
|
|
|
|
| |
We only support 3.4+ now.
|
|
|
|
|
|
|
|
|
|
|
| |
Some documentation tool (as hotdoc[0]) need to have information about
symbol declaration and documentation positions in the source files
to be able to do smart indexing (automatically build the documenation
index).
[0] https://hotdoc.github.io/
Fixes #175
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
g-i includes an old version of pep8 and pyflakes and uses that
during "make check".
It (1) doesn't catch all cases newer versions of pycodestyle/pyflakes catch
and (2) doesn't test all Python files (3) doesn't work with meson.
Instead of updating just remove them and depend on flake8 instead.
To run the checks simply run flake8 in the root dir.
This also makes it possible to run those checks when using meson and
not autotools.
To not get test suite failures on flake8 updates move the checks from
"make check" to an extra "make check.quality" target.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recognize additional floating point types from ISO/IEC TS 18661-3:2015,
that are already in use by glibc. This continues work from commit
8cf3e8e5cf6d0d49db359f50c6eb0bc9ca22fbef and fixes issue #201.
* _Float16
* _Float32
* _Float64
* _Float128
* _Float32x
* _Float64x
* _Float128x
Use a single BASIC_TYPE token for basic types, while using its string
representation as a type name. This also fixes incorrect type used
previously for __uint128_t, __int128_t, __uint128, __int128, and
_Float128 (they have been mapped to int and float respectively).
Also avoid mapping bool and _Bool to gboolean as those are distinct
types and generally ABI incompatible. Fixes issue #202.
After this changes, when _Bool, _Float* or _int128 types are used
as a part of public API, g-ir-scanner will produce warning about
unresolved type. This is appropriate given that they are currently
inexpressible in GIRepository format.
|
|
|
|
| |
Fixes issue #184.
|
|
|
|
|
|
|
| |
We already require python 2.7, and it has OrderedDict and Counter.
Besides cleaning up unmaintained code, this change found and fixed
a Python 3 bug where we were iterating over a dict while changing it.
|
|
|
|
|
|
|
| |
We enabled anonymous unions earlier, this is a bugfix to enable
anonymous structs.
https://bugzilla.gnome.org/show_bug.cgi?id=766011
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gpointer parameters and return types should be marked as nullable by
default, unless:
• also annotated with (type) and not with (nullable); or
• explicitly annotated with (not nullable).
This introduces the (not nullable) annotation as a direct opposite to
(nullable). In future, (not) could be extended to invert other
annotations.
https://bugzilla.gnome.org/show_bug.cgi?id=729660
|
|
|
|
|
|
|
| |
The mapping to long int types seems bogus; the code above it did the right
thing, but only for size_t.
https://bugzilla.gnome.org/show_bug.cgi?id=756016
|
|
|
|
|
|
|
| |
This is an alias of Parameter.argname, which makes it easier to
duck-type debugging of AST nodes by printing out their name property.
https://bugzilla.gnome.org/show_bug.cgi?id=747979
|
|
|
|
|
|
|
|
| |
Instead of storing a direction property on both Parameter and Return
separately, hoist it up to TypeContainer so it’s inherited. This neatens
things up a bit, but doesn’t really change anything in practice.
https://bugzilla.gnome.org/show_bug.cgi?id=747979
|
|
|
|
|
|
|
|
|
|
| |
It is useful for navigating the AST to have a link from each
TypeContainer instance (e.g. each Parameter and Return) to the parent
AST node, such as a Function.
This will be used in the g-ir-diff tool.
https://bugzilla.gnome.org/show_bug.cgi?id=747979
|
|
|
|
|
|
|
|
|
|
| |
Add lt, le, gt, ge, eq, ne, and hash dunder methods to all classes that
implement custom comparisons with __cmp__. This is needed to support Python 3
compatible sorting of instances of these classes.
Avoid using @functools.total_ordering which does not work for some of these
classes and also is not available in Python 2.6.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add unicode_literals future import which turns any string literal
into a unicode string. Return unicode strings from the Python C extension
module. Force writing of annotations (g-ir-annotation-tool) to output utf8
encoded data to stdout.
This is an initial pass at following the "unicode sandwich"
model of programming (http://nedbatchelder.com/text/unipain.html)
needed for supporting Python 3.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
|
|
|
|
| |
Replace occurances of "%r" (repr) in format strings where the intended
behaviour is to output a quoted string "'foo'" with explicit usage
of "'%s'". This is needed to move the codebase to unicode literals
in order to upgrade to Python 3. Python 2 unicode strings are expanded
with repr formatting prefixed with a "u" as in "u'foo'" which causes
failures for various text formatting scenarios.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
| |
Use future import "print_function" and update relevant uses of print
as a function call. See: PEP 3105
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
|
|
|
| |
Import Python 3 compatible "true division" from the future (PEP 238).
This changes the Python 2 classic division which uses floor division
on integers to true division. Verfied we don't actually use the
division operator anywhere in the code base so this a safety for
supporting both Python 2 and 3.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
| |
Use absolute_import to ensure Python 3 compatibility of the code base.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
| |
Replace usage of iteritems() and itervalues() with items() and values()
respectively.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
| |
This reverts commit 232f3c831260f596e36159112292897962a505b4.
|
|
|
|
|
|
| |
It broke at least atk and mutter.
This reverts commit 5ae7bd58b6266997b61d897ad6562118eeb59210.
|
|
|
|
|
|
|
|
| |
This is an issue in various code bases and tends
to confuse newcomers.
https://bugzilla.gnome.org/show_bug.cgi?id=752047
Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
|
|
|
|
|
| |
Updated from:
https://raw.githubusercontent.com/jcrocholl/pep8/1.6.2/pep8.py
|
|
|
|
|
|
| |
conversion
https://bugzilla.gnome.org/show_bug.cgi?id=748832
|
|
|
|
|
|
| |
Otherwise API using it will badly break in weird ways.
https://bugzilla.gnome.org/show_bug.cgi?id=745608
|
|
|
|
|
|
|
|
| |
Make it clear that both the dependencies field in the typelib, and the
include elements in the GIR AST, are for immediate dependencies, not
transitive ones.
https://bugzilla.gnome.org/show_bug.cgi?id=743782
|
|
|
|
|
|
|
|
|
|
| |
Promote the 'nullable' field to the TypeContainer base class (which is
shared by Return and Parameter types).
Add .gir support for nullability on return values, both in the writer
and in the (scanner's) parser.
https://bugzilla.gnome.org/show_bug.cgi?id=660879
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Record our internal 'nullable' and 'optional' attributes into the
written .gir file. It is now theoretically possible to express the
concept of an out parameter with a nullable type (although presently
there is no way to do this).
Modify our own internal parser (in the scanner) to understand the
newly-written attributes.
Update the expected output of the 'Regress-1.0.gir' test to account for
the new attributes.
Nothing else understands 'nullable' yet, but the girparser in the
typelib compiler already understands 'optional' and records a bit for it
in the typelib.
https://bugzilla.gnome.org/show_bug.cgi?id=660879
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace the 'allow_none' field on parameters with two separate fields:
'nullable' and 'optional'.
Currently, we use 'nullable' to mean the same thing as 'allow-none' for
normal (non-out) parameters. For out parameters, we use the 'optional'
field instead.
Note that the special case for GCancellable and GAsyncReadyCallback is
already guarded by a check for being an in parameter, so we always use
'nullable' here.
On the .gir writer side, we decide which variable to consult when
writing the allow-none attribute depending on the parameter direction.
https://bugzilla.gnome.org/show_bug.cgi?id=660879
|
|
|
|
|
|
|
|
|
|
| |
The field of a callback need not be anonymous, it could be a
typedef, with a proper Type node.
Fixes TelepathyGlib.BaseClient having no virtual functions
(and probably others)
https://bugzilla.gnome.org/show_bug.cgi?id=723439
|
|
|
|
|
|
|
| |
Include Fields (which are not really Node, but the doctool wants
to treat as such) and the methods of Boxed nodes.
https://bugzilla.gnome.org/show_bug.cgi?id=724735
|
|
|
|
|
|
|
|
|
| |
Add structs parsed from C's "tag namespace" into their own cache for lookup
by typdef parsing. This fixes issues where a typedef declared after a
struct would not have a correct name. This also cleans up the need for
special casing struct tags prefixed with an underscore.
https://bugzilla.gnome.org/show_bug.cgi?id=581525
|
|
|
|
|
|
|
|
| |
A hidden exception was being thrown (which we now log), due to fields
being treated as function parameters. Fixed to make field array
annotations be transformed and written out to the gir correctly.
https://bugzilla.gnome.org/show_bug.cgi?id=710561
|
|
|
|
|
|
| |
annotationparser.py already stores attributes in a mapping so
it makes little sense using a list of tuples (suggesting
multiple duplicate keys would be allowed) on the ast side.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 />".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
because we'll add more related code to collections later on
https://bugzilla.gnome.org/show_bug.cgi?id=699536
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Continuation of previous work.
|
|
|
|
| |
Continuation of previous work.
|
|
|
|
| |
Continuing on with previous commit.
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=693876
|
|
|
|
|
|
|
|
|
| |
The eventual model I want to have is that .parent is the "container"
of the node. In all the cases where we don't explicitly set the parent,
this is the namespace, but having this under one field name would be
a big cleanup for the docwriter.
https://bugzilla.gnome.org/show_bug.cgi?id=693876
|
|
|
|
|
|
|
| |
If there's an unresolved type for an annotation, it's very likely
it's using a target_giname.
https://bugzilla.gnome.org/show_bug.cgi?id=693598
|