Documentation
¶
Overview ¶
Package lang is the one table of the languages Spackle can run code for: which programs a proof may start, the default sandbox image, the compile check after a patch and the command that runs one named test. Every other package reads the table, so adding a language is one entry here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultImages ¶
DefaultImages returns the default sandbox image of every language.
func DisplayList ¶
func DisplayList() string
DisplayList names the supported languages for a sentence: "Go, Python, JavaScript and TypeScript".
Types ¶
type Proof ¶
type Proof struct {
// Name is the language name the walk and the mapper use ("go").
Name string
// Display is the name as written in prose ("Go").
Display string
// DefaultImage is the sandbox image used unless [sandbox.images] names
// another.
DefaultImage string
// Programs lists what a proof's command may start with. There is no
// shell: a proof is one program run with an argument vector.
Programs []string
// contains filtered or unexported fields
}
Proof describes one language with full find, demonstrate and fix support. Other languages get findings and analysis only.
func (Proof) CompileCheck ¶
CompileCheck returns a cheap command that fails when a changed file no longer compiles or parses, or nil when the language has none for these files. It guards against a "fix" that only stops the proof by breaking the program.
func (Proof) SingleTest ¶
SingleTest returns the command that runs the one test called name. testCommand is the target's own test command as the mapper detected it. The caller validates name: the vector is assembled here and a model never supplies it.