Check-in [3218c25782]

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

Overview
Comment:Added a goos documentation comment for the new exact combinator.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3218c25782131ddd7d2c8b518b2d0463c35973ca
User & Date: adamc 2016-10-29 02:10:57
Context
2016-11-08
04:12
[bb41cfce87] Added a TS version of John Resig's microtemplates and added in to the correct place in the demo app. Not working at the moment. Need to debug. check-in: 80a85d9c20 user: User tags: trunk
2016-10-29
02:10
Added a goos documentation comment for the new exact combinator. check-in: 3218c25782 user: adamc tags: trunk
02:01
[be7c6de0ec] Finally found the way to make the tasks run serially, with help from https://github.com/gulpjs/gulp/issues/67 check-in: d2b04b8e10 user: adamc tags: trunk
Changes

Changes to src/pcomb.ts.

241
242
243
244
245
246
247






248
249
250
251
252
253
254
            result[2] = applyOutput;
        }

        return result;
    };
}







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

        if (result[0]) {
            if (result[1].text.length > 0) {
                result[0] = false;







>
>
>
>
>
>







241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
            result[2] = applyOutput;
        }

        return result;
    };
}

/** Run the given parser, and if it succeeds, check to see if the parsing consumed
 *  the entire available input. If not, fail.
 * Normally, parsing is lazy; that is, it can succeed even if there is unconsumed
 * input left. The exact combinator requires that all input be consumed by a 
 * successful parse.
 */
export function exact(toParser: Parser, outerAction: ParserAction) {
    return (input: ParserInput, output: ParserOutput, action?: ParserAction): ParseResult => {
        let result = toParser(input.copy(), output.copy(), action);

        if (result[0]) {
            if (result[1].text.length > 0) {
                result[0] = false;