Documentation
¶
Index ¶
- func Parse(text string, filepath string, parserOptions ParserOptions) (*syntax.File, error)
- func Print(originalText string, filepath string, syntaxOptions SyntaxOptions) (string, error)
- type Comment
- type File
- type Lit
- type Node
- type ParseError
- type ParserOptions
- type Pos
- type PrinterOptions
- type Redirect
- type Result
- type Stmt
- type SyntaxOptions
- type Word
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Comment ¶
func (Comment) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Comment) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Comment) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Comment) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type File ¶
func (File) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (File) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*File) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*File) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Lit ¶
func (Lit) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Lit) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Lit) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Lit) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Node ¶
func (Node) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Node) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Node) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Node) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type ParseError ¶
type ParseError struct {
syntax.ParseError
Pos Pos
}
func MapParseError ¶
func MapParseError(err error) (*ParseError, string)
func (ParseError) MarshalEasyJSON ¶
func (v ParseError) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ParseError) MarshalJSON ¶
func (v ParseError) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ParseError) UnmarshalEasyJSON ¶
func (v *ParseError) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ParseError) UnmarshalJSON ¶
func (v *ParseError) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ParserOptions ¶
type ParserOptions struct {
KeepComments bool
StopAt string
Variant syntax.LangVariant
}
type Pos ¶
func (Pos) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Pos) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Pos) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Pos) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type PrinterOptions ¶
type Redirect ¶
func (Redirect) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Redirect) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Redirect) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Redirect) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Result ¶
type Result struct {
File `json:"file"`
Text string `json:"text"`
*ParseError `json:"parseError"`
Message string `json:"message"`
}
func (Result) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Result) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Result) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Result) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Stmt ¶
type Stmt struct {
Comments []Comment
Cmd *Node
Position Pos
Semicolon Pos
Negated bool
Background bool
Coprocess bool
Redirs []Redirect
Pos Pos
End Pos
}
func (Stmt) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Stmt) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Stmt) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Stmt) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type SyntaxOptions ¶
type SyntaxOptions struct {
ParserOptions
PrinterOptions
}
type Word ¶
func (Word) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Word) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Word) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Word) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface