Make template parent optional

Not recommended, since you lose some type checking.
This commit is contained in:
James Westman 2022-01-16 21:06:40 -06:00
parent 1897478480
commit 6b78338d1a
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
5 changed files with 24 additions and 8 deletions

View file

@ -140,8 +140,12 @@ def parse(tokens) -> T.Tuple[ast.UI, T.Optional[MultipleErrors]]:
Sequence(
Keyword("template"),
UseIdent("name").expected("template class name"),
Op(":").expected("`:`"),
class_name.expected("parent class"),
Optional(
Sequence(
Op(":"),
class_name.expected("parent class"),
)
),
object_content.expected("block"),
)
)