Documentation ¶
Index ¶
- Constants
- Variables
- func FoldBracket(suffix []lex.Lex) (r []lex.Lex, err error)
- func ParseRepo(repo Repository, pkgPaths []string) (map[string][]File, error)
- type Assembly
- type Bracket
- type Design
- type EmptySyntax
- type Factor
- type File
- type Import
- type Inline
- type Literal
- type Ref
- type Repository
- type SrcDir
- type SrcFile
- type Syntax
- type SyntaxError
- type Term
Constants ¶
View Source
const NoLabel = ""
Variables ¶
View Source
var ErrUnexpectedEnd = SyntaxError{Msg: "unexpected end of file"}
Functions ¶
Types ¶
type Assembly ¶
type Assembly struct { Sign Ref `ko:"name=ref"` Type string `ko:"name=type"` // "{}" or "[]" or "()" Term []Term `ko:"name=term"` Bracket lex.Lex `ko:"name=bracket"` }
func (Assembly) EndPosition ¶
func (Assembly) RegionString ¶
func (Assembly) StartPosition ¶
type Bracket ¶
type Bracket struct { Left lex.Token `ko:"name=left"` Right lex.Token `ko:"name=right"` Body []lex.Lex `ko:"name=body"` // []Token }
Bracket is a Lex.
func (Bracket) EndPosition ¶
func (Bracket) RegionString ¶
func (Bracket) StartPosition ¶
type EmptySyntax ¶
type EmptySyntax struct {
lex.EmptyRegion `ko:"name=emptyRegion"`
}
type File ¶
type File struct { Path string `ko:"name=path"` Import []Import `ko:"name=import"` Design []Design `ko:"name=design"` }
func ParseFileString ¶
ParseFileString parses the tokens of a file.
type Import ¶
type Import struct { Path string `ko:"name=path"` As Ref `ko:"name=as"` Comment string `ko:"name=comment" ctx:"expand"` // comments preceding import statement EndOfLine string `ko:"name=eol_comment" ctx:"expand"` // end-of-line comment following import statement Lex lex.Region `ko:"name=lex"` // lex tokens comprising the import statement and surrounding comments }
func (Import) EndPosition ¶
func (Import) RegionString ¶
func (Import) StartPosition ¶
type Inline ¶
type Literal ¶
type Literal struct { Value lex.Char `ko:"name=value"` // String, Int64, or Float64 lex.Lex `ko:"name=lex"` }
Literal is Syntax.
type Repository ¶
type Repository interface { Read(filePath string) (content string, err error) List(dirPath string) (file, subdir []string, err error) }
func NewLocalRepositories ¶
func NewLocalRepositories(rootDirs []string) Repository
func NewLocalRepository ¶
func NewLocalRepository(rootDirs []string) Repository
type SyntaxError ¶
type SyntaxError struct { Remainder []lex.Lex `ko:"name=remainder"` // remaining tokens at error Msg string `ko:"name=msg"` Cause []SyntaxError `ko:"name=cause"` }
func (SyntaxError) BottomCause ¶
func (e SyntaxError) BottomCause() SyntaxError
func (SyntaxError) DeepestCause ¶
func (e SyntaxError) DeepestCause() SyntaxError
func (SyntaxError) Depth ¶
func (e SyntaxError) Depth() int
func (SyntaxError) Error ¶
func (e SyntaxError) Error() string
func (SyntaxError) ShortestRemainder ¶
func (e SyntaxError) ShortestRemainder() SyntaxError
type Term ¶
type Term struct { Comment string `ko:"name=comment" ctx:"expand"` Label Ref `ko:"name=label"` Hitch Syntax `ko:"name=hitch"` // Assembly, Ref, Literal }
func (Term) EndPosition ¶
func (Term) RegionString ¶
func (Term) StartPosition ¶
Click to show internal directories.
Click to hide internal directories.