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


TypeScript patterns.chunk函数代码示例

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


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

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

示例4: zeroOrMore

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

// [ \t\r\n]*


export = {
    isToken: true,

    isIgnore: true,

    name: 'whitespace',

    body: [
        zeroOrMore(anyOf(
            chunk(' \t\r\n')
        ))
    ]
}
开发者ID:valaxy,项目名称:robotframework-parser,代码行数:18,代码来源:whitespace.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: '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

示例6: chunk

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

export = {
    isToken: true,

    isIgnore: false,

    name: 'endLine',

    body: [
        chunk('\n')
    ]
}
开发者ID:valaxy,项目名称:robotframework-parser,代码行数:13,代码来源:endLine.ts


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