aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-10-27 22:12:02 -0700
committeralon@honor <none@none>2010-10-27 22:12:02 -0700
commit4b48a792ec61ce5b99c6eabf3b7b9f1e7f4afd8f (patch)
tree4b88210e14069791b83cd8c9a8a80cc86e936654 /src/parseTools.js
parent027d1d7ca694ef5128c03a1535235ec65cc87fac (diff)
modularize generated code
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 3e65a039..4d6ae564 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -469,3 +469,14 @@ function getActualLabelId(labelId) {
return labelId.split('|').slice(-1)[0];
}
+// Misc
+
+function indentify(text, indent) {
+ if (typeof indent === 'number') {
+ var len = indent;
+ indent = '';
+ for (var i = 0; i < len; i++) indent += ' ';
+ }
+ return text.split('\n').map(function(line) { return indent + line }).join('\n');
+}
+