Documentation
¶
Index ¶
- type ArrayLiteral
- type ArrayType
- type BooleanLiteral
- type ChoiceType
- type ConditionalExpression
- type Declaration
- type DocDeclaration
- type Documentation
- type DocumentationKind
- type Expression
- type File
- type FloatLiteral
- type GroupedExpression
- type HexFloatLiteral
- type HexIntLiteral
- type Identifier
- type ImportDeclaration
- type ImportedIdentifier
- type InfixExpression
- type IntLiteral
- type MatchArm
- type MatchExpression
- type MatchPattern
- type MemberAccess
- type NamedType
- type Node
- type NullLiteral
- type OutputBlock
- type OutputDirective
- type OutputDirectiveKind
- type OutputField
- type OutputMode
- type OutputSchemaField
- type PrefixExpression
- type PrimitiveType
- type RecordField
- type RecordLiteral
- type RecordMapType
- type RecordType
- type SchemaDeclaration
- type SchemaField
- type ScriptBlock
- type SelfReference
- type SourcePosition
- type SourceRange
- type StringLiteral
- type TypeDeclaration
- type TypeReference
- type UnionType
- type VariableDeclaration
- type VariantType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayLiteral ¶
type ArrayLiteral struct {
StartToken lexer.Token
Elements []Expression
}
func (ArrayLiteral) Range ¶
func (a ArrayLiteral) Range() SourceRange
type ArrayType ¶
type ArrayType struct {
Token lexer.Token
Element TypeReference
}
func (ArrayType) Range ¶
func (a ArrayType) Range() SourceRange
type BooleanLiteral ¶
func (BooleanLiteral) Range ¶
func (b BooleanLiteral) Range() SourceRange
type ChoiceType ¶
type ChoiceType struct {
Token lexer.Token
Members []Expression
}
func (ChoiceType) Range ¶
func (c ChoiceType) Range() SourceRange
type ConditionalExpression ¶
type ConditionalExpression struct {
Condition Expression
Then Expression
Else Expression
}
func (ConditionalExpression) Range ¶
func (c ConditionalExpression) Range() SourceRange
type Declaration ¶
type Declaration interface {
Node
// contains filtered or unexported methods
}
type DocDeclaration ¶
type DocDeclaration struct {
Kind DocumentationKind
KeywordToken lexer.Token
TargetToken lexer.Token
Target string
Documentation Documentation
}
func (DocDeclaration) Range ¶
func (d DocDeclaration) Range() SourceRange
type Documentation ¶
type Documentation struct {
Summary *StringLiteral
Description *StringLiteral
Props map[string]StringLiteral
}
type DocumentationKind ¶
type DocumentationKind int
const ( DocumentationKindGeneral DocumentationKind = iota DocumentationKindSchema )
type Expression ¶
type Expression interface {
Node
// contains filtered or unexported methods
}
type File ¶
type File struct {
Imports []ImportDeclaration
Script *ScriptBlock
Output OutputBlock
}
type FloatLiteral ¶
func (FloatLiteral) Range ¶
func (f FloatLiteral) Range() SourceRange
type GroupedExpression ¶
type GroupedExpression struct {
StartToken lexer.Token
Expression Expression
}
func (GroupedExpression) Range ¶
func (g GroupedExpression) Range() SourceRange
type HexFloatLiteral ¶
func (HexFloatLiteral) Range ¶
func (h HexFloatLiteral) Range() SourceRange
type HexIntLiteral ¶
func (HexIntLiteral) Range ¶
func (h HexIntLiteral) Range() SourceRange
type Identifier ¶
func (Identifier) Range ¶
func (i Identifier) Range() SourceRange
type ImportDeclaration ¶
type ImportDeclaration struct {
Path StringLiteral
Identifiers []ImportedIdentifier
Binding *ImportedIdentifier
}
type ImportedIdentifier ¶
type ImportedIdentifier struct {
Name string // exported name (the name in the source file)
Alias string // local alias (empty if no alias)
}
func (ImportedIdentifier) LocalName ¶
func (i ImportedIdentifier) LocalName() string
type InfixExpression ¶
type InfixExpression struct {
Left Expression
OperatorToken lexer.Token
Operator lexer.TokenType
Right Expression
}
func (InfixExpression) Range ¶
func (i InfixExpression) Range() SourceRange
type IntLiteral ¶
func (IntLiteral) Range ¶
func (i IntLiteral) Range() SourceRange
type MatchArm ¶
type MatchArm struct {
Pattern MatchPattern
Value Expression
}
type MatchExpression ¶
type MatchExpression struct {
MatchToken lexer.Token
Value Expression
Arms []MatchArm
EndToken lexer.Token
}
func (MatchExpression) Range ¶
func (m MatchExpression) Range() SourceRange
type MatchPattern ¶
type MatchPattern struct {
Type TypeReference
Literal Expression
}
func (MatchPattern) Range ¶
func (m MatchPattern) Range() SourceRange
type MemberAccess ¶
type MemberAccess struct {
Target Expression
OperatorToken lexer.Token
NameToken lexer.Token
Name string
Optional bool
}
func (MemberAccess) Range ¶
func (m MemberAccess) Range() SourceRange
type Node ¶
type Node interface {
Range() SourceRange
}
type NullLiteral ¶
func (NullLiteral) Range ¶
func (n NullLiteral) Range() SourceRange
type OutputBlock ¶
type OutputBlock struct {
Directives []OutputDirective
Mode OutputMode
DataFields []OutputField
SchemaFields []OutputSchemaField
}
type OutputDirective ¶
type OutputDirective struct {
Kind OutputDirectiveKind
Value string
Description Expression
}
type OutputDirectiveKind ¶
type OutputDirectiveKind int
const ( OutputDirectiveOutput OutputDirectiveKind = iota OutputDirectiveSchemaFile OutputDirectiveSchema OutputDirectiveParse OutputDirectiveParseFile OutputDirectiveDescription )
type OutputField ¶
type OutputField struct {
NameToken lexer.Token
Name string
Optional bool
Shorthand bool
Value Expression
Description string
}
func (OutputField) Range ¶
func (o OutputField) Range() SourceRange
type OutputSchemaField ¶
type OutputSchemaField struct {
NameToken lexer.Token
Name string
Optional bool
Type TypeReference
Description string
}
func (OutputSchemaField) Range ¶
func (o OutputSchemaField) Range() SourceRange
type PrefixExpression ¶
type PrefixExpression struct {
OperatorToken lexer.Token
Operator lexer.TokenType
Right Expression
}
func (PrefixExpression) Range ¶
func (p PrefixExpression) Range() SourceRange
type PrimitiveType ¶
func (PrimitiveType) Range ¶
func (p PrimitiveType) Range() SourceRange
type RecordField ¶
type RecordField struct {
NameToken lexer.Token
Name string
Optional bool
Shorthand bool
Value Expression
}
func (RecordField) Range ¶
func (r RecordField) Range() SourceRange
type RecordLiteral ¶
type RecordLiteral struct {
StartToken lexer.Token
Fields []RecordField
}
func (RecordLiteral) Range ¶
func (r RecordLiteral) Range() SourceRange
type RecordMapType ¶
type RecordMapType struct {
Token lexer.Token
Value TypeReference
}
func (RecordMapType) Range ¶
func (r RecordMapType) Range() SourceRange
type RecordType ¶
type RecordType struct {
StartToken lexer.Token
Fields []SchemaField
}
func (RecordType) Range ¶
func (r RecordType) Range() SourceRange
type SchemaDeclaration ¶
type SchemaDeclaration struct {
NameToken lexer.Token
Name string
Type RecordType
}
func (SchemaDeclaration) Range ¶
func (s SchemaDeclaration) Range() SourceRange
type SchemaField ¶
type SchemaField struct {
NameToken lexer.Token
Name string
Optional bool
Type TypeReference
Description string
}
func (SchemaField) Range ¶
func (s SchemaField) Range() SourceRange
type ScriptBlock ¶
type ScriptBlock struct {
Imports []ImportDeclaration
Items []Declaration
}
type SelfReference ¶
func (SelfReference) Range ¶
func (s SelfReference) Range() SourceRange
type SourcePosition ¶
type SourceRange ¶
type SourceRange struct {
Start SourcePosition
End SourcePosition
}
func TokenRange ¶
func TokenRange(token lexer.Token) SourceRange
type StringLiteral ¶
func (StringLiteral) Range ¶
func (s StringLiteral) Range() SourceRange
type TypeDeclaration ¶
type TypeDeclaration struct {
NameToken lexer.Token
Name string
Type TypeReference
Description string
}
func (TypeDeclaration) Range ¶
func (t TypeDeclaration) Range() SourceRange
type TypeReference ¶
type TypeReference interface {
Node
// contains filtered or unexported methods
}
type UnionType ¶
type UnionType struct {
Token lexer.Token
Members []TypeReference
}
func (UnionType) Range ¶
func (u UnionType) Range() SourceRange
type VariableDeclaration ¶
type VariableDeclaration struct {
HasValue bool
Type TypeReference
NameToken lexer.Token
Name string
Value Expression
Description string
}
func (VariableDeclaration) Range ¶
func (v VariableDeclaration) Range() SourceRange
type VariantType ¶
type VariantType struct {
Token lexer.Token
Members []TypeReference
}
func (VariantType) Range ¶
func (v VariantType) Range() SourceRange
Click to show internal directories.
Click to hide internal directories.