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

Added untokenizing code. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

tmr232
Copy link

@tmr232 tmr232 commented Oct 1, 2015

Added code to untokenize the resulting parsed values, so that they are converted to proper strings.


def parse(self, string_or_stream):
def parseFile(self, path, untokenize_=False):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm just a quick one (I should have done this earlier :) ). Can you add comments to this method as well - I wasnt sure of the purpose of the untokenizing. Is it so that if you have a plist stream then the start of the next plist object can be reliably obtained later on?

@tmr232
Copy link
Author

tmr232 commented Oct 1, 2015

The untokenize function and accompanying classes are there to enable obtaining the objects recursively.

@panyam
Copy link
Owner

panyam commented Oct 2, 2015

Hey sorry for the confusion mate. Can you give me an example on how you would use it?

@panyam
Copy link
Owner

panyam commented Oct 2, 2015

Ideally something explaining the API in the readme would be great for other users too :)

@tmr232
Copy link
Author

tmr232 commented Oct 6, 2015

OK. Just realize the original code was a mess, and that when I actually modify the project I can do a better job.

The new code makes sure that every time a value is returned (to a dict or a list) it uses the value and not the token class. This is much cleaner code than my original solution.

Also, is there a reason to ever return token instead of strings?

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.

2 participants