Documentation
¶
Index ¶
- func ConfidenceForEvidence(base float64, evidence SemanticEvidence) (float64, bool)
- func DeclarationName(file *scanner.File, idx uint32) string
- func IsMapLikeReceiver(ctx *api.Context, expr uint32) bool
- func IsNullableExpression(ctx *api.Context, expr uint32) (bool, bool)
- func IsResolvedCall(ctx *api.Context, call uint32, fqNames ...string) bool
- func IsSupportedIsNullOrEmptyReceiver(ctx *api.Context, expr uint32) bool
- func MatchQualifiedReceiver(ctx *api.Context, call uint32, allowed ...string) bool
- func OracleCallTarget(ctx *api.Context, idx uint32) string
- func OracleCallTargetAnnotations(ctx *api.Context, idx uint32) []string
- func OracleCallTargetSuspend(ctx *api.Context, idx uint32) (bool, bool)
- func OracleDiagnosticsForFlatRange(ctx *api.Context, idx uint32) []oracle.Diagnostic
- func ReferenceName(file *scanner.File, idx uint32) string
- func SameDeclaration(ctx *api.Context, decl uint32, ref uint32) bool
- func SameEnclosingOwner(file *scanner.File, a uint32, b uint32) bool
- func SameFileDeclarationMatch(ctx *api.Context, decl uint32, ref uint32) bool
- type CallTarget
- type ConstValue
- type ExceptionHandler
- type NodeRef
- type PermissionGuard
- type SemanticEvidence
- type SymbolRef
- type TypeFact
- type TypeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfidenceForEvidence ¶
func ConfidenceForEvidence(base float64, evidence SemanticEvidence) (float64, bool)
ConfidenceForEvidence applies the shared policy for unresolved semantic data. Unresolved evidence is not actionable by default.
func DeclarationName ¶
DeclarationName returns the declared identifier for common declaration nodes.
func IsMapLikeReceiver ¶
IsMapLikeReceiver reports whether expr resolves to a Kotlin or Java map.
func IsNullableExpression ¶
IsNullableExpression reports nullability when the resolver can prove it.
func IsResolvedCall ¶
IsResolvedCall reports whether a call has a resolved callable target that matches one of the supplied fully-qualified names.
func IsSupportedIsNullOrEmptyReceiver ¶
IsSupportedIsNullOrEmptyReceiver reports whether expr is a string, collection, array, or map receiver supported by isNullOrEmpty.
func MatchQualifiedReceiver ¶
MatchQualifiedReceiver reports whether the call receiver resolves to or structurally names one of allowed.
func OracleCallTarget ¶
OracleCallTarget resolves the compiler-backed call target for a FlatNode.
func OracleCallTargetAnnotations ¶
OracleCallTargetAnnotations returns annotations on the resolved call target.
func OracleCallTargetSuspend ¶
OracleCallTargetSuspend resolves suspend-call evidence for a FlatNode.
func OracleDiagnosticsForFlatRange ¶
func OracleDiagnosticsForFlatRange(ctx *api.Context, idx uint32) []oracle.Diagnostic
OracleDiagnosticsForFlatRange returns compiler diagnostics inside a FlatNode.
func ReferenceName ¶
ReferenceName returns the terminal identifier for a reference-like node.
func SameDeclaration ¶
SameDeclaration reports whether ref structurally points at decl. Resolved data is preferred when available, with same-file declaration matching as the conservative fallback.
func SameEnclosingOwner ¶
SameEnclosingOwner reports whether both nodes belong to the same enclosing class/object/interface owner. Top-level nodes share owner 0.
Types ¶
type CallTarget ¶
type CallTarget struct {
CalleeName string
QualifiedName string
Receiver NodeRef
Arguments []NodeRef
Resolved bool
}
CallTarget is the rule-facing view of a Kotlin call expression.
func ResolveCallTarget ¶
func ResolveCallTarget(ctx *api.Context, call uint32) (CallTarget, bool)
ResolveCallTarget inspects a call expression structurally and, when the resolver wraps the Kotlin oracle, attaches the resolved callable target.
type ConstValue ¶
type ConstValue struct {
Kind string
Int64 int64
Float64 float64
String string
Bool bool
Resolved bool
}
ConstValue is a conservative constant value extracted from literal nodes or same-file constant declarations.
func EvalConst ¶
func EvalConst(ctx *api.Context, expr uint32) (ConstValue, bool)
EvalConst evaluates simple literal constants and same-file constant refs.
func EvalSameFileConst ¶
func EvalSameFileConst(ctx *api.Context, ref uint32) (ConstValue, bool)
EvalSameFileConst resolves a same-file val/const reference to a literal initializer when the declaration belongs to the same owner.
type ExceptionHandler ¶
ExceptionHandler records an enclosing catch handler.
func EnclosingCaughtExceptionHandlers ¶
func EnclosingCaughtExceptionHandlers(ctx *api.Context, call uint32) []ExceptionHandler
EnclosingCaughtExceptionHandlers returns enclosing catch handlers.
type PermissionGuard ¶
type PermissionGuard struct {
Node uint32
Permission ConstValue
Positive bool
}
PermissionGuard records an enclosing permission check.
func EnclosingPermissionGuards ¶
func EnclosingPermissionGuards(ctx *api.Context, call uint32) []PermissionGuard
EnclosingPermissionGuards returns obvious enclosing permission guards.
type SemanticEvidence ¶
type SemanticEvidence int
SemanticEvidence describes the strength of a rule's semantic proof.
const ( EvidenceResolved SemanticEvidence = iota EvidenceQualifiedReceiver EvidenceSameOwner EvidenceSameFileDeclaration EvidenceUnresolved )