...

Source file src/go.einride.tech/aip/filtering/parsedexpr.go

Documentation: go.einride.tech/aip/filtering

     1  package filtering
     2  
     3  import expr "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
     4  
     5  func parsedFloat(id int64, value float64) *expr.Expr {
     6  	result := Float(value)
     7  	result.Id = id
     8  	return result
     9  }
    10  
    11  func parsedInt(id, value int64) *expr.Expr {
    12  	result := Int(value)
    13  	result.Id = id
    14  	return result
    15  }
    16  
    17  func parsedText(id int64, s string) *expr.Expr {
    18  	result := Text(s)
    19  	result.Id = id
    20  	return result
    21  }
    22  
    23  func parsedString(id int64, s string) *expr.Expr {
    24  	result := String(s)
    25  	result.Id = id
    26  	return result
    27  }
    28  
    29  func parsedExpression(id int64, sequences ...*expr.Expr) *expr.Expr {
    30  	result := Expression(sequences...)
    31  	result.Id = id
    32  	return result
    33  }
    34  
    35  func parsedSequence(id int64, factor1, factor2 *expr.Expr) *expr.Expr {
    36  	return parsedFunction(id, FunctionFuzzyAnd, factor1, factor2)
    37  }
    38  
    39  func parsedFactor(id int64, term1, term2 *expr.Expr) *expr.Expr {
    40  	result := Or(term1, term2)
    41  	result.Id = id
    42  	return result
    43  }
    44  
    45  func parsedMember(id int64, operand *expr.Expr, field string) *expr.Expr {
    46  	result := Member(operand, field)
    47  	result.Id = id
    48  	return result
    49  }
    50  
    51  func parsedFunction(id int64, name string, args ...*expr.Expr) *expr.Expr {
    52  	result := Function(name, args...)
    53  	result.Id = id
    54  	return result
    55  }
    56  

View as plain text