cloudflare/pint

Public

mirrored from https://github.com/cloudflare/pintAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.40.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

internal/parser/utils/binary_expr.go

21lines · modeblame

d292a71cLukasz Mierzwa4 years ago1package utils
2
3import (
4promParser "github.com/prometheus/prometheus/promql/parser"
5
6"github.com/cloudflare/pint/internal/parser"
7)
8
9func HasOuterBinaryExpr(node *parser.PromQLNode) *promParser.BinaryExpr {
10if n, ok := node.Node.(*promParser.BinaryExpr); ok {
11return n
12}
13
14for _, child := range node.Children {
15if be := HasOuterBinaryExpr(child); be != nil {
16return be
17}
18}
19
20return nil
21}