summaryrefslogtreecommitdiff
path: root/giscanner
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'sourcescanner-empty-delcs' into 'master'Christoph Reiter2018-12-091-0/+4
|\ | | | | | | | | | | | | sourcescanner: Allow empty declarations. Fixes #216 Closes #216 See merge request GNOME/gobject-introspection!89
| * sourcescanner: Allow empty declarations. Fixes #216Christoph Reiter2018-12-091-0/+4
| | | | | | | | | | As far as I see these are not valid C and only allowed in C++11. But they do occur in the wild (mingw headers) so let's try to handle them.
* | Replace linked lists with arrays in source scannerTomasz Miąsko2018-12-095-62/+53
|/ | | | Reduce total number of memory allocations and increase data locality.
* Ignore __pragma keyword used by MSVCTomasz Miąsko2018-12-081-0/+1
|
* Merge branch 'drop-py-compat-code' into 'master'Christoph Reiter2018-12-0825-184/+7
|\ | | | | | | | | Drop all Python 2 compat code See merge request GNOME/gobject-introspection!85
| * Drop all Python 2 compat codeChristoph Reiter2018-12-0825-184/+7
| | | | | | | | We only support 3.4+ now.
* | sourcescanner: collect error messages and expose themChristoph Reiter2018-12-087-8/+56
| | | | | | | | | | | | | | | | | | | | | | It just printed errors to stderr and always returns success even if parsing fails. This prevents us to write any tests for it. As a first step collect all lexing/parsing error messages and print them to stderr after the scanner is done. This allows us to add some regression tests for !78. In the future we probably want to raise an exception with those errors if parsing fails.
* | cachestore: don't try to catch nonexisting pickle.BadPickleGet. Fixes #159Christoph Reiter2018-12-081-1/+1
|/ | | | | pickle.loads() can pretty much throw any kind of exception and we can't handle it besides ignoring it, so just catch all.
* Merge branch 'scan-file-use-filename' into 'master'Christoph Reiter2018-12-074-117/+27
|\ | | | | | | | | gi_source_scanner_parse_file: use a filename instead of a FILE struct See merge request GNOME/gobject-introspection!79
| * gi_source_scanner_parse_file: use a filename instead of a FILE structChristoph Reiter2018-12-064-117/+27
| | | | | | | | | | | | This allows us to get rid of the msvc hacks which are needed in case Python is built with a different msvc than g-i. By passing a filename the FILE struct never passes over library boundaries.
* | Merge branch 'typeof' into 'master'Christoph Reiter 🐍2018-12-061-2/+2
|\ \ | |/ |/| | | | | scanner: Replace use of typeof with void token See merge request GNOME/gobject-introspection!78
| * scanner: Replace use of typeof with void tokenTomasz Miąsko2018-12-041-2/+2
| | | | | | | | | | | | This makes it possible to parse inputs where typeof is used as part of cast expression, e.g., in g_object_ref macro expansion. Selection of VOID is arbitrary since there is no actual implementation of typeof.
* | giscanner/girwriter.py: Fix running on WindowsChun-wei Fan2018-12-061-1/+8
|/ | | | | | | ... When we are building in a drive that is different from the drive that we are acquiring the depedencies from. For example, os.path.relpath() does not like it when we we are building G-I on D:\foo while the GLib headers are found are C:\glib.
* writer: Include documentation and symbol position in source filesThibault Saunier2018-11-288-11/+84
| | | | | | | | | | | 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
* Define grefcount and gatomicrefcount as aliases to gintTomasz Miąsko2018-11-231-0/+2
|
* giscanner: Print relative filename paths when warningJonas Ådahl2018-11-081-5/+2
| | | | | | | | | | | | | | | | g-ir-scanner would cut away the 'common prefix' between the current working directory and the file about be warned about. This is problematic when using automatic jumping to warnings and errors, as it'd mean the editor can't find the relevant file. For example, if g-ir-scanner is run from 'build/', and a warning occurs on a file in 'src/file.c', the scanner would print the warning 'src/file.c:123: Warning: This and that'. Running this from e.g. meson would mean e.g. VIM would not find the correct file to jump to. Meanwhile, GCC, in the same setup, would print '../src/file.c:123: Warning: ...', as that is the relative path from where the scanner is ran, and e.g. VIM would behave in a correct way.
* scanner: Skip ldd for library by filenameOlivier Crête2018-11-051-1/+4
|
* scanner: Accept library filenamesOlivier Crête2018-11-051-1/+2
| | | | | This makes it easier to ensure that the right library is scanned.
* scanner: Pass library paths before the -l itselfOlivier Crête2018-11-051-11/+11
| | | | | Without this, it will probably take the system library instead of the one that we are trying to test.
* scanner: Parse __typeof__ and discard itJan Alexander Steffens (heftig)2018-11-051-0/+1
| | | | | | | GLib 2.57.2 introduced __typeof__ in g_clear_pointer, which the scanner failed to parse. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/328
* flake8 updates, fixes "make check.quality"Christoph Reiter2018-11-041-1/+1
| | | | | Disables the new "W504 line break after binary operator" warning. Fixes wrong escape sequences "W605 invalid escape sequence '\.'"
* g-ir-tools: respect gir_dir_prefixKai Kang2018-10-081-0/+1
| | | | | | | | | Configure option gir_dir_prefix is used to configure install dir for .gir files, so add its value to include file search paths. Fix for flake8 and meson-test at same time. Signed-off-by: Kai Kang <kai.kang@windriver.com>
* Revert "scanner: remove hacks to make mingw g-i work with msvc Python"Chun-wei Fan2018-08-211-0/+84
| | | | | | | | Unfortunately, this is still needed for Visual Studio versions that do not have an official CPython release that uses the CRT which the compiler targets to, such as Visual Studio 2012 and 2013 This reverts commit a6a479af1bbe7c0d17766f1408c9fcb720df78dc.
* Revert "scanner: remove some unnecessary Windows includes"Chun-wei Fan2018-08-211-1/+9
| | | | | | | | | | | We need those includes and defines as we need to revert the commit that revert the hacks on Windows, as they are still necessary in the cases where we are using a Python installation that is not linked to the CRT that the currently used compiler targets to, such as on Visual Studio 2012 and 2013, where no official Python release is linked to their respective CRTs. This reverts commit e36350e3fdcb18a21089256b63298d6e3a49212b.
* docwriter: revert some output changes to make the tests passChristoph Reiter2018-08-181-3/+6
| | | | | | This reverts a small part of 19c03a46b1 to make tests pass again. The test error weren't noticed because a new Python dependency was missing, leading to those tests getting skipped.
* g-ir-doc-tool: keep mallard as the default formatChristoph Reiter2018-08-171-1/+1
| | | | | In 7f67146d8254 the FORMAT list was extended but the argparser uses the first item as default value. This broke distcheck.
* tests: depend on flake8 instead of including pep8/pyflakesChristoph Reiter2018-08-1513-19/+9
| | | | | | | | | | | | | | | | 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.
* Merge branch 'devdocs-format-rebase-v2' into 'master'Christoph Reiter2018-08-1421-18/+927
|\ | | | | | | | | Add DevDocs formatting for GJS See merge request GNOME/gobject-introspection!57
| * Fix format/format_inline distinction.rockon9992018-08-132-8/+7
| | | | | | | | - Fix autopep8 errors.
| * Improve markdown compatibility of docwriter.rockon9992018-08-081-13/+80
| |
| * Sort index files by type.rockon9992018-08-061-7/+50
| |
| * Only output introspectable methods.rockon9992018-08-066-9/+33
| |
| * Convert FORMATS to tuple.rockon9992018-08-061-1/+1
| |
| * docwriter: Gdk.Atom as Stringmakepost2018-08-061-0/+2
| | | | | | Reflect new string/GdkAtom marshalling that improves clipboard support: https://gitlab.gnome.org/GNOME/gjs/merge_requests/29
| * docwriter: Handle unknown language MIME typesPhilip Chimento2018-08-061-3/+5
| | | | | | | | | | | | | | Add "plain" -> "text/plain" to the mapping since "plain" is used several times in the GTK documentation. But also, fix the code that falls back to no syntax highlighting for an unknown language - it did not check for KeyError.
| * docwriter: Handle invalid nodes betterPhilip Chimento2018-08-061-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cogl-2.0.gir has the following entry: <bitfield name="BufferMapHint" version="1.4" stability="Unstable" c:type="CoglBufferMapHint"> <doc xml:whitespace="preserve">...</doc> <member name="" value="1" c:identifier="COGL_BUFFER_MAP_HINT_DISCARD"> <doc xml:whitespace="preserve">...</doc> </member> <member name="_range" value="2" c:identifier="COGL_BUFFER_MAP_HINT_DISCARD_RANGE"> <doc xml:whitespace="preserve">...</doc> </member> </bitfield> The prefix is not picked up correctly and so we get a member without a name, which crashes the docwriter in to_underscore(). Change that function to handle this case by giving it a dummy "anonymous member" name.
| * devdocs: Distinguish between versioning notesPhilip Chimento2018-08-061-3/+3
| | | | | | | | | | | | Previously, Since:, Deprecated:, and Stability: annotations were all given the same CSS class. In order to style them differently, we give them different classes.
| * devdocs: Mention when a function throws an errorPhilip Chimento2018-08-061-0/+4
| | | | | | | | | | This uses the "throws" annotation in the generated docs, adding a "Throws exception: Yes" if the annotation is present.
| * devdocs: Format in and out parameters correctlyPhilip Chimento2018-08-061-7/+20
| | | | | | | | | | | | | | | | Previously the functions template did not properly use formatter.get_in_parameters() and formatter.get_out_parameters(), so we had inaccurate function arguments in the documentation. In particular, I originally didn't take functions with multiple return values into account.
| * devdocs: Fix links to enum membersPhilip Chimento2018-08-061-1/+4
| | | | | | | | | | | | Links to enum members, e.g. GLib.MyEnum.FOO, were previously formatted as GLib.MyEnum.foo, so we add this special case for nodes that are ast.Members.
| * devdocs: Describe aliases more thoroughlyPhilip Chimento2018-08-061-0/+16
| | | | | | | | For aliases we add a description of what Javascript type they map to.
| * devdocs: Add extra CSS class to default.tmplPhilip Chimento2018-08-062-1/+11
| | | | | | | | | | | | | | | | We add an extra CSS class to default.tmpl to indicate what kind of AST node is represented here (e.g., ast.Constant). This should properly belong in get_node_kind() in docwriter.py, but adding extra kinds there would affect the way that all the other documentation output formats are generated.
| * devdocs: Mark links to other GIRs as suchPhilip Chimento2018-08-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | DevDocs will try to normalize links relative to the current documentation if it can, and strips ../ off the front, so e.g. a link on the gio20/gio.file page to ../gobject20/gobject.object will end up resolving to http://<host>/gio20/gobject20/gobject.object, which doesn't exist. We clearly mark links to other GIRs with a gir:// URL scheme that DevDocs won't process automatically, and then fill in the links ourselves in the DevDocs scraper.
| * devdocs: Match DevDocs' slug namesPhilip Chimento2018-08-061-2/+3
| | | | | | | | | | | | Because of some Ruby naming rules in DevDocs, other GIR modules will have their documentation in ../namespace10/ instead of ../NameSpace-1.0/, so change format_external_xref() to match this.
| * devdocs: Describe bare functionsPhilip Chimento2018-08-061-0/+2
| | | | | | | | | | Pages for bare functions (not in a class) were missing descriptions of their arguments and return values.
| * devdocs: Format the values of constantsPhilip Chimento2018-08-062-3/+18
| | | | | | | | | | | | | | We change the style of documentation pages for constants, so that their values are displayed in a <dt>/<dd> pair. We add a new method to the formatter family, format_value() which should print the representation of a constant's value in the target language; much like repr() in Python.
| * docwriter: Handle moved_to in underscore functionPhilip Chimento2018-08-061-0/+2
| | | | | | | | | | This function was failing on g_iconv() which has a blank name in the GIR file (its name instead coming from the moved-to attribute.)
| * devdocs: Add deprecated CSS class where neededPhilip Chimento2018-08-066-20/+38
| | | | | | | | | | | | | | | | | | | | This adds a def in _doc.tmpl that expands to "deprecated" if the node is deprecated, and to nothing otherwise. We use it to give the deprecated CSS class to particular elements. The presence of the class on a symbol's main entry will inform DevDocs that the symbol is deprecated, though it won't be formatted in a particular way. The presence of the class on an index entry will cause the index entry to be struck out, so that it's visually obvious in the index when a symbol is deprecated.
| * devdocs: Generate versioning notesPhilip Chimento2018-08-066-6/+36
| | | | | | | | | | | | | | For GIR nodes with version annotations, such as "Since:", "Deprecated:", and "Stability:", we generate stability notes at the top of each node's documentation. These notes are given the CSS class "versioning-note" so that we can format them nicely in DevDocs.
| * devdocs: Don't render private fieldsPhilip Chimento2018-08-062-4/+53
| | | | | | | | | | | | | | | | Skip private fields such as "priv" and "parent_instance". Unfortunately not all private structure and parent instance fields are marked private, and not all of them are named "priv" or "parent_instance". This also includes fields that are contained within anonymous unions.