Documentation
¶
Index ¶
- Constants
- type BuiltinType
- type File
- func (f *File) AddLine(offset int)
- func (f *File) AddLineInfo(offset int, filename string, line int)
- func (f *File) Base() int
- func (f *File) Line(p Pos) int
- func (f *File) LineCount() int
- func (f *File) MergeLine(line int)
- func (f *File) Name() string
- func (f *File) Offset(p Pos) int
- func (f *File) Pos(offset int) Pos
- func (f *File) Position(p Pos) (pos Position)
- func (f *File) PositionFor(p Pos, adjusted bool) (pos Position)
- func (f *File) SetLines(lines []int) bool
- func (f *File) SetLinesForContent(content []byte)
- func (f *File) Size() int
- type FileSet
- type Pos
- type Position
- type Token
Constants ¶
View Source
const Group = "group"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuiltinType ¶
type BuiltinType int
const ( Any BuiltinType = iota // any Bool // bool Byte // byte Bytes // bytes String // string Int // int Int8 // int8 Int16 // int16 Int32 // int32 Int64 // int64 Uint // uint Uint8 // uint8 Uint16 // uint16 Uint32 // uint32 Uint64 // uint64 Float32 // float32 Float64 // float64 Map // map<K,V> Vector // vector<T> Array // array<T,Size> )
func LookupType ¶
func LookupType(ident string) (BuiltinType, bool)
func (BuiltinType) IsContainer ¶ added in v0.1.3
func (bt BuiltinType) IsContainer() bool
func (BuiltinType) IsFloat ¶ added in v0.1.3
func (bt BuiltinType) IsFloat() bool
func (BuiltinType) IsInt ¶ added in v0.1.2
func (bt BuiltinType) IsInt() bool
func (BuiltinType) IsNumber ¶ added in v0.1.3
func (bt BuiltinType) IsNumber() bool
func (BuiltinType) String ¶
func (bt BuiltinType) String() string
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) SetLinesForContent ¶
type FileSet ¶
type FileSet struct {
// contains filtered or unexported fields
}
func NewFileSet ¶
func NewFileSet() *FileSet
type Position ¶
type Position struct {
Filename string // filename, if any
Offset int // byte offset, starting at 0
Line int // line number, starting at 1
Column int // column number, starting at 1 (character count per line)
}
A source position is represented by a Position value. A position is valid if Line > 0.
type Token ¶
type Token int
const ( ILLEGAL Token = iota EOF COMMENT IDENT // main INT // 12345 FLOAT // 123.45 CHAR // 'a' STRING // "abc" LPAREN // ( RPAREN // ) LBRACK // [ RBRACK // ] LBRACE // { RBRACE // } LESS // < GREATER // > COMMA // , PERIOD // . SEMICOLON // ; COLON // : ASSIGN // = AT // @ @function(args) DOLLAR // $ env variable SHARP // # PACKAGE // package IMPORT // import ENUM // enum CONST // const STRUCT // struct PROTOCOL // protocol SERVICE // service REQUIRED // required OPTIONAL // optional EXTENDS // extends )
func LookupOperator ¶
func (Token) IsOperator ¶
Click to show internal directories.
Click to hide internal directories.