lib/parser.js
function splitCommand(line) {
    // Make sure we get the same results irrespective of leading/trailing spaces
    var match = line.match(TOKEN_WHITESPACE);
    if (!match) {
        return {
            name: line.toUpperCase(),
            rest: ''
        };
    }
    var name = line.substr(0, match.index).toUpperCase();
    var rest = line.substr(match.index + match[0].length);

    return {
        name: name,
        rest: rest
    };
}
function splitCommand(line) {
    // Make sure we get the same results irrespective of leading/trailing spaces
    var match = line.match(TOKEN_WHITESPACE);
    if (!match) {
        return {
            name: line.toUpperCase(),
            rest: ''
        };
    }
    var name = line.substr(0, match.index).toUpperCase();
    var rest = line.substr(match.index + match[0].length);

    return {
        name: name,
        rest: rest
    };
}
function splitCommand ( line ) { // Make sure we get the same results irrespective of leading/trailing spaces var match = line . match ( TOKEN_WHITESPACE ) ; if ( ! match ) { return { name : line . toUpperCase ( ) , rest : '' } ; } var name = line . substr ( 0 , match . index ) . toUpperCase ( ) ; var rest = line . substr ( match . index + match [ 0 ] . length ) ; return { name : name , rest : rest } ; }
Takes a single line of text and parses out the cmd and rest, which are used for dispatching to more exact parsing functions.
Takes a single line of text and parses out the cmd and rest which are used for dispatching to more exact parsing functions .