Documentation
¶
Index ¶
- Constants
- func FirstNonWhitespaceIndex(line string) int
- func IndentLevel(line string) int
- func ParseSupermakeFile(cwd, path string) (*supermake.SupermakeFile, error)
- func ParseSupermakeString(cwd, data string) (*supermake.SupermakeFile, error)
- func ReplaceVariables(s string, f func(v string) (string, error)) (string, error)
- type LineType
- type SuperMakeFileParser
Constants ¶
View Source
const COMMENT_CHARS = "#"
View Source
const VARIABLE_END = "}}"
View Source
const VARIABLE_START = "${{"
Variables ¶
This section is empty.
Functions ¶
func FirstNonWhitespaceIndex ¶
Get the index of the first non-whitespace character. Returns -1 if the line is empty or all whitespace.
func IndentLevel ¶
func ParseSupermakeFile ¶ added in v0.0.4
func ParseSupermakeFile(cwd, path string) (*supermake.SupermakeFile, error)
func ParseSupermakeString ¶
func ParseSupermakeString(cwd, data string) (*supermake.SupermakeFile, error)
func ReplaceVariables ¶
Replace every variable with the return value of f. Supports nested variables, such that variable references may be constructed out of variables themselves. E.g. if X=A, Y=B, A-B=test, $($(X)-$(Y)) becomes 'test'. Errors returned by f are propagated to the function return value.
Types ¶
type SuperMakeFileParser ¶
type SuperMakeFileParser struct {
Variables supermake.Variables
// contains filtered or unexported fields
}
func NewParser ¶
func NewParser(lines []string) *SuperMakeFileParser
func (*SuperMakeFileParser) Parse ¶
func (p *SuperMakeFileParser) Parse(cwd string) (*supermake.SupermakeFile, error)
Click to show internal directories.
Click to hide internal directories.