annotators

package
v0.3.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

This file contains an example annotator that attaches metadata to Bad nodes The metadata is a simple counter that is attached to each Bad node

All the functionality in this file is for demonstration purposes only

Index

Constants

View Source
const ConstFuncParamMetaKind ast.MetadataKind = "ConstFuncParam"

Variables

This section is empty.

Functions

This section is empty.

Types

type BadAnnotator

type BadAnnotator struct {
	ast.BaseVisitor // provides useful utilities, like getting the current module
	// contains filtered or unexported fields
}

example annotator

func (*BadAnnotator) VisitBadDecl

func (a *BadAnnotator) VisitBadDecl(b *ast.BadDecl) ast.VisitResult

func (*BadAnnotator) VisitBadExpr

func (a *BadAnnotator) VisitBadExpr(b *ast.BadExpr) ast.VisitResult

func (*BadAnnotator) VisitBadStmt

func (a *BadAnnotator) VisitBadStmt(b *ast.BadStmt) ast.VisitResult

type BadMeta

type BadMeta struct {
	// contains filtered or unexported fields
}

example metadata

func (*BadMeta) Kind

func (m *BadMeta) Kind() ast.MetadataKind

func (*BadMeta) String

func (m *BadMeta) String() string

type ConstFuncParamAnnotator

type ConstFuncParamAnnotator struct {
	ast.BaseVisitor
	// contains filtered or unexported fields
}

func (*ConstFuncParamAnnotator) ShouldVisit

func (a *ConstFuncParamAnnotator) ShouldVisit(node ast.Node) bool

func (*ConstFuncParamAnnotator) VisitAssignStmt

func (a *ConstFuncParamAnnotator) VisitAssignStmt(stmt *ast.AssignStmt) ast.VisitResult

func (*ConstFuncParamAnnotator) VisitFuncCall

func (a *ConstFuncParamAnnotator) VisitFuncCall(call *ast.FuncCall) ast.VisitResult

func (*ConstFuncParamAnnotator) VisitFuncDecl

func (a *ConstFuncParamAnnotator) VisitFuncDecl(decl *ast.FuncDecl) ast.VisitResult

type ConstFuncParamMeta

type ConstFuncParamMeta struct {
	// wether each parameter is const
	IsConst map[string]bool
}

func (ConstFuncParamMeta) Kind

func (ConstFuncParamMeta) String

func (m ConstFuncParamMeta) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL