aboutsummaryrefslogtreecommitdiff
path: root/codegen/lib/code/blocks.py
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-06-21 19:06:18 -0500
committermat <github@matdoes.dev>2022-06-21 19:06:18 -0500
commitaf7a7b428c60021e1ef717dd7dc3888c21188693 (patch)
treee41a4c573cf29334d94976cdfb25595e6c595375 /codegen/lib/code/blocks.py
parenta1484f66290517b6c36f2e82c92613f23d2c4935 (diff)
parent317567b77a9e339b5dc9a4832b1ce4c6b045dfe7 (diff)
downloadazalea-drasl-af7a7b428c60021e1ef717dd7dc3888c21188693.tar.xz
Merge branch 'main' into 1.19.1
Diffstat (limited to 'codegen/lib/code/blocks.py')
-rw-r--r--codegen/lib/code/blocks.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/codegen/lib/code/blocks.py b/codegen/lib/code/blocks.py
index 4ab4917f..7dc85137 100644
--- a/codegen/lib/code/blocks.py
+++ b/codegen/lib/code/blocks.py
@@ -43,7 +43,7 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, ordered_blocks: li
if property is None:
return ''.join(map(to_camel_case, property_variants))
-
+
property_name = None
for class_name in [block_data_burger['class']] + block_data_burger['super']:
property_name = mappings.get_field(
@@ -103,7 +103,7 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, ordered_blocks: li
ending = property_name.split('_')[-1]
if ending.isdigit():
property_name = property_name[:-(len(ending) + 1)]
-
+
# `type` is a reserved keyword, so we use kind instead ¯\_(ツ)_/¯
if property_name == 'type':
property_name = 'kind'
@@ -180,6 +180,8 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, ordered_blocks: li
if in_macro:
continue
new_code.append(line)
+ # empty line at the end
+ new_code.append('')
with open(BLOCKS_RS_DIR, 'w') as f:
f.write('\n'.join(new_code))