Skip to content

Commit

Permalink
Merge pull request #13 from peunsu/dev
Browse files Browse the repository at this point in the history
Added Array nbt tags.
  • Loading branch information
peunsu authored Apr 5, 2024
2 parents 28e2144 + 8ad1622 commit 6ad7866
Show file tree
Hide file tree
Showing 6 changed files with 593 additions and 321 deletions.
9 changes: 9 additions & 0 deletions ftb_snbt_lib/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def p_key_value_pair(p):
def p_value(p):
"""value : compound
| list
| array
| BOOL
| BYTE
| SHORT
Expand All @@ -52,6 +53,14 @@ def p_list(p):
else:
p[0] = List(p[2])

def p_array(p):
"""array : LBRACKET NAME SEMICOLON values RBRACKET
| LBRACKET NAME SEMICOLON RBRACKET"""
if len(p) == 4:
p[0] = Array(p[2], [])
else:
p[0] = Array(p[2], p[4])

def p_values(p):
"""values : values value
| values COMMA value
Expand Down
Loading

0 comments on commit 6ad7866

Please sign in to comment.