okapi

package
v0.0.0-...-0fae820 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

In this package, functions prefixed with "parse" usually parse from text to S-expression, and functions prefixed with "decode" usually parse an S-expression into a meaningful type

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLanguage

func NewLanguage() language.Language

Entry point to Gazelle

Types

type AutoModules

type AutoModules struct{}

AutoModules implements ModuleSpec Either `:standard` or unspecified Note: limitation: a `modules` stanza can contain both `:standard` and concrete modules

type Choice

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

type Codept

type Codept struct {
	Dependencies []CodeptDep
	Local        []CodeptLocal
}

type CodeptDep

type CodeptDep struct {
	File string
	Deps [][]string
}

type CodeptLocal

type CodeptLocal struct {
	Module []string
	Ml     string
	Mli    string
}

type CodeptSource

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

type Component

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

TODO store stuff like auto, exclude in annotations

type ComponentKind

type ComponentKind interface {
	// contains filtered or unexported methods
}

type ComponentName

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

type ComponentSlice

type ComponentSlice []Component

func (ComponentSlice) Len

func (s ComponentSlice) Len() int

func (ComponentSlice) Less

func (s ComponentSlice) Less(i, j int) bool

func (ComponentSlice) Sort

func (s ComponentSlice) Sort()

func (ComponentSlice) Swap

func (s ComponentSlice) Swap(i, j int)

type ComponentSources

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

type ComponentSpec

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

Executable | Library | Test

type ConcreteModules

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

ConcreteModules implements ModuleSpec

type Config

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

type Deps

type Deps = map[string]Source

func Dependencies

func Dependencies(dir string, files []string) Deps

Here "dependencies" means "OCaml modules", not Libraries or Opam deps, based on Codept. Example codept command:

`codept -native -deps /home/sir4ur0n/code/qcheck/src/core/*.{ml,mli}`

Output:

{
"version" : [0, 11, 0],
"dependencies" :
  [{
   "file" : "/home/sir4ur0n/code/qcheck/src/core/QCheck.mli",
   "deps" : [["Random"], ["QCheck2"], ["Hashtbl"], ["Format"]]
   },
  {
  "file" : "/home/sir4ur0n/code/qcheck/src/core/QCheck2.mli",
  "deps" : [["Seq"], ["Random"], ["Hashtbl"], ["Format"]]
  },
  {
  "file" : "/home/sir4ur0n/code/qcheck/src/core/QCheck.ml",
  "deps" :
    [["Sys"], ["String"], ["Set"], ["Random"], ["Queue"], ["QCheck2"],
    ["Printf"], ["Obj"], ["List"], ["Int64"], ["Int32"], ["Int"],
    ["Hashtbl"], ["Char"], ["Bytes"], ["Buffer"], ["Array"]]
  },
  {
  "file" : "/home/sir4ur0n/code/qcheck/src/core/QCheck2.ml",
  "deps" :
    [["Sys"], ["String"], ["Seq"], ["Result"], ["Random"], ["Printf"],
    ["Printexc"], ["Option"], ["List"], ["Lazy"], ["Int64"], ["Int32"],
    ["Int"], ["Hashtbl"], ["Fun"], ["Format"], ["Float"], ["Char"],
    ["Bytes"], ["Buffer"], ["Array"]]
  }],
"local" :
  [{
   "module" : ["QCheck"],
   "ml" : "/home/sir4ur0n/code/qcheck/src/core/QCheck.ml",
   "mli" : "/home/sir4ur0n/code/qcheck/src/core/QCheck.mli"
   },
  {
  "module" : ["QCheck2"],
  "ml" : "/home/sir4ur0n/code/qcheck/src/core/QCheck2.ml",
  "mli" : "/home/sir4ur0n/code/qcheck/src/core/QCheck2.mli"
  }]
}

type DuneComponent

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

Either Executable Library

type DuneComponentCore

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

type DuneConfig

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

type DuneLibDep

type DuneLibDep interface{}

type DuneLibOpam

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

type DuneLibSelect

type DuneLibSelect struct{ Choice ModuleChoice }

type ExcludeModules

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

ExcludeModules implements ModuleSpec

type ExeKind

type ExeKind interface {
	// contains filtered or unexported methods
}

type ExePlain

type ExePlain struct{}

type ExePpx

type ExePpx struct{}

type ExeSpec

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

ExeSpec implements KindSpec

type Executable

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

type Generator

type Generator interface {
	// contains filtered or unexported methods
}

type KeyValue

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

type KindSpec

type KindSpec interface {
	// contains filtered or unexported methods
}

Whether it's an executable or library

type Lexer

type Lexer struct{}

type LibNs

type LibNs struct{}

type LibNsPpx

type LibNsPpx struct{}

type LibPlain

type LibPlain struct{}

type LibPpx

type LibPpx struct{}

type LibSpec

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

LibSpec implements KindSpec

type Library

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

type LibraryKind

type LibraryKind interface {
	// contains filtered or unexported methods
}

type ModuleAlt

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

type ModuleChoice

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

type ModuleSpec

type ModuleSpec interface {
	// contains filtered or unexported methods
}

A `modules` stanza (may be absent, in that case `auto = true`)

type NoGenerator

type NoGenerator struct{}

type NoPpx

type NoPpx struct{}

type Package

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

type PackageSpec

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

Directory (or Dune file or Bazel build file)

type PpxDirect

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

type PpxKind

type PpxKind interface {
	// contains filtered or unexported methods
}

type PpxTransitive

type PpxTransitive struct{}

type ResolvedLocal

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

type ResolvedOpam

type ResolvedOpam struct{}

type RuleResult

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

A rule to be generated by OBazl

func GenerateRules

func GenerateRules(dir string, sources Deps, dune string, library bool) []RuleResult

func GenerateRulesAuto

func GenerateRulesAuto(name string, sources Deps, library bool) []RuleResult

func GenerateRulesDune

func GenerateRulesDune(name string, sources Deps, duneCode string, library bool) []RuleResult

type SexpComponent

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

type SexpEmpty

type SexpEmpty struct{}

func (SexpEmpty) List

func (s SexpEmpty) List() ([]SexpNode, error)

func (SexpEmpty) String

func (s SexpEmpty) String() (string, error)

type SexpError

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

func (SexpError) Error

func (e SexpError) Error() string

type SexpList

type SexpList struct{ Sub []SexpNode }

func (SexpList) List

func (l SexpList) List() ([]SexpNode, error)

func (SexpList) String

func (l SexpList) String() (string, error)

type SexpMap

type SexpMap struct {
	Name   string
	Values map[string]SexpNode
}

func (SexpMap) List

func (m SexpMap) List() ([]SexpNode, error)

func (SexpMap) String

func (m SexpMap) String() (string, error)

type SexpNode

type SexpNode interface {
	List() ([]SexpNode, error)
	String() (string, error)
}

type SexpString

type SexpString struct{ Content string }

func (SexpString) List

func (s SexpString) List() ([]SexpNode, error)

func (SexpString) String

func (s SexpString) String() (string, error)

type Source

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

type SourceSet

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

type SourceSetSlice

type SourceSetSlice []SourceSet

func (SourceSetSlice) Len

func (s SourceSetSlice) Len() int

func (SourceSetSlice) Less

func (s SourceSetSlice) Less(i, j int) bool

func (SourceSetSlice) Sort

func (s SourceSetSlice) Sort()

func (SourceSetSlice) Swap

func (s SourceSetSlice) Swap(i, j int)

type SourceSlice

type SourceSlice []Source

func (SourceSlice) Len

func (s SourceSlice) Len() int

func (SourceSlice) Less

func (s SourceSlice) Less(i, j int) bool

func (SourceSlice) Sort

func (s SourceSlice) Sort()

func (SourceSlice) Swap

func (s SourceSlice) Swap(i, j int)

type SourcesSpec

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

Jump to

Keyboard shortcuts

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