diff options
| author | mat <github@matdoes.dev> | 2022-06-21 21:20:09 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-06-21 21:20:09 -0500 |
| commit | 0d1e17197bf603d14241f89e9eb3572cf79766cb (patch) | |
| tree | 1d23e133fedbc6a26b482b0305fb02f02598fd45 /codegen/lib/code | |
| parent | efd874957331d8bff1cefa0f43d81685690391bf (diff) | |
| parent | 317567b77a9e339b5dc9a4832b1ce4c6b045dfe7 (diff) | |
| download | azalea-drasl-0d1e17197bf603d14241f89e9eb3572cf79766cb.tar.xz | |
Merge branch 'main' into azalea-entity
Diffstat (limited to 'codegen/lib/code')
| -rw-r--r-- | codegen/lib/code/blocks.py | 6 |
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)) |
