diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-09-28 17:20:22 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-10-02 17:31:35 -0700 |
commit | 892ef7930627ebeb4011ba8a99eade5c425aa926 (patch) | |
tree | 74fa2716a260b9fe7f4691d77b988a9f3c7634d6 | |
parent | e04b4ef520ccf56116fc16401b26c5ad6026bbf4 (diff) |
remove unnecessary whitespace in branches
-rw-r--r-- | src/jsifier.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 96cb8d9a..7e793472 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -959,7 +959,7 @@ function JSify(data, functionsOnly, givenFunctions) { var parts = label.split('|'); var trueLabel = parts[1] || ''; var oldLabel = parts[2] || ''; - var labelSetting = oldLabel ? 'label = ' + getLabelId(oldLabel) + ';' + + var labelSetting = oldLabel ? 'label=' + getLabelId(oldLabel) + ';' + (SHOW_LABELS ? ' /* to: ' + getOriginalLabelId(cleanLabel(oldLabel)) + ' */' : '') : ''; // TODO: optimize away the setting if (label[1] == 'R') { if (label[2] == 'N') { // BRNOL: break, no label setting @@ -980,7 +980,7 @@ function JSify(data, functionsOnly, givenFunctions) { } } else { if (!labelIsVariable) label = getLabelId(label); - return pre + 'label = ' + label + ';' + (SHOW_LABELS ? ' /* to: ' + getOriginalLabelId(cleanLabel(label)) + ' */' : '') + ' break;'; + return pre + 'label=' + label + ';' + (SHOW_LABELS ? ' /* to: ' + getOriginalLabelId(cleanLabel(label)) + ' */' : '') + 'break;'; } } @@ -1062,10 +1062,10 @@ function JSify(data, functionsOnly, givenFunctions) { var labelTrue = (item.labelTrueJS = getPhiSetsForLabel(phiSets, item.labelTrue)) + makeBranch(item.labelTrue, item.currLabelId); var labelFalse = (item.labelFalseJS = getPhiSetsForLabel(phiSets, item.labelFalse)) + makeBranch(item.labelFalse, item.currLabelId); if (labelTrue == ';' && labelFalse == ';') return ';'; - var head = 'if (' + condition + ') { '; - var head2 = 'if (!(' + condition + ')) { '; - var else_ = ' } else { '; - var tail = ' }'; + var head = 'if(' + condition + '){'; + var head2 = 'if(!(' + condition + ')){'; + var else_ = '}else{'; + var tail = '}'; if (labelTrue == ';') { return head2 + labelFalse + tail; } else if (labelFalse == ';') { |