Permalink
Browse files

added enhancement for issue #12

  • Loading branch information...
1 parent d3d01a6 commit 99ef1737e67e95c268b7afd0d676fc5028403ec5 @joshbtn committed Oct 14, 2012
Showing with 37 additions and 8 deletions.
  1. +27 −4 .gitignore
  2. +10 −4 src/ExcelFormulaUtilities.js
View
@@ -1,5 +1,28 @@
-<<<<<<< HEAD
-node_modules
-=======
.c9revisions
->>>>>>> rangeHandler
+
+*.pydevproject
+.project
+.metadata
+bin/**
+tmp/**
+tmp/**/*
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.classpath
+.settings/
+.loadpath
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# CDT-specific
+.cproject
+
+# PDT-specific
+.buildpath
@@ -827,7 +827,7 @@
var formatFormula = excelFormulaUtilities.formatFormula = function (formula, options) {
var isFirstToken = true,
defaultOptions = {
- tmplFunctionStart: '{{autoindent}}{{token}}\n{{autoindent}}(\n',
+ tmplFunctionStart: '{{autoindent}}{{token}}(\n',
tmplFunctionStop: '\n{{autoindent}}{{token}})',
tmplOperandError: '{{token}}',
tmplOperandRange: '{{autoindent}}{{token}}',
@@ -846,7 +846,9 @@
autoLineBreak: 'TOK_TYPE_FUNCTION | TOK_TYPE_ARGUMENT | TOK_SUBTYPE_LOGICAL | TOK_TYPE_OP_IN ',
newLine: '\n',
trim: true,
- customTokenRender: null
+ customTokenRender: null,
+ prefix: "=",
+ postfix: ""
};
if (options) {
@@ -912,8 +914,12 @@
isNewLine = autoBreak || matchEndNewLine.test(outputFormula);
isFirstToken = false;
}
-
- return options.trim ? trim(outputFormula) : outputFormula;
+
+ outputFormula = options.prefix + outputFormula + options.postfix;
+
+ return options.trim ?
+ trim(outputFormula) :
+ outputFormula;
};
/**
* This function calls {@link excelFormulaUtilities.parser.formatFormula}

0 comments on commit 99ef173

Please sign in to comment.