Check-in [a7aa84dacb]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added documentation comments for whitespace and numeric parsers.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:a7aa84dacbcfd99ba18d3f0163f780740484f031
User & Date: CrosslandA 2016-10-11 18:04:03
Context
2016-10-11
18:04
Finished impementation of the desired parser, with english synonyms for operations. check-in: 8c24d05535 user: CrosslandA tags: trunk
18:04
Added documentation comments for whitespace and numeric parsers. check-in: a7aa84dacb user: CrosslandA tags: trunk
17:54
Finished wiring up button click handler. check-in: cebab67d2c user: CrosslandA tags: trunk
Changes

Changes to src/pcomb.ts.

242
243
244
245
246
247
248

249
250
251
252
253
254
255
...
259
260
261
262
263
264
265

266
267
268
269
270
271
272
            }
        }

        return result;
    };
}


export function numeric(outerAction?: ParserAction): Parser {
    return (input: ParserInput, output: ParserOutput, action?: ParserAction): ParseResult => {
        let inCopy = input.copy();
        let outCopy = output.copy();
        let result: ParseResult = [false, inCopy, outCopy];
        let cur: string = input.text.slice(0, 1);
        let curAsNum: number = Number(cur);
................................................................................
            result[2].matched.push(cur);
        }

        return result;
    };
}


export function whitespace(outerAction?: ParserAction): Parser {
    return (input: ParserInput, output: ParserOutput, action?: ParserAction): ParseResult => {
        let result: ParseResult = [false, input.copy(), output.copy()];

        if (input.text.length > 0) {
            let cur = input.text.slice(0, 1);
            if (" \t\n\r\v".indexOf(cur) > -1) {







>







 







>







242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
...
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
            }
        }

        return result;
    };
}

/** Match a single numeric character. */
export function numeric(outerAction?: ParserAction): Parser {
    return (input: ParserInput, output: ParserOutput, action?: ParserAction): ParseResult => {
        let inCopy = input.copy();
        let outCopy = output.copy();
        let result: ParseResult = [false, inCopy, outCopy];
        let cur: string = input.text.slice(0, 1);
        let curAsNum: number = Number(cur);
................................................................................
            result[2].matched.push(cur);
        }

        return result;
    };
}

/** Match a single whitespace character. */
export function whitespace(outerAction?: ParserAction): Parser {
    return (input: ParserInput, output: ParserOutput, action?: ParserAction): ParseResult => {
        let result: ParseResult = [false, input.copy(), output.copy()];

        if (input.text.length > 0) {
            let cur = input.text.slice(0, 1);
            if (" \t\n\r\v".indexOf(cur) > -1) {