mirror of
https://github.com/unidoc/unioffice.git
synced 2025-05-01 13:48:55 +08:00
23 lines
316 B
Go
23 lines
316 B
Go
![]() |
package format
|
||
|
|
||
|
import (
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
type Lexer struct {
|
||
|
fmt Format
|
||
|
formats []Format
|
||
|
}
|
||
|
|
||
|
func (l *Lexer) nextFmt() {
|
||
|
l.formats = append(l.formats, l.fmt)
|
||
|
l.fmt = Format{}
|
||
|
}
|
||
|
|
||
|
func Parse(s string) []Format {
|
||
|
l := Lexer{}
|
||
|
l.Lex(strings.NewReader(s))
|
||
|
l.formats = append(l.formats, l.fmt)
|
||
|
return l.formats
|
||
|
}
|