From 45ed62931b6d093117447627d817beb0c387d62e Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Sun, 10 Oct 2010 11:33:03 -0400 Subject: [PATCH] #749 -- adding CoffeeApp mention --- documentation/index.html.erb | 5 +++++ lib/lexer.js | 2 +- lib/rewriter.js | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/documentation/index.html.erb b/documentation/index.html.erb index b95e6630..0c02bcd4 100644 --- a/documentation/index.html.erb +++ b/documentation/index.html.erb @@ -925,6 +925,11 @@ coffee --print app/scripts/*.coffee > concatenation.js — a CoffeeScript compiler plug-in that allows you to include external source files. +
  • + andrzejsliwa's CoffeeApp + — a CoffeeScript wrapper for CouchApps, web applications served + directly from CouchDB. +
  • mauricemach's CoffeeKup — Markup as CoffeeScript. After _why's diff --git a/lib/lexer.js b/lib/lexer.js index 44ad6188..3f81a3ef 100644 --- a/lib/lexer.js +++ b/lib/lexer.js @@ -217,7 +217,7 @@ tokens.push(['+', '+']); } tokens.pop(); - if ((((_ref5 = tokens[0]) != null) ? _ref5[0] !== 'STRING' : undefined)) { + if ((((_ref5 = tokens[0]) != null) ? _ref5[0] : undefined) !== 'STRING') { this.tokens.push(['STRING', '""'], ['+', '+']); } (_this = this.tokens).push.apply(_this, tokens); diff --git a/lib/rewriter.js b/lib/rewriter.js index e0e4f73b..c2ed0e97 100644 --- a/lib/rewriter.js +++ b/lib/rewriter.js @@ -58,15 +58,15 @@ prev = tokens[i - 1]; post = tokens[i + 1]; after = tokens[i + 2]; - if (((after != null) ? after[0] === 'INDENT' : undefined)) { + if (((after != null) ? after[0] : undefined) === 'INDENT') { tokens.splice(i + 2, 1); - if (((before != null) ? before[0] === 'OUTDENT' : undefined) && ((post != null) ? post[0] === 'TERMINATOR' : undefined)) { + if (((before != null) ? before[0] : undefined) === 'OUTDENT' && ((post != null) ? post[0] : undefined) === 'TERMINATOR') { tokens.splice(i - 2, 1); } else { tokens.splice(i, 0, after); } } else if (prev && !('TERMINATOR' === (_ref = prev[0]) || 'INDENT' === _ref || 'OUTDENT' === _ref)) { - if (((post != null) ? post[0] === 'TERMINATOR' : undefined) && ((after != null) ? after[0] === 'OUTDENT' : undefined)) { + if (((post != null) ? post[0] : undefined) === 'TERMINATOR' && ((after != null) ? after[0] : undefined) === 'OUTDENT') { tokens.splice.apply(tokens, [i + 2, 0].concat(tokens.splice(i, 2))); if (tokens[i + 2][0] !== 'TERMINATOR') { tokens.splice(i + 2, 0, ['TERMINATOR', '\n', prev[2]]); @@ -140,7 +140,7 @@ } _ref = this.tokens.slice(i + 1, i + 4), one = _ref[0], two = _ref[1], three = _ref[2]; tag = token[0]; - return ('TERMINATOR' === tag || 'OUTDENT' === tag) && !(((two != null) ? two[0] === ':' : undefined) || ((one != null) ? one[0] === '@' : undefined) && ((three != null) ? three[0] === ':' : undefined)) || tag === ',' && !('IDENTIFIER' === (_ref2 = ((one != null) ? one[0] : undefined)) || 'NUMBER' === _ref2 || 'STRING' === _ref2 || '@' === _ref2 || 'TERMINATOR' === _ref2 || 'OUTDENT' === _ref2); + return ('TERMINATOR' === tag || 'OUTDENT' === tag) && !(((two != null) ? two[0] : undefined) === ':' || ((one != null) ? one[0] : undefined) === '@' && ((three != null) ? three[0] : undefined) === ':') || tag === ',' && !('IDENTIFIER' === (_ref2 = ((one != null) ? one[0] : undefined)) || 'NUMBER' === _ref2 || 'STRING' === _ref2 || '@' === _ref2 || 'TERMINATOR' === _ref2 || 'OUTDENT' === _ref2); }; action = function(token, i) { return this.tokens.splice(i, 0, ['}', '}', token[2]]);