From 440cd340a5231e2d3498006f46004058b05af1f8 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Thu, 17 Jul 2014 12:02:07 -0700 Subject: [PATCH] Split Block: Add a character option for clarity This also allows the split block to be used more easily in a HOF --- blocks.js | 1 + threads.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/blocks.js b/blocks.js index 61d8b017..fb47993f 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 50abf781..3b7074e5 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(); }