summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Ball <cycomachead@gmail.com>2014-07-17 12:02:07 -0700
committerMichael Ball <cycomachead@gmail.com>2014-07-17 12:02:07 -0700
commit440cd340a5231e2d3498006f46004058b05af1f8 (patch)
tree1ad6e9e7feb634d4a7677ac81c4907336d3cfcff
parent4fa53772f5f60cb4e3a0a0c34ecf56836e2f13ca (diff)
downloadsnap-yow-440cd340a5231e2d3498006f46004058b05af1f8.tar.gz
snap-yow-440cd340a5231e2d3498006f46004058b05af1f8.zip
Split Block: Add a character option for clarity
This also allows the split block to be used more easily in a HOF
-rw-r--r--blocks.js1
-rw-r--r--threads.js3
2 files changed, 4 insertions, 0 deletions
diff --git a/blocks.js b/blocks.js
index 61d8b01..fb47993 100644
--- a/blocks.js
+++ b/blocks.js
@@ -836,6 +836,7 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
null, // text
false, // numeric?
{
+ 'character' : ['character'],
'whitespace' : ['whitespace'],
'line' : ['line'],
'tab' : ['tab'],
diff --git a/threads.js b/threads.js
index 50abf78..3b7074e 100644
--- a/threads.js
+++ b/threads.js
@@ -2148,6 +2148,9 @@ Process.prototype.reportTextSplit = function (string, delimiter) {
break;
case 'whitespace':
return new List(str.trim().split(/[\t\r\n ]+/));
+ case 'character':
+ del = '';
+ break
default:
del = (delimiter || '').toString();
}