#NEWLINE# def run( self , cmd , code ) : #NEWLINE# #INDENT# "Attempt to parse code as JSON, return '' if it succeeds, the error message if it fails." #NEWLINE# strict = ( os . path . splitext ( self . filename ) [ 1 ] not in self . extensions ) #NEWLINE# try : #NEWLINE# #INDENT# if self : #NEWLINE# #INDENT# self . __class__ . regex = self . strict_regex #NEWLINE# json . loads ( code ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . __class__ . regex = self . loose_regex #NEWLINE# sublime . decode_value ( code ) #NEWLINE# #UNINDENT# return '' #NEWLINE# #UNINDENT# except ValueError as err : #NEWLINE# #INDENT# return str ( err )