mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
WIP
This commit is contained in:
parent
6fdb12fd5d
commit
bbfa90177a
3 changed files with 5 additions and 4 deletions
|
@ -320,8 +320,6 @@ class Interface(GirNode, GirType):
|
|||
def lookup_property(self, property: str):
|
||||
if prop := self.properties.get(property):
|
||||
return prop
|
||||
elif self.is_partial:
|
||||
return None
|
||||
else:
|
||||
raise CompileError(
|
||||
f"Interface {self.full_name} does not have a property called {property}",
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
import typing as T
|
||||
|
||||
from .. import gir
|
||||
from ..ast_utils import AstNode, validate, docs
|
||||
|
@ -51,11 +52,13 @@ class ScopeVariable:
|
|||
return self._gir_class
|
||||
|
||||
@property
|
||||
def glib_type_name(self) -> str:
|
||||
def glib_type_name(self) -> T.Optional[str]:
|
||||
if self._glib_type_name is not None:
|
||||
return self._glib_type_name
|
||||
elif self.gir_class:
|
||||
return self.gir_class.glib_type_name
|
||||
else:
|
||||
return None
|
||||
|
||||
def emit_xml(self, xml: XmlEmitter):
|
||||
if f := self._xml_func:
|
||||
|
|
|
@ -55,7 +55,7 @@ class TypeName(AstNode):
|
|||
return self.root.gir.namespaces.get(self.tokens["namespace"] or "Gtk")
|
||||
|
||||
@cached_property
|
||||
def gir_type(self) -> T.Optional[gir.Class]:
|
||||
def gir_type(self) -> gir.GirClass:
|
||||
if self.tokens["ignore_gir"]:
|
||||
return gir.PartialClass(self.tokens["class_name"])
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue