minecraft-datapack-language 17.0.3__py3-none-any.whl → 17.0.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- minecraft_datapack_language/_version.py +2 -2
- minecraft_datapack_language/cli.py +35 -19
- {minecraft_datapack_language-17.0.3.dist-info → minecraft_datapack_language-17.0.4.dist-info}/METADATA +1 -1
- {minecraft_datapack_language-17.0.3.dist-info → minecraft_datapack_language-17.0.4.dist-info}/RECORD +8 -8
- {minecraft_datapack_language-17.0.3.dist-info → minecraft_datapack_language-17.0.4.dist-info}/WHEEL +0 -0
- {minecraft_datapack_language-17.0.3.dist-info → minecraft_datapack_language-17.0.4.dist-info}/entry_points.txt +0 -0
- {minecraft_datapack_language-17.0.3.dist-info → minecraft_datapack_language-17.0.4.dist-info}/licenses/LICENSE +0 -0
- {minecraft_datapack_language-17.0.3.dist-info → minecraft_datapack_language-17.0.4.dist-info}/top_level.txt +0 -0
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
28
28
|
commit_id: COMMIT_ID
|
29
29
|
__commit_id__: COMMIT_ID
|
30
30
|
|
31
|
-
__version__ = version = '17.0.
|
32
|
-
__version_tuple__ = version_tuple = (17, 0,
|
31
|
+
__version__ = version = '17.0.4'
|
32
|
+
__version_tuple__ = version_tuple = (17, 0, 4)
|
33
33
|
|
34
34
|
__commit_id__ = commit_id = None
|
@@ -21,9 +21,11 @@ def main():
|
|
21
21
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
22
22
|
epilog="""
|
23
23
|
Examples:
|
24
|
-
mdl build
|
25
|
-
mdl build --mdl .
|
26
|
-
mdl
|
24
|
+
mdl build # Build all MDL files in current directory (to ./dist)
|
25
|
+
mdl build --mdl main.mdl # Build a single MDL file (to ./dist)
|
26
|
+
mdl build -o out # Build current directory to custom output
|
27
|
+
mdl check # Check all .mdl files in current directory
|
28
|
+
mdl check main.mdl # Check a single file
|
27
29
|
mdl new my_project # Create a new project
|
28
30
|
"""
|
29
31
|
)
|
@@ -34,15 +36,15 @@ Examples:
|
|
34
36
|
|
35
37
|
# Build command
|
36
38
|
build_parser = subparsers.add_parser('build', help='Build MDL files into a datapack')
|
37
|
-
build_parser.add_argument('--mdl',
|
38
|
-
build_parser.add_argument('-o', '--output',
|
39
|
+
build_parser.add_argument('--mdl', default='.', help='MDL file(s) or directory to build (default: .)')
|
40
|
+
build_parser.add_argument('-o', '--output', default='dist', help='Output directory for the datapack (default: dist)')
|
39
41
|
build_parser.add_argument('--verbose', action='store_true', help='Show detailed output')
|
40
42
|
build_parser.add_argument('--wrapper', help='Optional wrapper directory name for the datapack output')
|
41
43
|
build_parser.add_argument('--no-zip', action='store_true', help='Do not create a zip archive (zip is created by default)')
|
42
44
|
|
43
45
|
# Check command
|
44
46
|
check_parser = subparsers.add_parser('check', help='Check MDL files for syntax errors')
|
45
|
-
check_parser.add_argument('files', nargs='
|
47
|
+
check_parser.add_argument('files', nargs='*', help='MDL files or directories to check (default: current directory)')
|
46
48
|
check_parser.add_argument('--verbose', action='store_true', help='Show detailed output')
|
47
49
|
|
48
50
|
# New command
|
@@ -172,30 +174,44 @@ def build_command(args):
|
|
172
174
|
def check_command(args):
|
173
175
|
"""Check MDL files for syntax errors."""
|
174
176
|
all_errors = []
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
177
|
+
|
178
|
+
# If no files provided, default to scanning current directory
|
179
|
+
input_paths = args.files if getattr(args, 'files', None) else ['.']
|
180
|
+
|
181
|
+
# Collect .mdl files from provided files/directories
|
182
|
+
mdl_files = []
|
183
|
+
for input_path in input_paths:
|
184
|
+
path_obj = Path(input_path)
|
185
|
+
if path_obj.is_dir():
|
186
|
+
mdl_files.extend(path_obj.glob('**/*.mdl'))
|
187
|
+
elif path_obj.is_file():
|
188
|
+
if path_obj.suffix.lower() == '.mdl':
|
189
|
+
mdl_files.append(path_obj)
|
190
|
+
else:
|
191
|
+
print(f"Error: Path '{path_obj}' does not exist")
|
192
|
+
|
193
|
+
if not mdl_files:
|
194
|
+
print("Error: No .mdl files found to check")
|
195
|
+
return 1
|
196
|
+
|
197
|
+
for file_path in mdl_files:
|
182
198
|
try:
|
183
199
|
with open(file_path, 'r', encoding='utf-8') as f:
|
184
200
|
source = f.read()
|
185
|
-
|
201
|
+
|
186
202
|
if args.verbose:
|
187
203
|
print(f"Checking {file_path}...")
|
188
|
-
|
204
|
+
|
189
205
|
# Lex and parse to check for errors
|
190
206
|
lexer = MDLLexer(str(file_path))
|
191
207
|
tokens = list(lexer.lex(source))
|
192
|
-
|
208
|
+
|
193
209
|
parser = MDLParser(str(file_path))
|
194
210
|
ast = parser.parse(source)
|
195
|
-
|
211
|
+
|
196
212
|
if args.verbose:
|
197
213
|
print(f" ✓ {file_path} - {len(ast.functions)} functions, {len(ast.variables)} variables")
|
198
|
-
|
214
|
+
|
199
215
|
except MDLLexerError as e:
|
200
216
|
print(f"Lexer error in {file_path}: {e}")
|
201
217
|
all_errors.append(e)
|
@@ -205,7 +221,7 @@ def check_command(args):
|
|
205
221
|
except Exception as e:
|
206
222
|
print(f"Unexpected error in {file_path}: {e}")
|
207
223
|
all_errors.append(e)
|
208
|
-
|
224
|
+
|
209
225
|
if all_errors:
|
210
226
|
print(f"\nFound {len(all_errors)} error(s)")
|
211
227
|
return 1
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: minecraft-datapack-language
|
3
|
-
Version: 17.0.
|
3
|
+
Version: 17.0.4
|
4
4
|
Summary: Compile MDL language with explicit scoping into a Minecraft datapack (1.21+ ready). Features variables, control flow, error handling, and VS Code extension.
|
5
5
|
Project-URL: Homepage, https://www.mcmdl.com
|
6
6
|
Project-URL: Documentation, https://www.mcmdl.com/docs
|
{minecraft_datapack_language-17.0.3.dist-info → minecraft_datapack_language-17.0.4.dist-info}/RECORD
RENAMED
@@ -1,7 +1,7 @@
|
|
1
1
|
minecraft_datapack_language/__init__.py,sha256=0KVXBE4ScRaRUrf83aA2tVB-y8A_jplyaxVvtHH6Uw0,1199
|
2
|
-
minecraft_datapack_language/_version.py,sha256=
|
2
|
+
minecraft_datapack_language/_version.py,sha256=wuuzLjeJvN5qOxsodzKr3YPsjb9fKHBoxAaTwTbYx7M,706
|
3
3
|
minecraft_datapack_language/ast_nodes.py,sha256=L5izavSeXDr766vsfRvJrcnflXNJyXcy0WSfyJPq2ZA,4484
|
4
|
-
minecraft_datapack_language/cli.py,sha256=
|
4
|
+
minecraft_datapack_language/cli.py,sha256=Xln_DBQv7I1kHFe9-7ApJhXZ-emxVpOSYAtJhFFfNSo,10218
|
5
5
|
minecraft_datapack_language/dir_map.py,sha256=HmxFkuvWGkzHF8o_GFb4BpuMCRc6QMw8UbmcAI8JVdY,1788
|
6
6
|
minecraft_datapack_language/mdl_compiler.py,sha256=Cs3fXtIAG4_Johp7h3BeYOs9RNUogkvYsR8Dvt7Ek1E,70720
|
7
7
|
minecraft_datapack_language/mdl_errors.py,sha256=r0Gu3KhoX1YLPAVW_iO7Q_fPgaf_Dv9tOGSOdKNSzmw,16114
|
@@ -10,9 +10,9 @@ minecraft_datapack_language/mdl_linter.py,sha256=z85xoAglENurCh30bR7kEHZ_JeMxcYa
|
|
10
10
|
minecraft_datapack_language/mdl_parser.py,sha256=1ecbkzvkgwcjfF8tn6Hxg4jBIjyFlk4bCzJ46p0-JR0,27477
|
11
11
|
minecraft_datapack_language/python_api.py,sha256=Iao1jbdeW6ekeA80BZG6gNqHVjxQJEheB3DbpVsuTZQ,12304
|
12
12
|
minecraft_datapack_language/utils.py,sha256=Aq0HAGlXqj9BUTEjaEilpvzEW0EtZYYMMwOqG9db6dE,684
|
13
|
-
minecraft_datapack_language-17.0.
|
14
|
-
minecraft_datapack_language-17.0.
|
15
|
-
minecraft_datapack_language-17.0.
|
16
|
-
minecraft_datapack_language-17.0.
|
17
|
-
minecraft_datapack_language-17.0.
|
18
|
-
minecraft_datapack_language-17.0.
|
13
|
+
minecraft_datapack_language-17.0.4.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
14
|
+
minecraft_datapack_language-17.0.4.dist-info/METADATA,sha256=-SJczEeXohZqxHDdrx7VUKgJ_Aum1iVeMFn1IphQnvE,8343
|
15
|
+
minecraft_datapack_language-17.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
16
|
+
minecraft_datapack_language-17.0.4.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
|
17
|
+
minecraft_datapack_language-17.0.4.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
|
18
|
+
minecraft_datapack_language-17.0.4.dist-info/RECORD,,
|
{minecraft_datapack_language-17.0.3.dist-info → minecraft_datapack_language-17.0.4.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|