mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Use <> instead of () for casts & typeof
This makes it clearer that they aren't functions, and it eliminates syntactic ambiguity with closure expressions.
This commit is contained in:
parent
d6bd282e58
commit
02796fd830
10 changed files with 66 additions and 11 deletions
|
@ -89,6 +89,15 @@ class TypeName(AstNode):
|
|||
if self.gir_type:
|
||||
return self.gir_type.doc
|
||||
|
||||
@property
|
||||
def as_string(self) -> str:
|
||||
if self.tokens["extern"]:
|
||||
return "$" + self.tokens["class_name"]
|
||||
elif self.tokens["namespace"]:
|
||||
return f"{self.tokens['namespace']}.{self.tokens['class_name']}"
|
||||
else:
|
||||
return self.tokens["class_name"]
|
||||
|
||||
|
||||
class ClassName(TypeName):
|
||||
@validate("namespace", "class_name")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue