mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
27
plugin/gomark/parser/tokenizer/token.go
Normal file
27
plugin/gomark/parser/tokenizer/token.go
Normal file
@@ -0,0 +1,27 @@
|
||||
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,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user