language: Add cast expressions

This commit is contained in:
James Westman 2022-12-23 23:24:29 -06:00
parent 2033bd9e16
commit 5cf9b63547
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
15 changed files with 122 additions and 20 deletions

View file

@ -18,7 +18,7 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from .expression import Expr
from .expression import ExprChain
from .gobject_object import Object
from .gtkbuilder_template import Template
from .values import Value, TranslatedStringValue
@ -51,7 +51,7 @@ class Property(AstNode):
UseLiteral("binding", True),
":",
"bind",
Expr,
ExprChain,
),
Statement(
UseIdent("name"),
@ -91,7 +91,7 @@ class Property(AstNode):
if self.gir_property is None:
raise CompileError(
f"Class {self.gir_class.full_name} does not contain a property called {self.tokens['name']}",
f"Class {self.gir_class.full_name} does not have a property called {self.tokens['name']}",
did_you_mean=(self.tokens["name"], self.gir_class.properties.keys()),
)