mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Don't pass JSON-files through csonc
This commit is contained in:
		
				
					committed by
					
						 Florian Schäfer
						Florian Schäfer
					
				
			
			
				
	
			
			
			
						parent
						
							e8e82a1ca3
						
					
				
				
					commit
					417171cfe1
				
			| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user