mirror of
https://github.com/usememos/memos.git
synced 2025-10-10 14:25:54 +08:00
27 lines
366 B
Go
27 lines
366 B
Go
package tokenizer
|
|
|
|
type TokenType = string
|
|
|
|
const (
|
|
Underline TokenType = "_"
|
|
Star TokenType = "*"
|
|
Newline TokenType = "\n"
|
|
Hash TokenType = "#"
|
|
Space TokenType = " "
|
|
)
|
|
|
|
const (
|
|
Text TokenType = ""
|
|
)
|
|
|
|
type Token struct {
|
|
Type TokenType
|
|
Value string
|
|
}
|
|
|
|
func NewToken(tp, text string) *Token {
|
|
return &Token{
|
|
Type: tp,
|
|
Value: text,
|
|
}
|
|
}
|