minecraft-datapack-language 15.4.22__py3-none-any.whl → 15.4.25__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.
@@ -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.4.22'
32
- __version_tuple__ = version_tuple = (15, 4, 22)
31
+ __version__ = version = '15.4.25'
32
+ __version_tuple__ = version_tuple = (15, 4, 25)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -40,6 +40,7 @@ class VariableDeclaration(ASTNode):
40
40
  @dataclass
41
41
  class VariableAssignment(ASTNode):
42
42
  name: str
43
+ scope: Optional[str]
43
44
  value: Any
44
45
 
45
46
 
@@ -377,6 +377,32 @@ class MDLParser:
377
377
  name_token = self._match(TokenType.IDENTIFIER)
378
378
  name = name_token.value
379
379
 
380
+ # Check for scope selector after variable name
381
+ scope = None
382
+ if not self._is_at_end() and self._peek().type == TokenType.LANGLE:
383
+ self._match(TokenType.LANGLE) # consume '<'
384
+
385
+ # Parse scope selector content
386
+ scope_parts = []
387
+ while not self._is_at_end() and self._peek().type != TokenType.RANGLE:
388
+ scope_parts.append(self._peek().value)
389
+ self._advance()
390
+
391
+ if self._is_at_end():
392
+ raise create_parser_error(
393
+ message="Unterminated scope selector",
394
+ file_path=self.source_file,
395
+ line=self._peek().line,
396
+ column=self._peek().column,
397
+ line_content=self._peek().value,
398
+ suggestion="Add a closing '>' to terminate the scope selector"
399
+ )
400
+
401
+ self._match(TokenType.RANGLE) # consume '>'
402
+ scope = ''.join(scope_parts)
403
+ # Update the name to include the scope selector
404
+ name = f"{name}<{scope}>"
405
+
380
406
  self._match(TokenType.ASSIGN)
381
407
 
382
408
  # Parse the value (could be a number or expression)
@@ -384,7 +410,7 @@ class MDLParser:
384
410
 
385
411
  self._match(TokenType.SEMICOLON)
386
412
 
387
- return {"type": "variable_assignment", "name": name, "value": value}
413
+ return {"type": "variable_assignment", "name": name, "scope": scope, "value": value}
388
414
 
389
415
  def _parse_if_statement(self) -> IfStatement:
390
416
  """Parse if statement."""
@@ -685,8 +711,47 @@ class MDLParser:
685
711
  """Parse a command."""
686
712
  command_parts = []
687
713
  while not self._is_at_end() and self._peek().type != TokenType.SEMICOLON:
688
- command_parts.append(self._peek().value)
689
- self._advance()
714
+ current_token = self._peek()
715
+
716
+ # Check if this is an identifier that might be followed by a scope selector
717
+ if current_token.type == TokenType.IDENTIFIER:
718
+ identifier_name = current_token.value
719
+ command_parts.append(identifier_name)
720
+ self._advance() # consume the identifier
721
+
722
+ # Look ahead to see if there's a scope selector
723
+ if not self._is_at_end() and self._peek().type == TokenType.LANGLE:
724
+ # This is a scoped variable - parse the scope selector
725
+ self._match(TokenType.LANGLE) # consume '<'
726
+
727
+ # Parse scope selector content
728
+ scope_parts = []
729
+ while not self._is_at_end() and self._peek().type != TokenType.RANGLE:
730
+ scope_parts.append(self._peek().value)
731
+ self._advance()
732
+
733
+ if self._is_at_end():
734
+ raise create_parser_error(
735
+ message="Unterminated scope selector in command",
736
+ file_path=self.source_file,
737
+ line=self._peek().line,
738
+ column=self._peek().column,
739
+ line_content=self._peek().value,
740
+ suggestion="Add a closing '>' to terminate the scope selector"
741
+ )
742
+
743
+ self._match(TokenType.RANGLE) # consume '>'
744
+ scope_selector = ''.join(scope_parts)
745
+
746
+ # Add the scope selector to the command parts
747
+ command_parts.append(f"<{scope_selector}>")
748
+ else:
749
+ # No scope selector, continue with next token
750
+ continue
751
+ else:
752
+ # Regular token, just add it
753
+ command_parts.append(current_token.value)
754
+ self._advance()
690
755
 
691
756
  if self._is_at_end():
692
757
  raise create_parser_error(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: minecraft-datapack-language
3
- Version: 15.4.22
3
+ Version: 15.4.25
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,6 +1,6 @@
1
1
  minecraft_datapack_language/__init__.py,sha256=i-qCchbe5b2Fshgc6yCU9mddOLs2UBt9SAcLqfUIrT0,606
2
- minecraft_datapack_language/_version.py,sha256=I5Cwge3f4scENDCmJvK0lfCv7rpZtkezUcsloKsVRQo,708
3
- minecraft_datapack_language/ast_nodes.py,sha256=pgjI2Nlap3ixFPgWqGSkqncG9zB91h5BKgRjtcJqMew,2118
2
+ minecraft_datapack_language/_version.py,sha256=cpNlMoFPJRzh32B2Q7_IwcsrxLVLvnVsyE7jWlQC1dM,708
3
+ minecraft_datapack_language/ast_nodes.py,sha256=U-CB3R7p7OjaljI47BWsRrQtliw0yAWUrJVoxzOLmQw,2143
4
4
  minecraft_datapack_language/cli.py,sha256=p5A_tEEXugN2NhQFbbgfwi4FxbWYD91RWeKR_A3Vuec,6263
5
5
  minecraft_datapack_language/cli_build.py,sha256=u0XIOH_zTARPC6dvWf-411OqrF7RjT7Z9Hkp6hTeZsI,47990
6
6
  minecraft_datapack_language/cli_check.py,sha256=bPq9gHsxQ1CIiftkrAtRCifWkVAyjp5c8Oay2NNQ1qs,6277
@@ -14,12 +14,12 @@ minecraft_datapack_language/linter.py,sha256=7UqbygC5JPCGg-BSOq65NB2xEJBu_OUOYII
14
14
  minecraft_datapack_language/mdl_errors.py,sha256=mz6uyPkeBpbMHj4PiAyVecEVJ9_hdSfR45QAjG6oYf0,15690
15
15
  minecraft_datapack_language/mdl_lexer_js.py,sha256=VvbhKm727khdSAABxa03hoIIA7H3hWi3RLp9BSXbhY0,28277
16
16
  minecraft_datapack_language/mdl_linter.py,sha256=z85xoAglENurCh30bR7kEHZ_JeMxcYaLDcGNRAl-RAI,17253
17
- minecraft_datapack_language/mdl_parser_js.py,sha256=SQzc67pKls3NVnQaT0xIILGqpZYAmcZn78TQ0KIM4TE,40216
17
+ minecraft_datapack_language/mdl_parser_js.py,sha256=15E_OXXEHYmGAaqS-eCqI-sSIJ4LDk6soSeBbfo_qVg,43350
18
18
  minecraft_datapack_language/pack.py,sha256=nYiXQ3jgJlDfc4m-65f7C2LFhDRioaUU_XVy6Na4SJI,34625
19
19
  minecraft_datapack_language/utils.py,sha256=Aq0HAGlXqj9BUTEjaEilpvzEW0EtZYYMMwOqG9db6dE,684
20
- minecraft_datapack_language-15.4.22.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
21
- minecraft_datapack_language-15.4.22.dist-info/METADATA,sha256=elLshh43YF1-sNZck0fCVtlNNckjMrLWalSD4X4etYE,37917
22
- minecraft_datapack_language-15.4.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
- minecraft_datapack_language-15.4.22.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
24
- minecraft_datapack_language-15.4.22.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
25
- minecraft_datapack_language-15.4.22.dist-info/RECORD,,
20
+ minecraft_datapack_language-15.4.25.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
21
+ minecraft_datapack_language-15.4.25.dist-info/METADATA,sha256=YGa1EZ268bYICR68n8J-LipaKPObtEORC5jTL4oWXro,37917
22
+ minecraft_datapack_language-15.4.25.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ minecraft_datapack_language-15.4.25.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
24
+ minecraft_datapack_language-15.4.25.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
25
+ minecraft_datapack_language-15.4.25.dist-info/RECORD,,