mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Add layouts
This commit is contained in:
parent
cc3ee76dc2
commit
c155ba7b15
3 changed files with 67 additions and 4 deletions
|
@ -244,12 +244,31 @@ def parse(tokens) -> T.Tuple[ast.UI, T.Optional[MultipleErrors]]:
|
|||
),
|
||||
)
|
||||
|
||||
layout_prop = Group(
|
||||
ast.LayoutProperty,
|
||||
Statement(
|
||||
UseIdent("name"),
|
||||
Op(":"),
|
||||
value.expected("a value"),
|
||||
)
|
||||
)
|
||||
|
||||
layout = Group(
|
||||
ast.Layout,
|
||||
Sequence(
|
||||
Keyword("layout"),
|
||||
OpenBlock().expected("`{`"),
|
||||
Until(layout_prop, CloseBlock()),
|
||||
)
|
||||
)
|
||||
|
||||
object_content = Group(
|
||||
ast.ObjectContent,
|
||||
Sequence(
|
||||
OpenBlock(),
|
||||
Until(AnyOf(
|
||||
style,
|
||||
layout,
|
||||
binding,
|
||||
property,
|
||||
signal,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue