本文整理汇总了TypeScript中pegjs-builder/lib/peg/patterns.zeroOrMore函数的典型用法代码示例。如果您正苦于以下问题:TypeScript zeroOrMore函数的具体用法?TypeScript zeroOrMore怎么用?TypeScript zeroOrMore使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zeroOrMore函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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')
)
]
}
示例2: 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('_')
)))
))
)
]
}
示例3: 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')
))
)
]
}
示例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')
))
]
}
示例5: 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')
)
)
]
}
示例6: 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')
))
)
)
]
}