From 0151cd4f2ea5269d345db1643df01275b6e09f39 Mon Sep 17 00:00:00 2001 From: Sauyon Lee Date: Thu, 23 Sep 2021 11:24:38 -0700 Subject: [PATCH] Document SourceOrSinkElement --- .../semmle/go/dataflow/internal/FlowSummaryImplSpecific.qll | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ql/lib/semmle/go/dataflow/internal/FlowSummaryImplSpecific.qll b/ql/lib/semmle/go/dataflow/internal/FlowSummaryImplSpecific.qll index 73f2c9ac9e0..f790bc30f21 100644 --- a/ql/lib/semmle/go/dataflow/internal/FlowSummaryImplSpecific.qll +++ b/ql/lib/semmle/go/dataflow/internal/FlowSummaryImplSpecific.qll @@ -66,11 +66,15 @@ private newtype TSourceOrSinkElement = TEntityElement(Entity e) or TAstElement(AstNode n) +/** An element representable by CSV modeling. */ class SourceOrSinkElement extends TSourceOrSinkElement { + /** Gets this source or sink element as an entity, if it is one. */ Entity asEntity() { this = TEntityElement(result) } + /** Gets this source or sink element as an AST node, if it is one. */ AstNode asAstNode() { this = TAstElement(result) } + /** Gets a textual representation of this source or sink element. */ string toString() { result = "element representing " + [this.asEntity().toString(), this.asAstNode().toString()] }