| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Makes it consistent with the parse_comment_blocks() and
_parse_comment_block() methods.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Simply because they are called description fields on GTK-Doc parts...
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
Updated from:
https://raw.github.com/jcrocholl/pep8/1.4.6/pep8.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
They're useless if we can just access the dict directly.
https://bugzilla.gnome.org/show_bug.cgi?id=688897
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of going down with a for the user inexplicable backtrace,
emit a warning asking said user to file a bug including the
comment block in question.
Thanks to Alexandre Rostovtsev <tetromino@gentoo.org> for
proposing something similar in bug #690850
https://bugzilla.gnome.org/show_bug.cgi?id=690850
|
|
|
|
|
|
|
|
|
|
| |
A completely empty GTK-Doc comment block (/**\n*/) resulted
in an unfriendly backtrace, complaining about an
"AttributeError: 'NoneType' object has no attribute 'comment'"
This fixes the issue and adds a test case.
https://bugzilla.gnome.org/show_bug.cgi?id=690850
|