docs: function parseWords(rest) {
  	const S_inSpaces = 1;
  	const S_inWord   = 2;
  	const S_inQuote  = 3;
  
  	let words = [];
  	let phase = S_inSpaces;
  	let word = '';
  	let quote = '';
  	let blankOK = false;
  	let ch;
  	let pos;
  
  	for (pos = 0; pos <= rest.length; pos++) {
  		if (pos !== rest.length) {
  			ch = rest[pos];
  		}
  
  		if (phase === S_inSpaces) { // Looking for start of word
  			if (pos === rest.length) { // end of input
  				break;
  			}
  			if (isSpace(ch)) { // skip spaces
  				continue;
  			}
  			phase = S_inWord; // found it, fall thru
  		}
  		if ((phase === S_inWord || phase === S_inQuote) && (pos === rest.length)) {
  			if (blankOK || word.length > 0) {
  				words.push(word);
  			}
  			break;
  		}
  		if (phase === S_inWord) {
  			if (isSpace(ch)) {
  				phase = S_inSpaces;
  				if (blankOK || word.length > 0) {
  					words.push(word);
  				}
  				word = '';
  				blankOK = false;
  				continue;
  			}
  			if (ch === '\'' || ch === '"') {
  				quote = ch;
  				blankOK = true;
  				phase = S_inQuote;
  			}
  			if (ch === '\\') {
  				if (pos+1 === rest.length) {
  					continue; // just skip \ at end
  				}
  				// If we're not quoted and we see a \, then always just
  				// add \ plus the char to the word, even if the char
  				// is a quote.
  				word += ch;
  				pos++;
  				ch = rest[pos];
  			}
  			word += ch;
  			continue;
  		}
  		if (phase === S_inQuote) {
  			if (ch === quote) {
  				phase = S_inWord;
  			}
  			// \ is special except for ' quotes - can't escape anything for '
  			if (ch === '\\' && quote !== '\'') {
  				if (pos+1 === rest.length) {
  					phase = S_inWord;
  					continue; // just skip \ at end
  				}
  				word += ch;
  				pos++;
  				ch = rest[pos];
  			}
  			word += ch;
  		}
  	}
  
  	return words;
  }