Allow pages and blocks to contain arguments
This commit is contained in:
parent
87a7cfb90f
commit
8e97698b85
@ -58,7 +58,12 @@ class Emitter:
|
||||
def start_block(self, block_name: str) -> None:
|
||||
"""Called at {% block ... %}"""
|
||||
|
||||
self.emit('void ' + block_name + '(void) {')
|
||||
if block_name.endswith(')'):
|
||||
# Block contains arguments
|
||||
self.emit('void ' + block_name + ' {')
|
||||
else:
|
||||
# Void arguments
|
||||
self.emit('void ' + block_name + '(void) {')
|
||||
|
||||
def end_block(self) -> None:
|
||||
"""Called at {% endblock %}"""
|
||||
@ -68,7 +73,12 @@ class Emitter:
|
||||
def start_page(self, page_name: str) -> None:
|
||||
"""Called at {% page ... %}"""
|
||||
|
||||
self.emit('void ' + page_name + '(void) {')
|
||||
if page_name.endswith(')'):
|
||||
# Page contains arguments
|
||||
self.emit('void ' + page_name + ' {')
|
||||
else:
|
||||
# Void arguments
|
||||
self.emit('void ' + page_name + '(void) {')
|
||||
|
||||
def end_page(self) -> None:
|
||||
"""Called at {% endpage %}"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user