by 0942v8653 · 11y ago · 0 comments
- XML for snippets (https://github.com/sublimehq/Packages/blob/master/C%2B%2B/fo...)
- YAML for syntax files (https://github.com/sublimehq/Packages/blob/master/C%2B%2B/C%...)
- JSON for settings (https://github.com/sublimehq/Packages/blob/master/C%2B%2B/C%...)
- and plist for TextMate compatibility (https://github.com/sublimehq/Packages/blob/master/C%2B%2B/In...)
Of course each one has a reason to be that way, but it must be really annoying to maintain.
Example: using PyYAML to parse the JSON file from above:
>> import yaml
>> val = yaml.load('{"extensions": ["cpp", "cc", "cxx", "c++", "h", "hpp",
"hxx", "h++", "inl", "ipp"]}')
>> print val
{'extensions': ['cpp', 'cc', 'cxx', 'c++', 'h', 'hpp', 'hxx', 'h++', 'inl', 'ipp']}"YAML can therefore be viewed as a natural superset of JSON, offering improved human readability and a more complete information model. This is also the case in practice; every JSON file is also a valid YAML file."
http://yaml.org/spec/1.2/spec.html#id2759572
You can parse any JSON file using a YAML parser.
One step at a time!