Documentation ¶
Index ¶
- Constants
- Variables
- type Comment
- type Comments
- type LexFn
- type Lexer
- func (l *Lexer) Backup()
- func (l *Lexer) Dec()
- func (l *Lexer) Emit(tokenType TokenType)
- func (l *Lexer) Ignore()
- func (l *Lexer) Inc()
- func (l *Lexer) InputToEnd() string
- func (l *Lexer) IsEOF() bool
- func (l *Lexer) Next() rune
- func (l *Lexer) NextToken() Token
- func (l *Lexer) Peek() rune
- func (l *Lexer) Run()
- func (l *Lexer) Shutdown()
- func (l *Lexer) SkipWhitespace()
- type Token
- type TokenType
Constants ¶
View Source
const EOF rune = 0
EOF is defined to get a char
View Source
const LeftBracket string = "[["
LeftBracket
View Source
const MinusSign = "--"
MinusSign
View Source
const NEWLINE string = "\n"
NEWLINE
View Source
const RightBracket string = "]]"
RightBracket
Variables ¶
View Source
var ErrNoMatch = fmt.Errorf("No matching comment")
ErrNoMatch is returned when no matching comment can be found for a row
Functions ¶
This section is empty.
Types ¶
type Lexer ¶
type Lexer struct { Name string Input string Tokens chan Token State LexFn Start int Pos int Width int Row int }
Lexer defines our parser
func (*Lexer) Emit ¶
Emit puts a token onto the token channel. The value of l token is read from the input based on the current lexer position.
func (*Lexer) InputToEnd ¶
InputToEnd returns a slice of the input from the current lexer position to the end of the input string.
func (*Lexer) Next ¶
Next reads the next rune (character) from the input stream and advances the lexer position.
Click to show internal directories.
Click to hide internal directories.