bend-lint-api
Search uses release 0.2.0.0 · 174 definitions
Definitions (174)
- type QuantityProgram =======
- type SpanWhere something is: its file, and offsets in code points.
- type SyntaxWhat a syntax node is, as Bend's parser reads it: a declaration, a part of one, a term, or a pattern; with what only nodes of its kind have: the global name it declares or uses (`target`, as the check names it; an import's is the path of the file it loads), the binder it declares or a variable uses (numbered per top-level declaration), and its quantity as written (a `~` parameter's is Template).
- type TypeRefA type the checker holds: a handle, good in the check it came from.
- type RoleWhat a fact says of its node: the type its term has, or the type its binder declares (a parameter, field, pattern variable, lambda, forall or let binding).
- type FactWhat the checker found for a node of the source: what the fact says of it, the quantity (how often the term is demanded, or the binder's), for a binder of a parameter, lambda, let or case, how often its body uses it (the most of its checked copies; none for a parameter a match takes apart), and the type.
- type NodeA syntax node: what it is, its name as written, where the file writes it (none for what the parser adds), the nodes under it, in order, and the checker's facts on it, if a rule needs them.
- type SourceA file the check parsed: its path, its namespace in the check ("" for the checked file), its text, and its nodes: its imports, then its declarations, each constructor under its type.
- type Program
- type DeclarationA name a node declares, and the nodes that use it, in order.
- def Syntax.targetThe global name a node of this kind declares or uses, if any (an import's is the file it loads).
- def Syntax.usedThe global name a node of this kind uses, if it uses one.
- def Syntax.binderThe binder a node of this kind declares, or, for a variable, uses.
- def Syntax.declaresWhether a node of this kind declares a global name (Some{True{}}), a binder of its top-level declaration (Some{False{}}), or nothing (an import declares an alias, which Declarations below handles).
- def Node.syntax
- def Node.target"" for a node of a kind that names nothing.
- def Node.kids
- def Node.name"" for no node, as are the next two.
- def Node.span
- def Span.text
- def Name.namespaceThe namespace of a global name: what comes before its first ":", or "" for Base and the checked file's own names.
- def Node.is_bareWhether a parameter is written bare (`def f(x)`, filling a law): its quantity is the law's, which its node does not give.
- def Node.scrutinees.go
- def Node.scrutineesThe scrutinees of a match, in order: its nodes before its first case.
- def Node.boundThe binders of the pattern variables in `nodes`, patterns, and under them, onto `out`.
- type AboveA node above another: the node, and the place among its nodes (from 0) of the one on the way down.
- def Above.of
- def visit.go
- def visit`f(c, path, node)` for each node of `nodes` and under them, parents first, in order: `path` holds the nodes above the node, innermost first.
- def fold`f(c, node, s)` for each node of `nodes` and under them, parents first, in order, from `s`.
- def topThe top-level declaration a node is in: the outermost node above it, or the node itself.
- def calls
- def is_recursiveWhether a node is an application of the definition it is in, below `path`: a step of a loop, as Bend repeats work by recursion.
- def is_pairWhether an application's function is Pair: it builds a pair type (`A & B`), whose parts are types.
- def is_live.go
- def is_liveWhether a node below `path` is in live code: a definition's body, outside types: an annotation's type, an equality, a function or pair type, a type's arguments.
- def definitionsThe definitions of `nodes`, by the name the check gives them: read one with `Names.find`.
- def parameter.go
- def parameterWhere the parameter that declares `binder` is among `nodes`, a definition's, counting from 0.
- type SeverityRules =====
- def Severity.show
- def Severity.names
- type OperationAn edit a fix asks for: replace a span's text; rename what the declaration written at `at` declares, with each of its uses; or rename only its uses, to point them at a name the program declares already (to drop a duplicate import, say).
- type FixA way to fix a finding: what it does, and its operations, in any of the program's own files (not Base, nor a hub package).
- type Finding
- type Found
- def findingA finding at `span`, if `hit` and `span` is known.
- type ValueOptions =======
- type SpecWhat an option accepts: a whole number in a range, a flag, text (one of `choices`, unless there are none), or what one of `specs` accepts.
- type DeclaredAn option a rule declares: its name, its value when the config gives none, and what it accepts.
- def Value.numberAn option's value as a number, a flag or text; a value of another kind, or none, gives 0, False, "".
- def Value.flag
- def Value.text
- type ImportedWhat uses a file's imports: the nodes written with an alias's prefix (`U.two`, a fill `def U.law(x):`), by alias; and those that use Base: a global name with no namespace that the file does not declare (last first).
- type UsesWhat the declarations of a top-level declaration are read with: the program's files (one of them is what an import loads), the uses of global names in the files the declarations are read in, by name, the uses of the declaration's binders, by binder (each last first), and what uses its file's imports.
- def Uses.global.add
- def Uses.global
- def Uses.binder.add
- def Uses.binder
- def Imported.own.add
- def Imported.ownThe global names a file's own top-level declarations declare, as a set.
- def Imported.is_base
- def Imported.alias
- def Imported.add
- def Imported.of
- def Declarations.namespaceThe namespace of the file at `path`, as the check names it (`found`, once found): "" for Base, or a file the check did not parse.
- def Declarations.importedThe uses of an import, in order: of Base (`base`), or of its alias.
- def Declarations.bound
- def Declarations.declared
- def Declarations.nodeA node's declaration, if it declares a name, with its uses, onto `out`.
- def Declarations.tops
- def Declarations.files
- def Declarations.globals
- def Declarations.ofThe declarations of `files`, in order, with their uses in `files`; `sources` are the program's files.
- def Declarations.when
- def Source.is_own
- def Program.ownThe program's own files: not hub packages.
- type ParamA runtime parameter of a definition: its name, and its type as one name ("" if it is not one name).
- type DefA definition of the program: its name as the check names it, its runtime parameters, whether it forks, the definitions it calls by name, and the type it returns, as one name ("" if it is not one name).
- def type_nameThe type the first of `nodes` writes, as one name, or "" for another form (an application, a list).
- def Quantity.is_runtimeWhether a parameter of this quantity is there at run time.
- def Def.paramsThe runtime parameters among a definition's nodes, in order, onto `out`.
- def forksWhether a parallel let (two binders, at least) is among `nodes` or under them, or `found`.
- def Def.called.visitThe definition an application below `path` calls by name.
- def Def.returnedThe type a definition's nodes say it returns, as one name, or "".
- def Def.forks
- def Program.defs.fileThe definitions among a file's nodes, by the name the check gives them, onto `out`.
- def Program.defsThe definitions of the program's files, by the name the check gives them, onto `out`: read one with `Names.find`.
- def Program.callers.if
- def Program.callers.step`callers` with the definition `info`, if it calls one of them.
- def Program.callers.file`callers` after a step for each definition among a file's nodes, in order.
- def Program.callers.pass
- def Program.callers.goPasses over the program until one adds nothing (`same`), or `fuel` runs out.
- def Program.callers`seeds`, and the definitions of the program (`defs`, of `sources`) that call one of them, directly or through others.
- type HereWhat a file rule sees: the program, from one of its files; that file's declarations, with their uses in it, if a rule needs them; and the rule's options, each declared one with its value.
- type WholeWhat a program rule sees: the program (its files, hub packages aside); every declaration of its files, with their uses in all of them, if a rule needs them; and the rule's options.
- def Here.ofThe program from one of its files, built once for every file rule that runs on that file: its declarations, if a rule needs them (`declare`).
- def Whole.ofThe whole program, built once for every program rule: the declarations of its own files, if a rule needs them (`declare`).
- def Here.path
- def Here.namespace"" for the checked file.