minecraft-datapack-language 17.0.3__py3-none-any.whl → 17.0.5__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 +39 -19
- {minecraft_datapack_language-17.0.3.dist-info → minecraft_datapack_language-17.0.5.dist-info}/METADATA +1 -1
- {minecraft_datapack_language-17.0.3.dist-info → minecraft_datapack_language-17.0.5.dist-info}/RECORD +8 -8
- {minecraft_datapack_language-17.0.3.dist-info → minecraft_datapack_language-17.0.5.dist-info}/WHEEL +0 -0
- {minecraft_datapack_language-17.0.3.dist-info → minecraft_datapack_language-17.0.5.dist-info}/entry_points.txt +0 -0
- {minecraft_datapack_language-17.0.3.dist-info → minecraft_datapack_language-17.0.5.dist-info}/licenses/LICENSE +0 -0
- {minecraft_datapack_language-17.0.3.dist-info → minecraft_datapack_language-17.0.5.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.5'
|
32
|
+
__version_tuple__ = version_tuple = (17, 0, 5)
|
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
|
@@ -124,6 +126,8 @@ def build_command(args):
|
|
124
126
|
parser = MDLParser(str(mdl_file))
|
125
127
|
ast = parser.parse(source)
|
126
128
|
all_asts.append(ast)
|
129
|
+
# Indicate per-file success
|
130
|
+
print(f"[OK] {mdl_file}")
|
127
131
|
|
128
132
|
except (MDLLexerError, MDLParserError) as e:
|
129
133
|
print(f"Error in {mdl_file}: {e}")
|
@@ -172,30 +176,46 @@ def build_command(args):
|
|
172
176
|
def check_command(args):
|
173
177
|
"""Check MDL files for syntax errors."""
|
174
178
|
all_errors = []
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
179
|
+
|
180
|
+
# If no files provided, default to scanning current directory
|
181
|
+
input_paths = args.files if getattr(args, 'files', None) else ['.']
|
182
|
+
|
183
|
+
# Collect .mdl files from provided files/directories
|
184
|
+
mdl_files = []
|
185
|
+
for input_path in input_paths:
|
186
|
+
path_obj = Path(input_path)
|
187
|
+
if path_obj.is_dir():
|
188
|
+
mdl_files.extend(path_obj.glob('**/*.mdl'))
|
189
|
+
elif path_obj.is_file():
|
190
|
+
if path_obj.suffix.lower() == '.mdl':
|
191
|
+
mdl_files.append(path_obj)
|
192
|
+
else:
|
193
|
+
print(f"Error: Path '{path_obj}' does not exist")
|
194
|
+
|
195
|
+
if not mdl_files:
|
196
|
+
print("Error: No .mdl files found to check")
|
197
|
+
return 1
|
198
|
+
|
199
|
+
for file_path in mdl_files:
|
182
200
|
try:
|
183
201
|
with open(file_path, 'r', encoding='utf-8') as f:
|
184
202
|
source = f.read()
|
185
|
-
|
203
|
+
|
186
204
|
if args.verbose:
|
187
205
|
print(f"Checking {file_path}...")
|
188
|
-
|
206
|
+
|
189
207
|
# Lex and parse to check for errors
|
190
208
|
lexer = MDLLexer(str(file_path))
|
191
209
|
tokens = list(lexer.lex(source))
|
192
|
-
|
210
|
+
|
193
211
|
parser = MDLParser(str(file_path))
|
194
212
|
ast = parser.parse(source)
|
195
|
-
|
213
|
+
|
196
214
|
if args.verbose:
|
197
215
|
print(f" ✓ {file_path} - {len(ast.functions)} functions, {len(ast.variables)} variables")
|
198
|
-
|
216
|
+
# Indicate per-file success
|
217
|
+
print(f"[OK] {file_path}")
|
218
|
+
|
199
219
|
except MDLLexerError as e:
|
200
220
|
print(f"Lexer error in {file_path}: {e}")
|
201
221
|
all_errors.append(e)
|
@@ -205,7 +225,7 @@ def check_command(args):
|
|
205
225
|
except Exception as e:
|
206
226
|
print(f"Unexpected error in {file_path}: {e}")
|
207
227
|
all_errors.append(e)
|
208
|
-
|
228
|
+
|
209
229
|
if all_errors:
|
210
230
|
print(f"\nFound {len(all_errors)} error(s)")
|
211
231
|
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.5
|
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.5.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=GkEJyJ1-rm2j8RKsfehnb0GQTlPUpXS86N-OioltxPQ,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=oNpiMBIaTXvo-67CN-Jty8Fq4yn8WbyuQxhJi1TxtWU,10375
|
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.5.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
14
|
+
minecraft_datapack_language-17.0.5.dist-info/METADATA,sha256=wYDD2stzvU5Ka__wsOYlAoXOddpN-KGozavBbGBe6gY,8343
|
15
|
+
minecraft_datapack_language-17.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
16
|
+
minecraft_datapack_language-17.0.5.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
|
17
|
+
minecraft_datapack_language-17.0.5.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
|
18
|
+
minecraft_datapack_language-17.0.5.dist-info/RECORD,,
|
{minecraft_datapack_language-17.0.3.dist-info → minecraft_datapack_language-17.0.5.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|