minecraft-datapack-language 15.1.52__py3-none-any.whl → 15.1.53__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_build.py +1 -1
- minecraft_datapack_language/cli_check.py +30 -1
- minecraft_datapack_language/mdl_linter.py +41 -0
- {minecraft_datapack_language-15.1.52.dist-info → minecraft_datapack_language-15.1.53.dist-info}/METADATA +1 -1
- {minecraft_datapack_language-15.1.52.dist-info → minecraft_datapack_language-15.1.53.dist-info}/RECORD +10 -10
- {minecraft_datapack_language-15.1.52.dist-info → minecraft_datapack_language-15.1.53.dist-info}/WHEEL +0 -0
- {minecraft_datapack_language-15.1.52.dist-info → minecraft_datapack_language-15.1.53.dist-info}/entry_points.txt +0 -0
- {minecraft_datapack_language-15.1.52.dist-info → minecraft_datapack_language-15.1.53.dist-info}/licenses/LICENSE +0 -0
- {minecraft_datapack_language-15.1.52.dist-info → minecraft_datapack_language-15.1.53.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 = '15.1.
|
32
|
-
__version_tuple__ = version_tuple = (15, 1,
|
31
|
+
__version__ = version = '15.1.53'
|
32
|
+
__version_tuple__ = version_tuple = (15, 1, 53)
|
33
33
|
|
34
34
|
__commit_id__ = commit_id = None
|
@@ -731,7 +731,7 @@ def build_mdl(input_path: str, output_path: str, verbose: bool = False, pack_for
|
|
731
731
|
|
732
732
|
# Create zip file if wrapper is specified
|
733
733
|
if wrapper:
|
734
|
-
zip_path = output_dir
|
734
|
+
zip_path = output_dir / f"{wrapper}.zip"
|
735
735
|
_create_zip_file(output_dir, zip_path)
|
736
736
|
if verbose:
|
737
737
|
print(f"[ZIP] Created zip file: {zip_path}")
|
@@ -42,7 +42,36 @@ def lint_mdl_file_wrapper(file_path: str, verbose: bool = False, ignore_warnings
|
|
42
42
|
|
43
43
|
# Perform linting
|
44
44
|
try:
|
45
|
-
lint_mdl_file(str(path))
|
45
|
+
issues = lint_mdl_file(str(path))
|
46
|
+
|
47
|
+
# Check if there are any errors
|
48
|
+
errors = [issue for issue in issues if issue.severity == 'error']
|
49
|
+
warnings = [issue for issue in issues if issue.severity == 'warning']
|
50
|
+
|
51
|
+
if errors:
|
52
|
+
# Report errors
|
53
|
+
print(f"[CHECK] Found {len(errors)} error(s) in: {file_path}")
|
54
|
+
for i, issue in enumerate(errors, 1):
|
55
|
+
print(f"Error {i}: {issue.message}")
|
56
|
+
if issue.suggestion:
|
57
|
+
print(f" Suggestion: {issue.suggestion}")
|
58
|
+
if issue.code:
|
59
|
+
print(f" Code: {issue.code}")
|
60
|
+
print()
|
61
|
+
|
62
|
+
# Exit with error code
|
63
|
+
sys.exit(1)
|
64
|
+
elif warnings and not ignore_warnings:
|
65
|
+
# Report warnings
|
66
|
+
print(f"[CHECK] Found {len(warnings)} warning(s) in: {file_path}")
|
67
|
+
for i, issue in enumerate(warnings, 1):
|
68
|
+
print(f"Warning {i}: {issue.message}")
|
69
|
+
if issue.suggestion:
|
70
|
+
print(f" Suggestion: {issue.suggestion}")
|
71
|
+
if issue.code:
|
72
|
+
print(f" Code: {issue.code}")
|
73
|
+
print()
|
74
|
+
|
46
75
|
print(f"[CHECK] Successfully checked: {file_path}")
|
47
76
|
print("[OK] No errors found!")
|
48
77
|
|
@@ -42,6 +42,47 @@ class MDLLinter:
|
|
42
42
|
return self.issues
|
43
43
|
|
44
44
|
try:
|
45
|
+
# First, try to parse the file with the actual parser to catch syntax errors
|
46
|
+
try:
|
47
|
+
from .mdl_parser_js import parse_mdl_js
|
48
|
+
with open(file_path, 'r', encoding='utf-8') as f:
|
49
|
+
source = f.read()
|
50
|
+
|
51
|
+
# Parse the file - this will catch syntax errors like missing semicolons
|
52
|
+
parse_mdl_js(source, file_path)
|
53
|
+
|
54
|
+
except Exception as parse_error:
|
55
|
+
# If parsing fails, add the error to our issues
|
56
|
+
error_message = str(parse_error)
|
57
|
+
if "Expected SEMICOLON" in error_message:
|
58
|
+
# Extract line and column from the error message
|
59
|
+
import re
|
60
|
+
line_match = re.search(r'Line: (\d+)', error_message)
|
61
|
+
column_match = re.search(r'Column: (\d+)', error_message)
|
62
|
+
line_num = int(line_match.group(1)) if line_match else 1
|
63
|
+
column_num = int(column_match.group(1)) if column_match else 1
|
64
|
+
|
65
|
+
self.issues.append(MDLLintIssue(
|
66
|
+
line_number=line_num,
|
67
|
+
severity='error',
|
68
|
+
category='syntax',
|
69
|
+
message="Missing semicolon",
|
70
|
+
suggestion="Add a semicolon (;) at the end of the statement",
|
71
|
+
code=source.split('\n')[line_num - 1] if line_num <= len(source.split('\n')) else ""
|
72
|
+
))
|
73
|
+
else:
|
74
|
+
# For other parsing errors, add them as well
|
75
|
+
self.issues.append(MDLLintIssue(
|
76
|
+
line_number=1,
|
77
|
+
severity='error',
|
78
|
+
category='syntax',
|
79
|
+
message=f"Parsing error: {error_message}",
|
80
|
+
suggestion="Check the syntax and fix the reported error",
|
81
|
+
code=""
|
82
|
+
))
|
83
|
+
return self.issues
|
84
|
+
|
85
|
+
# If parsing succeeds, do additional linting checks
|
45
86
|
with open(file_path, 'r', encoding='utf-8') as f:
|
46
87
|
lines = f.readlines()
|
47
88
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: minecraft-datapack-language
|
3
|
-
Version: 15.1.
|
3
|
+
Version: 15.1.53
|
4
4
|
Summary: Compile JavaScript-style MDL language or Python API 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
|
@@ -1,9 +1,9 @@
|
|
1
1
|
minecraft_datapack_language/__init__.py,sha256=i-qCchbe5b2Fshgc6yCU9mddOLs2UBt9SAcLqfUIrT0,606
|
2
|
-
minecraft_datapack_language/_version.py,sha256=
|
2
|
+
minecraft_datapack_language/_version.py,sha256=0QU6KmGcKCvzbXF6wwbr58E2UubWbW8QVOP3o5kZY98,708
|
3
3
|
minecraft_datapack_language/ast_nodes.py,sha256=pgjI2Nlap3ixFPgWqGSkqncG9zB91h5BKgRjtcJqMew,2118
|
4
4
|
minecraft_datapack_language/cli.py,sha256=p5A_tEEXugN2NhQFbbgfwi4FxbWYD91RWeKR_A3Vuec,6263
|
5
|
-
minecraft_datapack_language/cli_build.py,sha256
|
6
|
-
minecraft_datapack_language/cli_check.py,sha256=
|
5
|
+
minecraft_datapack_language/cli_build.py,sha256=-VXlRE3BSLrzNVHNtQzrcsX71XSWGF1Gs3f-yyRXQUU,32108
|
6
|
+
minecraft_datapack_language/cli_check.py,sha256=4cKc3HpHLpuGLJ8SDJS6Dr3kl3zv1Rz4-Eu1EhkbxDc,6266
|
7
7
|
minecraft_datapack_language/cli_help.py,sha256=jUTHUQBONAZKVTdQK9tNPXq4c_6xpsafNOvHDjkEldg,12243
|
8
8
|
minecraft_datapack_language/cli_new.py,sha256=KGbKcZW3POwZFAS0nzcwl2NoTUygXzwcUe-iWYyPKEg,8268
|
9
9
|
minecraft_datapack_language/cli_utils.py,sha256=gLGe2nAn8pLiSJhn-DpNvMxo0th_Gj89I-oSeyPx4zU,9293
|
@@ -12,13 +12,13 @@ minecraft_datapack_language/expression_processor.py,sha256=GN6cuRNvgI8TrV6YnEHrA
|
|
12
12
|
minecraft_datapack_language/linter.py,sha256=7UqbygC5JPCGg-BSOq65NB2xEJBu_OUOYIIgmHItO2M,16567
|
13
13
|
minecraft_datapack_language/mdl_errors.py,sha256=a_-683gjF3gfGRpDMbRgCXmXD9_aYYBmLodNH6fe29A,11596
|
14
14
|
minecraft_datapack_language/mdl_lexer_js.py,sha256=G2leNsQz7792uiGig7d1AcQCOFNnmACJD_pXI0wTxGc,26169
|
15
|
-
minecraft_datapack_language/mdl_linter.py,sha256=
|
15
|
+
minecraft_datapack_language/mdl_linter.py,sha256=z85xoAglENurCh30bR7kEHZ_JeMxcYaLDcGNRAl-RAI,17253
|
16
16
|
minecraft_datapack_language/mdl_parser_js.py,sha256=Ng22mKVbMNC4412Xb09i8fcNFPTPrW4NxFeK7Tv7EBQ,38539
|
17
17
|
minecraft_datapack_language/pack.py,sha256=nYiXQ3jgJlDfc4m-65f7C2LFhDRioaUU_XVy6Na4SJI,34625
|
18
18
|
minecraft_datapack_language/utils.py,sha256=Aq0HAGlXqj9BUTEjaEilpvzEW0EtZYYMMwOqG9db6dE,684
|
19
|
-
minecraft_datapack_language-15.1.
|
20
|
-
minecraft_datapack_language-15.1.
|
21
|
-
minecraft_datapack_language-15.1.
|
22
|
-
minecraft_datapack_language-15.1.
|
23
|
-
minecraft_datapack_language-15.1.
|
24
|
-
minecraft_datapack_language-15.1.
|
19
|
+
minecraft_datapack_language-15.1.53.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
20
|
+
minecraft_datapack_language-15.1.53.dist-info/METADATA,sha256=VjIb87PUyKBa4peGpo8Pzng9dxT5arUjHTlAuNH2lS0,35230
|
21
|
+
minecraft_datapack_language-15.1.53.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
22
|
+
minecraft_datapack_language-15.1.53.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
|
23
|
+
minecraft_datapack_language-15.1.53.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
|
24
|
+
minecraft_datapack_language-15.1.53.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|