-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support new particle representation
- Loading branch information
Showing
6 changed files
with
206 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
tests/snapshots/parse__argument_examples_minecraft_particle_0_11__0.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
minecraft:particle 0 11 | ||
--- | ||
{} | ||
--- | ||
minecraft:dust_color_transition{from_color: [1.0f, 0.0f, 0.0f], scale: 0.5f, to_color: [0.0f, 1.0f, 0.5f]} | ||
--- | ||
minecraft:dust_color_transition{from_color: [1.0f, 0.0f, 0.0f], scale: 0.5f, to_color: [0.0f, 1.0f, 0.5f]} | ||
--- | ||
<class 'mecha.ast.AstParticle'> | ||
location: SourceLocation(pos=0, lineno=1, colno=1) | ||
end_location: SourceLocation(pos=106, lineno=1, colno=107) | ||
name: | ||
<class 'mecha.ast.AstResourceLocation'> | ||
location: SourceLocation(pos=0, lineno=1, colno=1) | ||
end_location: SourceLocation(pos=31, lineno=1, colno=32) | ||
is_tag: False | ||
namespace: 'minecraft' | ||
path: 'dust_color_transition' | ||
parameters: | ||
<class 'mecha.ast.AstNbtCompound'> | ||
location: SourceLocation(pos=31, lineno=1, colno=32) | ||
end_location: SourceLocation(pos=106, lineno=1, colno=107) | ||
entries: | ||
<class 'mecha.ast.AstNbtCompoundEntry'> | ||
location: SourceLocation(pos=32, lineno=1, colno=33) | ||
end_location: SourceLocation(pos=62, lineno=1, colno=63) | ||
key: | ||
<class 'mecha.ast.AstNbtCompoundKey'> | ||
location: SourceLocation(pos=32, lineno=1, colno=33) | ||
end_location: SourceLocation(pos=42, lineno=1, colno=43) | ||
value: 'from_color' | ||
value: | ||
<class 'mecha.ast.AstNbtList'> | ||
location: SourceLocation(pos=44, lineno=1, colno=45) | ||
end_location: SourceLocation(pos=62, lineno=1, colno=63) | ||
elements: | ||
<class 'mecha.ast.AstNbtValue'> | ||
location: SourceLocation(pos=45, lineno=1, colno=46) | ||
end_location: SourceLocation(pos=49, lineno=1, colno=50) | ||
value: Float(1.0) | ||
<class 'mecha.ast.AstNbtValue'> | ||
location: SourceLocation(pos=51, lineno=1, colno=52) | ||
end_location: SourceLocation(pos=55, lineno=1, colno=56) | ||
value: Float(0.0) | ||
<class 'mecha.ast.AstNbtValue'> | ||
location: SourceLocation(pos=57, lineno=1, colno=58) | ||
end_location: SourceLocation(pos=61, lineno=1, colno=62) | ||
value: Float(0.0) | ||
<class 'mecha.ast.AstNbtCompoundEntry'> | ||
location: SourceLocation(pos=64, lineno=1, colno=65) | ||
end_location: SourceLocation(pos=75, lineno=1, colno=76) | ||
key: | ||
<class 'mecha.ast.AstNbtCompoundKey'> | ||
location: SourceLocation(pos=64, lineno=1, colno=65) | ||
end_location: SourceLocation(pos=69, lineno=1, colno=70) | ||
value: 'scale' | ||
value: | ||
<class 'mecha.ast.AstNbtValue'> | ||
location: SourceLocation(pos=71, lineno=1, colno=72) | ||
end_location: SourceLocation(pos=75, lineno=1, colno=76) | ||
value: Float(0.5) | ||
<class 'mecha.ast.AstNbtCompoundEntry'> | ||
location: SourceLocation(pos=77, lineno=1, colno=78) | ||
end_location: SourceLocation(pos=105, lineno=1, colno=106) | ||
key: | ||
<class 'mecha.ast.AstNbtCompoundKey'> | ||
location: SourceLocation(pos=77, lineno=1, colno=78) | ||
end_location: SourceLocation(pos=85, lineno=1, colno=86) | ||
value: 'to_color' | ||
value: | ||
<class 'mecha.ast.AstNbtList'> | ||
location: SourceLocation(pos=87, lineno=1, colno=88) | ||
end_location: SourceLocation(pos=105, lineno=1, colno=106) | ||
elements: | ||
<class 'mecha.ast.AstNbtValue'> | ||
location: SourceLocation(pos=88, lineno=1, colno=89) | ||
end_location: SourceLocation(pos=92, lineno=1, colno=93) | ||
value: Float(0.0) | ||
<class 'mecha.ast.AstNbtValue'> | ||
location: SourceLocation(pos=94, lineno=1, colno=95) | ||
end_location: SourceLocation(pos=98, lineno=1, colno=99) | ||
value: Float(1.0) | ||
<class 'mecha.ast.AstNbtValue'> | ||
location: SourceLocation(pos=100, lineno=1, colno=101) | ||
end_location: SourceLocation(pos=104, lineno=1, colno=105) | ||
value: Float(0.5) |
75 changes: 75 additions & 0 deletions
75
tests/snapshots/parse__argument_examples_minecraft_particle_0_12__0.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
minecraft:particle 0 12 | ||
--- | ||
{} | ||
--- | ||
minecraft:block{block_state: {Name: 'minecraft:redstone_lamp', Properties: {lit: 'true'}}} | ||
--- | ||
minecraft:block{block_state: {Name: "minecraft:redstone_lamp", Properties: {lit: "true"}}} | ||
--- | ||
<class 'mecha.ast.AstParticle'> | ||
location: SourceLocation(pos=0, lineno=1, colno=1) | ||
end_location: SourceLocation(pos=90, lineno=1, colno=91) | ||
name: | ||
<class 'mecha.ast.AstResourceLocation'> | ||
location: SourceLocation(pos=0, lineno=1, colno=1) | ||
end_location: SourceLocation(pos=15, lineno=1, colno=16) | ||
is_tag: False | ||
namespace: 'minecraft' | ||
path: 'block' | ||
parameters: | ||
<class 'mecha.ast.AstNbtCompound'> | ||
location: SourceLocation(pos=15, lineno=1, colno=16) | ||
end_location: SourceLocation(pos=90, lineno=1, colno=91) | ||
entries: | ||
<class 'mecha.ast.AstNbtCompoundEntry'> | ||
location: SourceLocation(pos=16, lineno=1, colno=17) | ||
end_location: SourceLocation(pos=89, lineno=1, colno=90) | ||
key: | ||
<class 'mecha.ast.AstNbtCompoundKey'> | ||
location: SourceLocation(pos=16, lineno=1, colno=17) | ||
end_location: SourceLocation(pos=27, lineno=1, colno=28) | ||
value: 'block_state' | ||
value: | ||
<class 'mecha.ast.AstNbtCompound'> | ||
location: SourceLocation(pos=29, lineno=1, colno=30) | ||
end_location: SourceLocation(pos=89, lineno=1, colno=90) | ||
entries: | ||
<class 'mecha.ast.AstNbtCompoundEntry'> | ||
location: SourceLocation(pos=30, lineno=1, colno=31) | ||
end_location: SourceLocation(pos=61, lineno=1, colno=62) | ||
key: | ||
<class 'mecha.ast.AstNbtCompoundKey'> | ||
location: SourceLocation(pos=30, lineno=1, colno=31) | ||
end_location: SourceLocation(pos=34, lineno=1, colno=35) | ||
value: 'Name' | ||
value: | ||
<class 'mecha.ast.AstNbtValue'> | ||
location: SourceLocation(pos=36, lineno=1, colno=37) | ||
end_location: SourceLocation(pos=61, lineno=1, colno=62) | ||
value: String('minecraft:redstone_lamp') | ||
<class 'mecha.ast.AstNbtCompoundEntry'> | ||
location: SourceLocation(pos=63, lineno=1, colno=64) | ||
end_location: SourceLocation(pos=88, lineno=1, colno=89) | ||
key: | ||
<class 'mecha.ast.AstNbtCompoundKey'> | ||
location: SourceLocation(pos=63, lineno=1, colno=64) | ||
end_location: SourceLocation(pos=73, lineno=1, colno=74) | ||
value: 'Properties' | ||
value: | ||
<class 'mecha.ast.AstNbtCompound'> | ||
location: SourceLocation(pos=75, lineno=1, colno=76) | ||
end_location: SourceLocation(pos=88, lineno=1, colno=89) | ||
entries: | ||
<class 'mecha.ast.AstNbtCompoundEntry'> | ||
location: SourceLocation(pos=76, lineno=1, colno=77) | ||
end_location: SourceLocation(pos=87, lineno=1, colno=88) | ||
key: | ||
<class 'mecha.ast.AstNbtCompoundKey'> | ||
location: SourceLocation(pos=76, lineno=1, colno=77) | ||
end_location: SourceLocation(pos=79, lineno=1, colno=80) | ||
value: 'lit' | ||
value: | ||
<class 'mecha.ast.AstNbtValue'> | ||
location: SourceLocation(pos=81, lineno=1, colno=82) | ||
end_location: SourceLocation(pos=87, lineno=1, colno=88) | ||
value: String('true') |