reorganization: Move hooks to common.py

This allows them to be referenced before they are filled, helping avoid
circular dependencies.
This commit is contained in:
James Westman 2022-01-26 14:50:36 -06:00
parent 34f525beaa
commit 8f9de81e24
5 changed files with 89 additions and 6 deletions

View file

@ -40,7 +40,7 @@ def parse(tokens) -> T.Tuple[ast.UI, T.Optional[MultipleErrors]]:
UseIdent("name"),
":",
AnyOf(
*OBJECT_HOOKS,
OBJECT_HOOKS,
object,
value,
).expected("a value"),
@ -82,7 +82,7 @@ def parse(tokens) -> T.Tuple[ast.UI, T.Optional[MultipleErrors]]:
[
"{",
Until(AnyOf(
*OBJECT_CONTENT_HOOKS,
OBJECT_CONTENT_HOOKS,
binding,
property,
child,
@ -116,7 +116,7 @@ def parse(tokens) -> T.Tuple[ast.UI, T.Optional[MultipleErrors]]:
ast.GtkDirective,
ZeroOrMore(ast.Import),
Until(AnyOf(
*OBJECT_HOOKS,
OBJECT_HOOKS,
template,
object,
), Eof()),