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

Add json parsing into simple key/value dict compatible format #3

Closed
bovine opened this issue Sep 27, 2011 · 1 comment
Closed

Add json parsing into simple key/value dict compatible format #3

bovine opened this issue Sep 27, 2011 · 1 comment

Comments

@bovine
Copy link
Member

bovine commented Sep 27, 2011

The "json" package http://tcllib.sourceforge.net/doc/json.html offers a ::json::json2dict method that outputs an easy to parse key/value list that can be loaded directly into a dict or an array to access individual elements:

{Country US Latitude 37.7668 precision zip State CA City {SAN FRANCISCO} Address {} Zip 94107 Longitude -122.3959} {Country US Latitude 37.371991 precision zip State CA City SUNNYVALE Address {} Zip 94085 Longitude -122.026020}

However, yajltcl's parse currently returns this, which is ponderously complex to mechanically navigate and extract just the value you want:

array_open map_open map_key precision string zip map_key Latitude number 37.7668 map_key Longitude number -122.3959 map_key Address string {} map_key City string {SAN FRANCISCO} map_key State string CA map_key Zip string 94107 map_key Country string US map_close map_open map_key precision string zip map_key Latitude number 37.371991 map_key Longitude number -122.026020 map_key Address string {} map_key City string SUNNYVALE map_key State string CA map_key Zip string 94085 map_key Country string US map_close array_close
@bovine
Copy link
Member Author

bovine commented Oct 31, 2011

fixed!

@bovine bovine closed this as completed Oct 31, 2011
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

No branches or pull requests

1 participant