kopia lustrzana https://github.com/backface/turtlestitch
"whitespace" & other options in SPLIT reporter's dropdown
still hidden in dev modepull/3/merge
rodzic
6fa1fcd876
commit
8dde1684f1
|
@ -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
|
||||
);
|
||||
|
|
|
@ -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
|
||||
|
|
17
threads.js
17
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));
|
||||
|
|
Ładowanie…
Reference in New Issue