MCPcopy
hub / github.com/rgburke/grv / ConvertTypes

Method ConvertTypes

cmd/grv/expression_processor.go:358–380  ·  view source on GitHub ↗

ConvertTypes defers the call to the child expressions if they're logical Otherwise performs type conversion on the child expressions if necessary

(fieldTypeDescriptor FieldTypeDescriptor)

Source from the content-addressed store, hash-verified

356// ConvertTypes defers the call to the child expressions if they're logical
357// Otherwise performs type conversion on the child expressions if necessary
358func (binaryExpression *BinaryExpression) ConvertTypes(fieldTypeDescriptor FieldTypeDescriptor) (errors []error) {
359 if !binaryExpression.IsComparison() {
360 if logicalExpression, ok := binaryExpression.lhs.(LogicalExpression); ok {
361 errors = append(errors, logicalExpression.ConvertTypes(fieldTypeDescriptor)...)
362 }
363
364 if logicalExpression, ok := binaryExpression.rhs.(LogicalExpression); ok {
365 errors = append(errors, logicalExpression.ConvertTypes(fieldTypeDescriptor)...)
366 }
367
368 return
369 }
370
371 if err := binaryExpression.processDateComparison(fieldTypeDescriptor); err != nil {
372 errors = append(errors, err)
373 } else if err := binaryExpression.processGlobComparison(fieldTypeDescriptor); err != nil {
374 errors = append(errors, err)
375 } else if err := binaryExpression.processRegexComparison(fieldTypeDescriptor); err != nil {
376 errors = append(errors, err)
377 }
378
379 return
380}
381
382func (binaryExpression *BinaryExpression) processDateComparison(fieldTypeDescriptor FieldTypeDescriptor) (err error) {
383 isDateComparison, dateString, datePtr := binaryExpression.isDateComparison(fieldTypeDescriptor)

Callers

nothing calls this directly

Calls 5

IsComparisonMethod · 0.95
processDateComparisonMethod · 0.95
processGlobComparisonMethod · 0.95
ConvertTypesMethod · 0.65

Tested by

no test coverage detected