Skip to content

Commit

Permalink
Lint fixes for various doc comments (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
TristonianJones committed Jul 6, 2022
1 parent c04cadc commit 12f6801
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cel/decls.go
Expand Up @@ -165,7 +165,7 @@ type Type struct {
isAssignableRuntimeType func(other ref.Type) bool
}

// IsAssignableFrom determines whether the current type is type-check assignable from the input fromType.
// IsAssignableType determines whether the current type is type-check assignable from the input fromType.
func (t *Type) IsAssignableType(fromType *Type) bool {
if t.isAssignableType != nil {
return t.isAssignableType(fromType)
Expand Down
4 changes: 4 additions & 0 deletions cel/env.go
Expand Up @@ -61,13 +61,17 @@ func (ast *Ast) SourceInfo() *exprpb.SourceInfo {

// ResultType returns the output type of the expression if the Ast has been type-checked, else
// returns decls.Dyn as the parse step cannot infer the type.
//
// Deprecated: use OutputType
func (ast *Ast) ResultType() *exprpb.Type {
if !ast.IsChecked() {
return decls.Dyn
}
return ast.typeMap[ast.expr.GetId()]
}

// OutputType returns the output type of the expression if the Ast has been type-checked, else
// returns cel.DynType as the parse step cannot infer types.
func (ast *Ast) OutputType() *Type {
t, err := ExprTypeToType(ast.ResultType())
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion cel/macro.go
Expand Up @@ -20,6 +20,10 @@ import (
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)

// Macro describes a function signature to match and the MacroExpander to apply.
//
// Note: when a Macro should apply to multiple overloads (based on arg count) of a given function,
// a Macro should be created per arg-count or as a var arg macro.
type Macro = parser.Macro

// MacroExpander converts a call and its associated arguments into a new CEL abstract syntax tree, or an error
Expand Down Expand Up @@ -85,7 +89,7 @@ func MapMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.E
return parser.MakeMap(meh, target, args)
}

// MakeFilter expands the input call arguments into a comprehension which produces a list which contains
// FilterMacroExpander expands the input call arguments into a comprehension which produces a list which contains
// only elements which match the provided predicate expression:
// <iterRange>.filter(<iterVar>, <predicate>)
func FilterMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
Expand Down
2 changes: 1 addition & 1 deletion parser/macro.go
Expand Up @@ -284,7 +284,7 @@ const (
quantifierExistsOne
)

// MakeExists expands the input call arguments into a comprehension that returns true if all of the
// MakeAll expands the input call arguments into a comprehension that returns true if all of the
// elements in the range match the predicate expressions:
// <iterRange>.all(<iterVar>, <predicate>)
func MakeAll(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
Expand Down

0 comments on commit 12f6801

Please sign in to comment.