本文整理汇总了Golang中github.com/elves/elvish/parse.Compound类的典型用法代码示例。如果您正苦于以下问题:Golang Compound类的具体用法?Golang Compound怎么用?Golang Compound使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Compound类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: mustPrimary
func mustPrimary(cp *compiler, cn *parse.Compound, msg string) *parse.Primary {
p := onePrimary(cn)
if p == nil {
cp.errorpf(cn.Begin(), cn.End(), msg)
}
return p
}
开发者ID:zhsj,项目名称:elvish,代码行数:7,代码来源:must.go
示例2: mustString
// mustString musts that a Compound contains exactly one Primary of type
// Variable.
func mustString(cp *compiler, cn *parse.Compound, msg string) string {
s, ok := oneString(cn)
if !ok {
cp.errorpf(cn.Begin(), cn.End(), msg)
}
return s
}
开发者ID:zhsj,项目名称:elvish,代码行数:9,代码来源:must.go
示例3: formHead
func (s *Stylist) formHead(n *parse.Compound) {
simple, head, err := simpleCompound(n, nil)
st := styles{}
if simple {
if goodFormHead(head, s.editor) {
st = styleForGoodCommand
} else {
st = styleForBadCommand
}
} else if err != nil {
st = styleForBadCommand
}
if len(st) > 0 {
s.add(st.String(), n.Begin(), n.End())
}
}
开发者ID:elves,项目名称:elvish,代码行数:16,代码来源:stylist.go
示例4: compoundOp
func (cp *compiler) compoundOp(n *parse.Compound) ValuesOp {
return ValuesOp{cp.compound(n), n.Begin(), n.End()}
}
开发者ID:zhsj,项目名称:elvish,代码行数:3,代码来源:boilerplate.go
示例5: isFormHead
func isFormHead(compound *parse.Compound) bool {
if form, ok := compound.Parent().(*parse.Form); ok {
return form.Head == compound
}
return false
}
开发者ID:zhsj,项目名称:elvish,代码行数:6,代码来源:nodeutil.go
注:本文中的github.com/elves/elvish/parse.Compound类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论