Documentation ¶
Index ¶
Constants ¶
View Source
const ( EOF byte = 0 // used to imitate end of file CommentSign = '#' AnnotationDelimiterPart = '/' ObjectOpen = '{' ArrayOpen = '[' ContextOpenSign = '(' ContextCloseSign = ')' LinkSymbol = '@' DoubleQuote = '"' RegexDelimiter = '/' )
Variables ¶
View Source
var ErrRecursionDetected = errors.New("recursion detected")
Functions ¶
Types ¶
type Lexeme ¶
type Lexeme struct {
// contains filtered or unexported fields
}
func (Lexeme) Type ¶
func (lex Lexeme) Type() LexemeType
type LexemeEvent ¶
type LexemeEvent struct {
// contains filtered or unexported fields
}
type LexemeEventType ¶
type LexemeEventType uint8
const ( KeywordBegin LexemeEventType = iota KeywordEnd ParameterBegin ParameterEnd AnnotationBegin AnnotationEnd SchemaBegin SchemaEnd TextBegin TextEnd ContextOpen ContextClose EnumBegin EnumEnd )
func (LexemeEventType) IsBeginning ¶
func (e LexemeEventType) IsBeginning() bool
func (LexemeEventType) IsEnding ¶
func (e LexemeEventType) IsEnding() bool
func (LexemeEventType) IsSingle ¶
func (e LexemeEventType) IsSingle() bool
func (LexemeEventType) String ¶
func (e LexemeEventType) String() string
func (LexemeEventType) ToLexemeType ¶
func (e LexemeEventType) ToLexemeType() LexemeType
type LexemeType ¶
type LexemeType uint8
const ( // Keyword represent a name of Directive, i.e. URL, GET, Path, 200, etc. Keyword LexemeType = iota // Parameter represent a parameter for directive (regexp/jsight for TYPE) Parameter // Annotation represent user's annotation to directive in a free-text form. Annotation // Schema represent a jSchema inside directive's body (Body, TYPE, 200, etc). Schema // Json represents a JSON inside directive's body (CONFIG). Json // Text represents a text inside directive Description body. Text // ContextExplicitOpening represent explicitly opened context, so that it can // be later explicitly closed. ContextExplicitOpening // ContextExplicitClosing represents explicitly closed context. ContextExplicitClosing // Enum represents an enum body. Enum )
func (LexemeType) String ¶
func (t LexemeType) String() string
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
func NewJApiScanner ¶
func (*Scanner) CurrentIndex ¶
func (*Scanner) Next ¶
Next reads japi file by bytes, detects lexemes beginnings and ends and returns them as soon as they found returns false for the end of file
func (*Scanner) SetCurrentIndex ¶
SetCurrentIndex to continue scanning from certain position
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
Stack ths stack of scanners.
func (*Stack) AddIncludeTraceToError ¶
AddIncludeTraceToError adds include trace to given error.
func (*Stack) Push ¶
Push pushed new scanner into stack with position in this scanner where it was pushed. This position will be necessary for creating stack trace.
func (*Stack) ToDirectiveIncludeTracer ¶
func (s *Stack) ToDirectiveIncludeTracer() directive.IncludeTracer
ToDirectiveIncludeTracer converts this scanner stack to directive's include trace. We can't pass this stack itself 'cause it will be empty at the time when it will be necessary.
Source Files ¶
- constants.go
- errors.go
- lexeme-event-stack.go
- lexeme-event.go
- lexeme.go
- scanner.go
- stack.go
- step-helpers.go
- step-stack.go
- steps-baseurl.go
- steps-body.go
- steps-comments.go
- steps-description.go
- steps-directive-annotation.go
- steps-directive-parameters.go
- steps-enum.go
- steps-headers.go
- steps-http-methods.go
- steps-include.go
- steps-info.go
- steps-jsight.go
- steps-macro.go
- steps-method.go
- steps-params.go
- steps-paste.go
- steps-path.go
- steps-protocol.go
- steps-query.go
- steps-request.go
- steps-response-codes.go
- steps-result.go
- steps-schema-jsight.go
- steps-schema-regex.go
- steps-server.go
- steps-tag.go
- steps-tags.go
- steps-title.go
- steps-type.go
- steps-url.go
- steps-version.go
- steps.go
Click to show internal directories.
Click to hide internal directories.