本文整理匯總了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')
)
]
}
示例2: function
let expandPatternForToken = function (pattern:Pattern) {
return sequence(
pattern,
optional(subRule('whitespace'))
)
}
示例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')
)
)
]
}
示例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')
)
]
}
示例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')
))
)
)
]
}