當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript patterns.sequence函數代碼示例

本文整理匯總了TypeScript中pegjs-builder/lib/peg/patterns.sequence函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript sequence函數的具體用法?TypeScript sequence怎麽用?TypeScript sequence使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了sequence函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: sequence

import {chunk,any,rangeOf,anyOf,subRule,zeroOrMore,oneOrMore,optional,sequence,label, gather} from 'pegjs-builder/lib/peg/patterns'

export = {
    isToken: true,

    isIgnore: false,

    name: 'keyword',

    body: [
        sequence(
            oneOrMore(anyOf(
                rangeOf('a', 'z'),
                rangeOf('A', 'Z'),
                rangeOf('0', '9'),
                chunk('_')
            )),
            zeroOrMore(gather(sequence(
                chunk(' '),
                oneOrMore(anyOf(
                    rangeOf('a', 'z'),
                    rangeOf('A', 'Z'),
                    rangeOf('0', '9'),
                    chunk('_')
                )))
            ))
        )
    ]
}
開發者ID:valaxy,項目名稱:robotframework-parser,代碼行數:29,代碼來源:keyword.ts

示例2: sequence

import {chunk,any,rangeOf,anyOf,subRule,zeroOrMore,oneOrMore,optional,sequence,label,gather} from 'pegjs-builder/lib/peg/patterns'

export = {
    isToken: false,

    name: 'testFile',

    body: [
        sequence(
            zeroOrMore(gather(sequence(
                subRule('whitespace'),
                subRule('testCase')
            ))),
            subRule('whitespace')
        )
    ]
}
開發者ID:valaxy,項目名稱:robotframework-parser,代碼行數:17,代碼來源:testFile.ts

示例3: function

let expandPatternForToken = function (pattern:Pattern) {
    return sequence(
        pattern,
        optional(subRule('whitespace'))
    )
}
開發者ID:valaxy,項目名稱:robotframework-parser,代碼行數:6,代碼來源:buildSyntax.ts

示例4: sequence

import {chunk,any,rangeOf,anyOf,subRule,zeroOrMore,oneOrMore,optional,sequence,label} from 'pegjs-builder/lib/peg/patterns'

// ' ' ' ' [ \t]*
// '\t' [ \t]*

export = {
    isToken: true,

    isIgnore: false,

    name: 'seperator',

    body: [
        sequence(
            chunk(' '),
            chunk(' '),
            zeroOrMore(anyOf(
                chunk(' \t')
            ))
        ),
        sequence(
            chunk('\t'),
            zeroOrMore(anyOf(
                chunk(' \t')
            ))
        )
    ]
}
開發者ID:valaxy,項目名稱:robotframework-parser,代碼行數:28,代碼來源:seperator.ts

示例5: sequence

import {chunk,any,rangeOf,anyOf,subRule,zeroOrMore,oneOrMore,optional,sequence,label} from 'pegjs-builder/lib/peg/patterns'

// [a-zA-Z_][a-zA-Z0-9_ ]*

export = {
    isToken: true,

    isIgnore: false,

    name: 'testCaseName',

    body: [
        sequence(
            anyOf(
                rangeOf('a', 'z'),
                rangeOf('A', 'Z'),
                chunk('_')
            ),
            oneOrMore(anyOf(
                rangeOf('a', 'z'),
                rangeOf('A', 'Z'),
                rangeOf('0', '9'),
                chunk('_ ')
            ))
        )
    ]
}
開發者ID:valaxy,項目名稱:robotframework-parser,代碼行數:27,代碼來源:testCaseName.ts

示例6: sequence

import {chunk,any,rangeOf,anyOf,subRule,zeroOrMore,oneOrMore,optional,sequence,label} from 'pegjs-builder/lib/peg/patterns'

// [a-zA-Z_][a-zA-Z0-9_ ]*

export = {
    isToken: true,

    isIgnore: false,

    name: 'argument',

    body: [
        sequence(
            anyOf(
                rangeOf('a', 'z'),
                rangeOf('A', 'Z'),
                chunk('_')
            ),
            oneOrMore(anyOf(
                rangeOf('a', 'z'),
                rangeOf('A', 'Z'),
                rangeOf('0', '9'),
                chunk('_') // todo, argument不能包含空格嗎?
            ))
        )
    ]
}
開發者ID:valaxy,項目名稱:robotframework-parser,代碼行數:27,代碼來源:argument.ts

示例7: sequence

import {chunk,any,rangeOf,anyOf,subRule,zeroOrMore,oneOrMore,optional,sequence,label} from 'pegjs-builder/lib/peg/patterns'

// testCaseName endLine testCaseBody

export = {
    isToken: false,

    name: 'testCase',

    body: [
        sequence(
            subRule('testCaseName'),
            subRule('endLine'),
            subRule('testCaseBody')
        )
    ]
}
開發者ID:valaxy,項目名稱:robotframework-parser,代碼行數:17,代碼來源:testCase.ts

示例8: sequence

import {chunk,any,rangeOf,anyOf,subRule,zeroOrMore,oneOrMore,optional,sequence,label,gather} from 'pegjs-builder/lib/peg/patterns'

// testCaseCommand

export = {
    isToken: false,

    name: 'testCaseBody',

    body: [
        sequence(
            subRule('testCaseCommand'),
            zeroOrMore(gather(sequence(
                subRule('endLine'),
                subRule('testCaseCommand')
            ))),
            optional(
                subRule('endLine')
            )
        )
    ]
}
開發者ID:valaxy,項目名稱:robotframework-parser,代碼行數:22,代碼來源:testCaseBody.ts

示例9: sequence

import {chunk,any,rangeOf,anyOf,subRule,zeroOrMore,oneOrMore,optional,sequence,label,gather} from 'pegjs-builder/lib/peg/patterns'

// seperator keyword (seperator argument)*

export = {
    isToken: false,

    name: 'testCaseCommand',

    body: [
        sequence(
            subRule('seperator'),
            subRule('keyword'),
            zeroOrMore(
                gather(sequence(
                    subRule('seperator'),
                    subRule('argument')
                ))
            )
        )
    ]
}
開發者ID:valaxy,項目名稱:robotframework-parser,代碼行數:22,代碼來源:testCaseCommand.ts


注:本文中的pegjs-builder/lib/peg/patterns.sequence函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。