Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WarningTexts ¶ added in v0.48.1
WarningTexts renders each parse warning with its source location. Warnings are not fatal, so callers report them beside their results instead of failing.
Types ¶
type SourceLine ¶ added in v1.5.5
type SourceLine struct {
Kind SourceLineKind
Directive directive.Name
Args directive.ArgKind
ScriptArgs bool
ScriptKind restfile.ScriptKind
ScriptLang restfile.ScriptLang
ContentStart int
ContentEnd int
OptionValueEnd int
// InExpr is true when a body line continues a {{= }} expression.
InExpr bool
}
Offsets are rune positions in the source line. OptionValueEnd is zero unless the line starts inside an option value.
func (SourceLine) ContentRange ¶ added in v1.5.5
func (l SourceLine) ContentRange(n int) (start, end int, ok bool)
type SourceLineKind ¶ added in v1.5.5
type SourceLineKind uint8
const ( SourceLineCode SourceLineKind = iota SourceLineComment SourceLineDirective SourceLineDirectiveValue SourceLineRequestSeparator SourceLineLiteral SourceLineScript )
func (SourceLineKind) String ¶ added in v1.5.5
func (k SourceLineKind) String() string
type SourceSyntax ¶ added in v1.5.5
type SourceSyntax struct {
// contains filtered or unexported fields
}
SourceSyntax uses the parser's context rules to classify each line.
func (*SourceSyntax) Classify ¶ added in v1.5.5
func (s *SourceSyntax) Classify(source string)
A trailing newline creates an empty final line to match the editor.
func (*SourceSyntax) Len ¶ added in v1.5.5
func (s *SourceSyntax) Len() int
func (*SourceSyntax) Line ¶ added in v1.5.5
func (s *SourceSyntax) Line(i int) SourceLine
Source Files
¶
Click to show internal directories.
Click to hide internal directories.