mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Add properties to AST types
I want to have a cleaner API that relies less on the specifics of the grammar and parser.
This commit is contained in:
parent
0b7dbaf90d
commit
6938267952
4 changed files with 34 additions and 10 deletions
|
@ -203,6 +203,10 @@ class Flag(AstNode):
|
|||
class FlagsValue(Value):
|
||||
grammar = [Flag, "|", Delimited(Flag, "|")]
|
||||
|
||||
@property
|
||||
def flags(self) -> T.List[Flag]:
|
||||
return self.children
|
||||
|
||||
@validate()
|
||||
def parent_is_bitfield(self):
|
||||
type = self.parent.value_type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue