Don't pass JSON-files through csonc

This commit is contained in:
Florian M. Schäfer
2015-01-06 21:51:59 +01:00
committed by Florian Schäfer
parent e8e82a1ca3
commit 417171cfe1

View File

@@ -148,10 +148,12 @@ def load_grammar(path)
case File.extname(path.downcase)
when '.plist', '.tmlanguage'
Plist::parse_xml(path)
when '.cson', '.json'
when '.cson'
cson = `"#{CSONC}" "#{path}"`
raise "Failed to convert CSON grammar '#{path}': #{$?.to_s}" unless $?.success?
JSON.parse(cson)
when '.json'
JSON.parse(File.read(path))
else
raise "Invalid document type #{path}"
end