/
simple.go
50 lines (35 loc) · 1.33 KB
/
simple.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package token
//SimpleToken is a generic interface for implementing simple tokens,
//a token is a rune which is divided by normal text
type SimpleToken interface {
Token
Char() rune
}
//IsToken is used internaly for rapresenting a token,
//calling this will probabaly panic
//BoldToken rapresent a / token
type BoldToken struct{ SimpleToken }
//ItalicToken rapresent a / token
type ItalicToken struct{ SimpleToken }
//HeaderToken rapresent a + token
type HeaderToken struct{ SimpleToken }
//NewLineToken rapresent a \n token
type NewLineToken struct{ SimpleToken }
//TabToken rapresent a \t token
type TabToken struct{ SimpleToken }
//LessToken rapresent a - token
type LessToken struct{ SimpleToken }
//EqualToken rapresent a - token
type EqualToken struct{ SimpleToken }
//SBracketOpenToken rapresent a [ token
type SBracketOpenToken struct{ SimpleToken }
//SBracketCloseToken rapresent a ] token
type SBracketCloseToken struct{ SimpleToken }
//EscapeToken is a special toekn used for escpaing other tokens, it rapresent a \ token
type EscapeToken struct{ SimpleToken }
//PipeToken is a simple token, rapresenting a | token
type PipeToken struct{ SimpleToken }
//QuoteToken is a simple token rapresenting a " token
type QuoteToken struct{ SimpleToken }
//AtToken is a simple token rapresenting a @ token
type AtToken struct{ SimpleToken }