| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Not doing this manually all over the place makes
the code slightly more readable.
https://bugzilla.gnome.org/show_bug.cgi?id=689454
|
|
|
|
|
|
| |
02e545371e2132a97458888895cacf57b8c0f83a (2015-06-23)
https://bugzilla.gnome.org/show_bug.cgi?id=725685
|
|
|
|
|
|
|
| |
Allow `identifier`, `parameter` and `tag` part `annotations` fields
to span multiple lines
https://bugzilla.gnome.org/show_bug.cgi?id=676133
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
What we already had:
- (array zero-terminated=1) > array which is NULL terminated
- (array zero-terminated=0) > array which is not NULL terminated
- (array) > array which is not NULL terminated
- (array zero-terminated=X) > array which is not NULL terminated
where X can be anything
What this patch adds:
- (array zero-terminated) > array which is NULL terminated
https://bugzilla.gnome.org/show_bug.cgi?id=657754
|
|
|
|
|
| |
Add ANN_NULLABLE and ANN_OPTIONAL in the one (and only) other place that
ANN_ALLOW_NONE is mentioned...
|
|
|
|
|
|
|
| |
Add (nullable) and (optional) as recognised annotations in the same places that
(allow-none) is allowed. This should have been done in the previous
commits but the tests were passing because the only ill effect was that
a warning was issued.
|
|
|
|
|
|
|
| |
This reverts commit 0839e696e9fbc1942ac5c61054de3b47e9578152.
This was accidentally picked up by my 'git bz apply' against the bug as
I was getting ready to push the last set of changes.
|
|
|
|
|
|
|
|
|
|
|
| |
Add two new annotations, (nullable) and (optional).
(nullable) always means "the type of this value can also contain null".
(optional) always means "this out parameter can be ignored by passing
NULL to the C function".
https://bugzilla.gnome.org/show_bug.cgi?id=660879
|
|
|
|
|
|
|
|
|
| |
The old annotationparser.py happily parsed this, but
giscanner/girwriter.py never serialized an allow-none
attribute to the .gir file and girepository/girparser.c
never looked for an allow-none attribute either.
https://bugzilla.gnome.org/show_bug.cgi?id=660879
|
|
|
|
|
|
|
|
|
|
|
| |
When encountering /**/ in the source, parse_gtk_doc_comment()
would be executed (due to the /** part starting a GTK-Doc
comment block) and would happily consume the / and everything
up until the next comment block was closed or EOF, thus
consuming a whole block of C code...
Encoutered in the wild here:
https://git.gnome.org/browse/clutter-gst/tree/clutter-gst/clutter-gst-player.c?id=03f0d8f48bd7f60e582e6185cb73a07038e8d55d#n1926
|
|
|
|
|
|
| |
Makes our GTK-Doc comment block rewriting tool halt on
such issues, requireing user intervention instead of writing
back even more bogus data.
|
|
|
|
|
| |
makes _parse_annotations() and _parse_fields() callers slightly
more readable
|
|
|
|
|
| |
... so it points to the start of the GTK-Doc comment
block instead of the position of the identifier field.
|
| |
|
|
|
|
|
|
|
| |
GTK-Doc comment block fixer tool will refuse to rewrite source
files that generated errors (indicating a source->parse tree->source
would result in information being lost), but will happily continue
on warnings (which do not result in information being lost).
|
|
|
|
|
|
|
|
|
| |
GTK-Doc parameter description fields are allowed to span
multiple lines, tag description fields are allowed to span
multiple lines and paragraphs. A tool fixing/rewriting
GTK-Doc comment blocks in source files would need to have
description fields parsed and stored (almost) exactly as
they appear in the source file.
|
| |
|
|
|
|
|
|
| |
No need to enumerate the comment lines list as we already receive
the lineno of the very first line as a parameter. Simply increment
that one when looping over the comment lines list.
|
| |
|
|
|
|
|
|
| |
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...
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
- 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...
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Write them in alphabetical order and explain what
they are used for a bit more clearly.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
and move it below DocOption for easier reading
|
|
|
|
|
| |
and move it downwards after DocOption and DocAnnotations
for easier reading
|
|
|
|
|
| |
and move it downwards after DocTag, DocOptions etc for
easier reading
|
|
|
|
|
| |
Accepted by old version of annotationparser.py and actually
encountered in the wild. Internaly normalize to 'Returns:'.
|
|
|
|
|
|
|
|
| |
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...
|
|
|
|
|
| |
...when complaining about multiple comment blocks
documenting the same identifier.
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
should prevent us from running into locale specific issues
wrt what's whitespace, alpha, numeric, etc.
|
|
|
|
|
| |
The original idea was to only match non breaking space, but
there's really no reason to do things differently than gtkdoc-mkdb.
|