Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NBT path structure #363

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

NBT path structure #363

wants to merge 4 commits into from

Conversation

fdfdjfk3
Copy link

Description

this adds functionality for parsing NBT paths

Describe the changes you've made. Link to any issues this PR fixes or addresses.
The changes I have made so far implement an NbtPath structure and a parser from a String to an NbtPath.
(from this issue)
#338

this is not fully complete: i have a few questions i need a bit of clarification on:

  • Should I still store spans in the enum variants of NbtPathNode? or is that just redundant because I'm already storing owned values (mainly because of escape characters in quoted strings)
  • What other types should be able to convert into NbtPath besides String? (like &str?)
  • From the original issue: "Once the NbtPath is parsed, lookups can be performed on &Compound or &mut Compound values." -- how should I go about implementing this? i'm having trouble visualizing the structure of a large Compound with many parts and how i'd traverse through it

soo yea that's all for now :p

fdfdjfk3 added 4 commits June 4, 2023 18:07
Still missing indexing into arrays and named compounds are buggy.
But that'll be fixed soon.
i also renamed my parse function cus parse_or_error is pretty
repetitive, as it's clear that it returns a result value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant