JSON sugar
Posted: 05 November 2008 04:16 PM   [ Ignore ]
Newbie
Rank
Total Posts:  1
Joined  2008-11-03

I have made the beginnings of a JSON sugar. I copied the JavaScript sugar, deleted the parts that didn’t apply to JSON, and added a few more syntaxes. I didn’t do much to the plist in the Syntaxes folder, because I’m not really sure what it’s for. Also, apparently, a character may not have more than one syntax, because Espresso won’t think of ”[” as both a meta.brace.square.open.json and a punctuation.definition.array.begin.json – it just makes it whichever is first in the syntax file.

You can download it to try it out. To install, unzip and put in ~/Library/Application Support/Espresso/Sugars/ . I hope to continue working on this sugar, so suggestions or fixes are welcome.

Profile
 
 
Posted: 05 November 2008 05:00 PM   [ Ignore ]   [ # 1 ]
Sr. Member
RankRankRankRank
Total Posts:  232
Joined  2008-11-05
Rory O’Kane - 05 November 2008 04:16 PM

I have made the beginnings of a JSON sugar. I copied the JavaScript sugar, deleted the parts that didn’t apply to JSON, and added a few more syntaxes. I didn’t do much to the plist in the Syntaxes folder, because I’m not really sure what it’s for. Also, apparently, a character may not have more than one syntax, because Espresso won’t think of ”[” as both a meta.brace.square.open.json and a punctuation.definition.array.begin.json – it just makes it whichever is first in the syntax file.

You can download it to try it out. To install, unzip and put in ~/Library/Application Support/Espresso/Sugars/ . I hope to continue working on this sugar, so suggestions or fixes are welcome.

What are your plans for inter-leverage with the JavaScript sugar(s)? Perhaps you should try to convince the authors of those to <include> yours in place of the hash literal that JSON represents, so that there’s no duplication of effort/code.

Oh, and the plist is deprecated — you can just delete it.

 Signature 

Ruby.sugar | Rails.sugar? | Haml.sugar | SASS.sugar | Sugar Manager.sugar | Git.sugar | Regex.sugar | ERb.sugar | RSpec.sugar

http://elliottcable.name/contact.xhtml

Profile