当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript patterns.subRule函数代码示例

本文整理汇总了TypeScript中pegjs-builder/lib/peg/patterns.subRule函数的典型用法代码示例。如果您正苦于以下问题:TypeScript subRule函数的具体用法?TypeScript subRule怎么用?TypeScript subRule使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了subRule函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: 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

示例2: function

let expandPatternForToken = function (pattern:Pattern) {
    return sequence(
        pattern,
        optional(subRule('whitespace'))
    )
}
开发者ID:valaxy,项目名称:robotframework-parser,代码行数:6,代码来源:buildSyntax.ts

示例3: 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

示例4: 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

示例5: 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.subRule函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。