Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Emmanuele Bassi
gi-docgen
Commits
77601afb
Commit
77601afb
authored
Feb 25, 2021
by
Emmanuele Bassi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gir: Drop the GLib aliases for fundamental C types
Fixes: #35
parent
9d0906a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
gidocgen/gir/parser.py
gidocgen/gir/parser.py
+13
-1
No files found.
gidocgen/gir/parser.py
View file @
77601afb
...
...
@@ -34,6 +34,15 @@ FUNDAMENTAL_TYPES = [
'va_list'
,
]
GLIB_ALIASES
=
{
'gchar'
:
'char'
,
'gdouble'
:
'double'
,
'gfloat'
:
'float'
,
'gint'
:
'int'
,
'glong'
:
'long'
,
'gshort'
:
'short'
,
}
FUNDAMENTAL_CTYPES
=
{
'GObject.Object'
:
'GObject*'
,
'GObject.InitiallyUnowned'
:
'GInitiallyUnowned*'
,
...
...
@@ -110,7 +119,10 @@ class GirParser:
def
_lookup_type
(
self
,
name
:
str
,
ctype
:
T
.
Optional
[
str
]
=
None
)
->
ast
.
Type
:
"""Look up a type, and if not found, register it"""
if
name
in
FUNDAMENTAL_TYPES
:
fqtn
=
name
if
name
in
GLIB_ALIASES
:
fqtn
=
GLIB_ALIASES
[
name
]
else
:
fqtn
=
name
elif
name
==
'GType'
:
# This is messy, because GType is part of GObject, but GLib ends up
# registering it first
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment