Documentation ¶
Overview ¶
Package analyzer implements source code static semantic analysis. It's important to keep errors as human-readable as possible because they are what end-user is facing when something goes wrong.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrModuleWithoutPkgs = errors.New("Module must contain at least one package") ErrEntryModNotFound = errors.New("Entry module is not found") ErrMainPkgNotFound = errors.New("Main package not found") ErrPkgWithoutFiles = errors.New("Package must contain at least one file") ErrUnknownEntityKind = errors.New("Entity kind can only be either flow, interface, type of constant") ErrCompilerVersion = errors.New("Incompatible compiler version") ErrDepModWithoutVersion = errors.New("Every dependency module must have version") )
View Source
var ( ErrNodeWrongEntity = errors.New("Node can only refer to flows or interfaces") ErrNodeTypeArgsMissing = errors.New("Not enough type arguments") ErrNodeTypeArgsTooMuch = errors.New("Too much type arguments") ErrNonFlowNodeWithDI = errors.New("Only flow node can have dependency injection") ErrUnusedNode = errors.New("Unused node found") ErrUnusedNodeInport = errors.New("Unused node inport") ErrUnusedNodeOutports = errors.New("All node's outports are unused") ErrSenderIsEmpty = errors.New("Sender in network must contain port address, constant reference or message literal") ErrReadSelfOut = errors.New("Flow cannot read from self outport") ErrWriteSelfIn = errors.New("Flow cannot write to self inport") ErrInportNotFound = errors.New("Referenced inport not found in flow's interface") ErrOutportNotFound = errors.New( "Referenced inport not found in flow's interface", ) ErrNodeNotFound = errors.New("Referenced node not found") ErrNormCompWithExtern = errors.New("Flow with nodes or network cannot use #extern directive") ErrNormFlowWithoutNet = errors.New("Flow must have network except it uses #extern directive") ErrNormNodeBind = errors.New("Node can't use #bind if it isn't instantiated with the flow that use #extern") ErrInterfaceNodeBindDirective = errors.New("Interface node cannot use #bind directive") ErrExternNoArgs = errors.New("Flow that use #extern directive must provide at least one argument") ErrBindDirectiveArgs = errors.New("Node with #bind directive must provide exactly one argument") ErrExternOverloadingArg = errors.New("Flow that use #extern with more than one argument must provide arguments in a form of <type, flow_ref> pairs") ErrExternOverloadingNodeArgs = errors.New("Node instantiated with flow with #extern with > 1 argument, must have exactly one type-argument for overloading") )
View Source
var ( ErrUnusedOutports = errors.New("All flow's outports are unused") ErrUnusedOutport = errors.New("Unused outport found") ErrUnusedInports = errors.New("All flow inports are unused") ErrUnusedInport = errors.New("Unused inport found") ErrLiteralSenderTypeEmpty = errors.New("Literal network sender must contain message value") ErrComplexLiteralSender = errors.New("Literal network sender must have primitive type") ErrIllegalPortlessConnection = errors.New("Connection to a node, with more than one port, must always has a port name") ErrGuardMixedWithExplicitErrConn = errors.New("If node has error guard '?' it's ':err' outport must not be explicitly used in the network") )
View Source
var ( ErrAutoPortsArgNonStruct = errors.New("Type argument for flow with struct inports directive must be struct") ErrAutoPortsNodeTypeArgsCount = errors.New("Note that uses flow with struct inports directive must pass exactly one type argument") ErrAutoPortsTypeParamConstr = errors.New("Flow that uses struct inports directive must have type parameter with struct constraint") ErrAutoPortsTypeParamsCount = errors.New("Flow that uses struct inports directive must have type parameter with have exactly one type parameter") ErrNormalInportsWithAutoPortsDirective = errors.New("Flow that uses struct inports directive must have no defined inports") ErrGuardNotAllowedForNode = errors.New("Guard is not allowed for nodes without 'err' output") ErrGuardNotAllowedForFlow = errors.New("Guard is not allowed for flows without 'err' output") )
View Source
var ( ErrEmptyConst = errors.New("Constant must either have value or reference to another constant") ErrEntityNotConst = errors.New("Constant refers to an entity that is not constant") ErrResolveConstType = errors.New("Cannot resolve constant type") ErrUnionConst = errors.New("Constant cannot have type union") ErrConstSeveralValues = errors.New("Constant cannot have several values at once") )
View Source
var ( ErrInterfaceTypeParams = errors.New("Cannot resolve interface type parameters") ErrEmptyInports = errors.New("Interface must have inports") ErrEmptyOutports = errors.New("Interface must have outports") ErrInvalidInports = errors.New("Inports are invalid") ErrInvalidOutports = errors.New("Outports are invalid") )
View Source
var ( ErrMainFlowWithTypeParams = errors.New("Main flow cannot have type parameters") ErrEntityNotFoundByNodeRef = errors.New("Node references to entity that cannot be found") ErrMainFlowInportsCount = errors.New("Main flow must have exactly 1 inport") ErrMainFlowOutportsCount = errors.New("Main flow must have exactly 1 outport") ErrMainFlowWithoutEnterInport = errors.New("Main flow must have 'enter' inport") ErrMainFlowWithoutExitOutport = errors.New("Main flow must have 'exit' outport") ErrMainPortIsArray = errors.New("Main flow cannot have array ports") ErrMainFlowPortTypeNotAny = errors.New("Main flow's ports must be of type any") ErrMainNodeEntityNotFlow = errors.New("Main flow's nodes must only refer to flow entities") )
View Source
var ( ErrMainEntityNotFound = errors.New("Main entity is not found") ErrMainEntityIsNotFlow = errors.New("Main entity is not a flow") ErrMainEntityExported = errors.New("Main entity cannot be exported") ErrMainPkgExports = errors.New("Main package must cannot have exported entities") )
View Source
var ErrEmptyTypeDefBody = fmt.Errorf("Type definition must have non-empty body")
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶
type Analyzer struct {
// contains filtered or unexported fields
}
func (Analyzer) AnalyzeBuild ¶
Click to show internal directories.
Click to hide internal directories.