From 440cd340a5231e2d3498006f46004058b05af1f8 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Thu, 17 Jul 2014 12:02:07 -0700 Subject: 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 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(); } -- cgit v1.3.1 From 80d1e25bee175a06c9379aeff020054b3acb752c Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Thu, 17 Jul 2014 12:08:30 -0700 Subject: Lint: fix missing semicolon --- threads.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threads.js b/threads.js index 3b7074e..24d4196 100644 --- a/threads.js +++ b/threads.js @@ -2150,7 +2150,7 @@ Process.prototype.reportTextSplit = function (string, delimiter) { return new List(str.trim().split(/[\t\r\n ]+/)); case 'character': del = ''; - break + break; default: del = (delimiter || '').toString(); } -- cgit v1.3.1