From 065cba041571511480d5f79ee25ca61393b17136 Mon Sep 17 00:00:00 2001 From: Harsh Singh Date: Sat, 8 Nov 2014 22:45:07 -0600 Subject: [PATCH] Fixes extra space error for )( and ?= Fixes https://github.com/derekchiang/Coffee-Formatter/issues/4 --- src/formatter.litcoffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/formatter.litcoffee b/src/formatter.litcoffee index 9e44ad6..3e9f34c 100644 --- a/src/formatter.litcoffee +++ b/src/formatter.litcoffee @@ -34,7 +34,7 @@ We define a set of constants, including: Two-space operators. These operators should have one space both before and after. - TWO_SPACE_OPERATORS = ['=', '+=', '-=', '==', '<=', '>=', + TWO_SPACE_OPERATORS = ['?=", '=', '+=', '-=', '==', '<=', '>=', '>', "<", '+', '-', '*', '/'] One-space operators. They should have one space after. @@ -132,6 +132,7 @@ Another exception: `if (options = arguments[i])?` And also ")," ")." ")[" and "))" shouldn't be separated by space: (thisCharAndNextOne isnt "),") and + (thisCharAndNextOne isnt ")(") and (thisCharAndNextOne isnt ").") and (thisCharAndNextOne isnt ")[") and (thisCharAndNextOne isnt "))") @@ -239,4 +240,4 @@ The following exports are for testing only and should be commented out in produc exports.shortenSpaces = shortenSpaces exports.formatTwoSpaceOperator = formatTwoSpaceOperator exports.notInStringOrComment = notInStringOrComment - exports.formatOneSpaceOperator = formatOneSpaceOperator \ No newline at end of file + exports.formatOneSpaceOperator = formatOneSpaceOperator