From 3c6c7c9bac80cc5d3673f7652b9180e14d45cf9a Mon Sep 17 00:00:00 2001 From: "Iskander (Alex) Sharipov" Date: Tue, 22 Mar 2022 20:44:38 +0300 Subject: [PATCH] dsl: add SinkType (#383) --- dsl/dsl.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dsl/dsl.go b/dsl/dsl.go index 29d62c4..bdfb593 100644 --- a/dsl/dsl.go +++ b/dsl/dsl.go @@ -141,6 +141,8 @@ type Var struct { // `$x` m["x"].Type is `a.b()` function call result type Type ExprType + SinkType SinkType + // Object is an associated "go/types" Object. Object TypesObject @@ -211,6 +213,12 @@ func (TypesObject) Is(typ string) bool { return boolResult } // IsGlobal reports whether an associated types.Object is defined in global scope. func (TypesObject) IsGlobal() bool { return boolResult } +type SinkType struct{} + +// Is reports whether a type is identical to a given type. +// Works like ExprType.Is method. +func (SinkType) Is(typ string) bool { return boolResult } + // ExprType describes a type of a matcher expr. type ExprType struct { // Size represents expression type size in bytes.