Documentation ¶
Index ¶
- Constants
- Variables
- type BackslashToken
- type Block
- type BlockWrapper
- type ClosingCurlyBracketToken
- type Command
- type Decoder
- type DefaultCommand
- type DefaultTokenHandler
- func (t *DefaultTokenHandler) CommitLastArg(commitEmptyArg bool) (err error)
- func (t *DefaultTokenHandler) Handle(token Token) (err error)
- func (t *DefaultTokenHandler) HandleBackslashToken(token *BackslashToken) error
- func (t *DefaultTokenHandler) HandleClosingCurlyBracketToken(token *ClosingCurlyBracketToken) error
- func (t *DefaultTokenHandler) HandleDoubleQuotaToken(token *DoubleQuotaToken) error
- func (t *DefaultTokenHandler) HandleHashToken(token *HashToken) error
- func (t *DefaultTokenHandler) HandleNewlineToken(token *NewlineToken) (err error)
- func (t *DefaultTokenHandler) HandleOpeningCurlyBracketToken(token *OpeningCurlyBracketToken) (err error)
- func (t *DefaultTokenHandler) HandleSemicolonToken(token *SemicolonToken) (err error)
- func (t *DefaultTokenHandler) HandleSingleQuotaToken(token *SingleQuotaToken) error
- func (t *DefaultTokenHandler) HandleStringToken(token *StringToken) error
- func (t *DefaultTokenHandler) HandleTokenAsString(token Token) error
- func (t *DefaultTokenHandler) HandleWhitespaceToken(token *WhitespaceToken) error
- func (t *DefaultTokenHandler) IsCallCommitted() bool
- func (t *DefaultTokenHandler) IsQuotaOpened() bool
- type DoubleQuotaToken
- type ErrCommand
- func NewErrCommand(command Command, message string) *ErrCommand
- func NewErrCommandArg(command Command, arg string) *ErrCommand
- func NewErrCommandArgsNumber(command Command) *ErrCommand
- func NewErrCommandMustHaveBlock(command Command) *ErrCommand
- func NewErrCommandMustHaveNoBlock(command Command) *ErrCommand
- func NewErrCommandName(command Command) *ErrCommand
- type ErrParse
- type HashToken
- type NewlineToken
- type OpeningCurlyBracketToken
- type SemicolonToken
- type SingleQuotaToken
- type StringToken
- type Token
- type TokenFactoryFunc
- type TokenHandler
- type TokenHandlerFactory
- type WhitespaceToken
Constants ¶
View Source
const DefaultSplitChars = "\r\n\t\f\v #\"';{}\\"
View Source
const IncludeDirective = "include"
Variables ¶
View Source
var DefaultDecoder = &Decoder{ SplitChars: DefaultSplitChars, TokenFactory: DefaultTokenFactory, TokenHandlerFactory: func(base Block, decoder *Decoder) TokenHandler { return NewTokenHandler(base, decoder) }, }
Functions ¶
This section is empty.
Types ¶
type BackslashToken ¶
type BackslashToken struct { }
func (*BackslashToken) String ¶
func (t *BackslashToken) String() string
type BlockWrapper ¶
type BlockWrapper struct { Parent *BlockWrapper Current Block }
type ClosingCurlyBracketToken ¶
type ClosingCurlyBracketToken struct { }
func (*ClosingCurlyBracketToken) String ¶
func (t *ClosingCurlyBracketToken) String() string
type Decoder ¶
type Decoder struct { SplitChars string TokenFactory TokenFactoryFunc TokenHandlerFactory TokenHandlerFactory }
type DefaultCommand ¶
func NewCommand ¶
func NewCommand(line int, name string, args ...string) *DefaultCommand
func (*DefaultCommand) GetArgs ¶
func (t *DefaultCommand) GetArgs() []string
func (*DefaultCommand) GetLine ¶ added in v0.3.7
func (t *DefaultCommand) GetLine() int
func (*DefaultCommand) GetName ¶
func (t *DefaultCommand) GetName() string
func (*DefaultCommand) String ¶
func (t *DefaultCommand) String() string
type DefaultTokenHandler ¶
type DefaultTokenHandler struct { BlockWrapper *BlockWrapper Decoder *Decoder Directive string Args []string LastArg string Line string LineNumber int IsCommentLine bool IsDoubleQuotaOpened bool IsSingleQuotaOpened bool IsBackslashed bool IsBackslashedNow bool }
func NewTokenHandler ¶
func NewTokenHandler(base Block, decoder *Decoder) *DefaultTokenHandler
func (*DefaultTokenHandler) CommitLastArg ¶
func (t *DefaultTokenHandler) CommitLastArg(commitEmptyArg bool) (err error)
func (*DefaultTokenHandler) Handle ¶
func (t *DefaultTokenHandler) Handle(token Token) (err error)
func (*DefaultTokenHandler) HandleBackslashToken ¶
func (t *DefaultTokenHandler) HandleBackslashToken(token *BackslashToken) error
func (*DefaultTokenHandler) HandleClosingCurlyBracketToken ¶
func (t *DefaultTokenHandler) HandleClosingCurlyBracketToken(token *ClosingCurlyBracketToken) error
func (*DefaultTokenHandler) HandleDoubleQuotaToken ¶
func (t *DefaultTokenHandler) HandleDoubleQuotaToken(token *DoubleQuotaToken) error
func (*DefaultTokenHandler) HandleHashToken ¶
func (t *DefaultTokenHandler) HandleHashToken(token *HashToken) error
func (*DefaultTokenHandler) HandleNewlineToken ¶
func (t *DefaultTokenHandler) HandleNewlineToken(token *NewlineToken) (err error)
func (*DefaultTokenHandler) HandleOpeningCurlyBracketToken ¶
func (t *DefaultTokenHandler) HandleOpeningCurlyBracketToken(token *OpeningCurlyBracketToken) (err error)
func (*DefaultTokenHandler) HandleSemicolonToken ¶
func (t *DefaultTokenHandler) HandleSemicolonToken(token *SemicolonToken) (err error)
func (*DefaultTokenHandler) HandleSingleQuotaToken ¶
func (t *DefaultTokenHandler) HandleSingleQuotaToken(token *SingleQuotaToken) error
func (*DefaultTokenHandler) HandleStringToken ¶
func (t *DefaultTokenHandler) HandleStringToken(token *StringToken) error
func (*DefaultTokenHandler) HandleTokenAsString ¶ added in v0.3.16
func (t *DefaultTokenHandler) HandleTokenAsString(token Token) error
func (*DefaultTokenHandler) HandleWhitespaceToken ¶
func (t *DefaultTokenHandler) HandleWhitespaceToken(token *WhitespaceToken) error
func (*DefaultTokenHandler) IsCallCommitted ¶
func (t *DefaultTokenHandler) IsCallCommitted() bool
func (*DefaultTokenHandler) IsQuotaOpened ¶ added in v0.3.16
func (t *DefaultTokenHandler) IsQuotaOpened() bool
type DoubleQuotaToken ¶
type DoubleQuotaToken struct { }
func (*DoubleQuotaToken) String ¶
func (t *DoubleQuotaToken) String() string
type ErrCommand ¶
func NewErrCommand ¶
func NewErrCommand(command Command, message string) *ErrCommand
func NewErrCommandArg ¶ added in v0.3.7
func NewErrCommandArg(command Command, arg string) *ErrCommand
func NewErrCommandArgsNumber ¶ added in v0.3.7
func NewErrCommandArgsNumber(command Command) *ErrCommand
func NewErrCommandMustHaveBlock ¶ added in v0.3.7
func NewErrCommandMustHaveBlock(command Command) *ErrCommand
func NewErrCommandMustHaveNoBlock ¶ added in v0.3.7
func NewErrCommandMustHaveNoBlock(command Command) *ErrCommand
func NewErrCommandName ¶ added in v0.3.7
func NewErrCommandName(command Command) *ErrCommand
func (*ErrCommand) Error ¶
func (t *ErrCommand) Error() string
type NewlineToken ¶
type NewlineToken struct { }
func (*NewlineToken) String ¶
func (t *NewlineToken) String() string
type OpeningCurlyBracketToken ¶
type OpeningCurlyBracketToken struct { }
func (*OpeningCurlyBracketToken) String ¶
func (t *OpeningCurlyBracketToken) String() string
type SemicolonToken ¶
type SemicolonToken struct { }
func (*SemicolonToken) String ¶
func (t *SemicolonToken) String() string
type SingleQuotaToken ¶
type SingleQuotaToken struct { }
func (*SingleQuotaToken) String ¶
func (t *SingleQuotaToken) String() string
type StringToken ¶
type StringToken struct {
// contains filtered or unexported fields
}
func (*StringToken) String ¶
func (t *StringToken) String() string
type TokenFactoryFunc ¶
type TokenHandler ¶
type TokenHandlerFactory ¶
type TokenHandlerFactory func(base Block, decoder *Decoder) TokenHandler
type WhitespaceToken ¶
type WhitespaceToken struct {
// contains filtered or unexported fields
}
func (*WhitespaceToken) String ¶
func (t *WhitespaceToken) String() string
Click to show internal directories.
Click to hide internal directories.