33# /// script
44# requires-python = ">=3.12"
55# ///
6- __version__ = '0.2.3 '
6+ __version__ = '0.2.4 '
77__v_type__ = 'release'
88__author__ = 'Slackow'
99__license__ = 'MIT'
1313modified_by = ''
1414# # # # # # # # # # # # # # # # # # # # # #
1515
16- latest_mc_version = '1.21.5 '
16+ latest_mc_version = '1.21.6 '
1717
1818import textwrap , argparse , json , re , sys , shutil , tempfile
1919from os import chdir
@@ -26,6 +26,7 @@ def ver(base_version, start, end, *, pf):
2626
2727pack_formats = {
2828 'future' : 9001 ,
29+ '1.21.6' : 80 ,
2930 '1.21.5' : 71 ,
3031 '1.21.4' : 61 ,
3132 '1.21.3' : 57 , '1.21.2' : 57 ,
@@ -122,6 +123,9 @@ def __enter__(self):
122123 def __exit__ (self , exc_type , exc_val , exc_tb ):
123124 func_stack .pop ()
124125
126+ def replace (self ):
127+ func_stack [- 1 ] = self .func_name
128+
125129 def __function__ (func_name : str ) -> FuncContext :
126130 return FuncContext (func_name )
127131
@@ -219,15 +223,17 @@ def comp_file(output_folder: Path, parent: Path, filename: Path, globals: dict[s
219223 # It's basically grabbing from either the first or second group, since they're mutually exclusive
220224 contents = interpolation_re .sub (r'{\1\2}' , contents )
221225 extra_line = None
222- if contents . endswith (':' ):
226+ if ( end_chr := contents [ - 1 :]) in (':' , '; ' ):
223227 func_def_start = right_most_function (contents )
224228 # print('func: ', line)
225229 if func_def_start is None :
226- raise ValueError (f'Command { contents !r} ends with colon but does not contain function' )
230+ raise ValueError (f'Command { contents !r} ends with colon/semicolon but does not contain function' )
227231 func_def = contents [func_def_start :- 1 ].strip ()
228232 code .append (f'{ indent } __f, __extra = __function_name__(f"{ func_def } ")' )
229233 contents = f'{ contents [:func_def_start ]} {{__f}}{{__extra}}'
230234 extra_line = f'{ indent } with __function__(__f):'
235+ if end_chr == ';' :
236+ extra_line = f'{ indent } __function__(__f).replace()'
231237 code .append (f'{ indent } __line__(rf""" { contents } """[1:-1])' )
232238 if extra_line :
233239 code .append (extra_line )
0 commit comments