Skip to content

Commit

Permalink
fixed subexpressions formatting for formatFormula
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbtn committed Oct 25, 2012
1 parent 574390b commit 5c0338b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
9 changes: 5 additions & 4 deletions excelFormulaUtilities-0.9.4.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@
* http://jquery.org/license
*
* Based on Ewbi's Go Calc Prototype Excel Formula Parser. [http://ewbi.blogs.com/develops/2004/12/excel_formula_p.html]
*/ (function () {
*/
(function () {
if (typeof window === 'undefined') {
window = root;
}
Expand Down Expand Up @@ -1002,7 +1003,7 @@
var formatFormula = excelFormulaUtilities.formatFormula = function (formula, options) {
var isFirstToken = true,
defaultOptions = {
tmplFunctionStart: '\n{{autoindent}}{{token}}(\n',
tmplFunctionStart: '{{autoindent}}{{token}}(\n',
tmplFunctionStop: '\n{{autoindent}}{{token}})',
tmplOperandError: ' {{token}}',
tmplOperandRange: '{{autoindent}}{{token}}',
Expand All @@ -1014,8 +1015,8 @@
tmplFunctionStartArrayRow: '{',
tmplFunctionStopArrayRow: '}',
tmplFunctionStopArray: '',
tmplSubexpressionStart: '{{autoindent}}(',
tmplSubexpressionStop: ' )',
tmplSubexpressionStart: '{{autoindent}}(\n',
tmplSubexpressionStop: '\n)',
tmplIndentTab: '\t',
tmplIndentSpace: ' ',
autoLineBreak: 'TOK_TYPE_FUNCTION | TOK_TYPE_ARGUMENT | TOK_SUBTYPE_LOGICAL | TOK_TYPE_OP_IN ',
Expand Down
4 changes: 2 additions & 2 deletions excelFormulaUtilities-0.9.4.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/ExcelFormulaUtilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@
var formatFormula = excelFormulaUtilities.formatFormula = function (formula, options) {
var isFirstToken = true,
defaultOptions = {
tmplFunctionStart: '\n{{autoindent}}{{token}}(\n',
tmplFunctionStart: '{{autoindent}}{{token}}(\n',
tmplFunctionStop: '\n{{autoindent}}{{token}})',
tmplOperandError: ' {{token}}',
tmplOperandRange: '{{autoindent}}{{token}}',
Expand All @@ -840,8 +840,8 @@
tmplFunctionStartArrayRow: '{',
tmplFunctionStopArrayRow: '}',
tmplFunctionStopArray: '',
tmplSubexpressionStart: '{{autoindent}}(',
tmplSubexpressionStop: ' )',
tmplSubexpressionStart: '{{autoindent}}(\n',
tmplSubexpressionStop: '\n)',
tmplIndentTab: '\t',
tmplIndentSpace: ' ',
autoLineBreak: 'TOK_TYPE_FUNCTION | TOK_TYPE_ARGUMENT | TOK_SUBTYPE_LOGICAL | TOK_TYPE_OP_IN ',
Expand Down
9 changes: 4 additions & 5 deletions test/dev.parse.debug.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</head>
<body>
<input type="text" id="txtInput" />

<button id="parse">parse</button>
<div id="results">

</div>
Expand All @@ -21,13 +21,12 @@
/*<![CDATA[*/
jQuery(function(){
var $input = $('#txtInput')
,$parse = $('#parse')
,$results = $('#results');



$input.bind('keyup', function(){

$parse.bind('click', function(){
window.excelFormulaUtilities.parseFormula('txtInput', 'results')
return false;
});
})
/*]]>*/
Expand Down

0 comments on commit 5c0338b

Please sign in to comment.