Skip to content

Commit

Permalink
Internals: Fix astgen spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
wsnyder committed Sep 29, 2024
1 parent afeca21 commit b7e5486
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/astgen
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ def write_ast_impl(filename):
with open_file(filename) as fh:

def emitBlock(pattern, **fmt):
fh.write(textwrap.indent(textwrap.dedent(pattern), " ").format(**fmt))
fh.write(pattern.format(**fmt))

for node in AstNodeList:
if node.name == "Node":
Expand All @@ -931,7 +931,8 @@ def write_ast_impl(filename):
" BROKEN_RTN(!m_{name}->brokeExists());\n",
name=ptr['name'])
# Node's broken rules can be specialized by declaring broken()
emitBlock(" return Ast{t}::broken(); }}\n", t=node.name)
emitBlock(" return Ast{t}::broken();\n", t=node.name)
emitBlock("}}\n", t=node.name)

emitBlock("void Ast{t}::cloneRelinkGen() {{\n", t=node.name)
if node.superClass.name != 'Node':
Expand Down

0 comments on commit b7e5486

Please sign in to comment.