summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-08-01 11:49:35 +0200
committerjmoenig <jens@moenig.org>2013-08-01 11:49:35 +0200
commit8dde1684f146457b9b6dd054f2e1a99a3d59cce7 (patch)
treee5d5a4c8cdce0ef95e68f62b7f87731144dbf21e
parent6fa1fcd87637cae8f0ad76951b7b389db6bfa969 (diff)
downloadsnap-byow-8dde1684f146457b9b6dd054f2e1a99a3d59cce7.tar.gz
snap-byow-8dde1684f146457b9b6dd054f2e1a99a3d59cce7.zip
"whitespace" & other options in SPLIT reporter's dropdown
still hidden in dev mode
-rw-r--r--blocks.js7
-rwxr-xr-xhistory.txt4
-rw-r--r--threads.js17
3 files changed, 22 insertions, 6 deletions
diff --git a/blocks.js b/blocks.js
index d58474e..74c3574 100644
--- a/blocks.js
+++ b/blocks.js
@@ -155,7 +155,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.blocks = '2013-July-31';
+modules.blocks = '2013-August-01';
var SyntaxElementMorph;
var BlockMorph;
@@ -798,7 +798,10 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
null, // text
false, // numeric?
{
- '--line--' : ['--line--']
+ 'whitespace' : ['whitespace'],
+ 'line' : ['line'],
+ 'tab' : ['tab'],
+ 'cr' : ['cr']
},
false // read-only
);
diff --git a/history.txt b/history.txt
index f60dd59..5fd3680 100755
--- a/history.txt
+++ b/history.txt
@@ -1833,3 +1833,7 @@ ______
130731
------
* Blocks, Threads, Objects: experimental text SPLIT primitive in the operators category
+
+130801
+------
+* Blocks, Threads: "whitespace" & other options in SPLIT reporter's dropdown
diff --git a/threads.js b/threads.js
index 6b73164..a6ab70e 100644
--- a/threads.js
+++ b/threads.js
@@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/
// Global stuff ////////////////////////////////////////////////////////
-modules.threads = '2013-July-31';
+modules.threads = '2013-August-01';
var ThreadManager;
var Process;
@@ -2003,10 +2003,19 @@ Process.prototype.reportUnicodeAsLetter = function (num) {
Process.prototype.reportTextSplit = function (string, delimiter) {
var str = (string || '').toString(),
del;
-
- if (this.inputOption(delimiter) === '--line--') {
+ switch (this.inputOption(delimiter)) {
+ case 'line':
del = '\n';
- } else {
+ break;
+ case 'tab':
+ del = '\t';
+ break;
+ case 'cr':
+ del = '\r';
+ break;
+ case 'whitespace':
+ return new List(str.trim().split(/[\t\r\n ]+/));
+ default:
del = (delimiter || '').toString();
}
return new List(str.split(del));