"whitespace" & other options in SPLIT reporter's dropdown

still hidden in dev mode
pull/3/merge
jmoenig 2013-08-01 11:49:35 +02:00
rodzic 6fa1fcd876
commit 8dde1684f1
3 zmienionych plików z 22 dodań i 6 usunięć

Wyświetl plik

@ -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
);

Wyświetl plik

@ -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

Wyświetl plik

@ -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));