Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type (
Val string
Line int
Col int
Position int
TrimWhitespaces bool
}
)
Expand Down Expand Up @@ -107,7 +108,7 @@ func (t *Token) String() string {
typ, t.Typ, val, t.Line, t.Col, t.TrimWhitespaces)
}

func lex(name string, input string) ([]*Token, *Error) {
func Lex(name string, input string) ([]*Token, *Error) {
l := &lexer{
name: name,
input: input,
Expand Down Expand Up @@ -146,6 +147,7 @@ func (l *lexer) emit(t TokenType) {
Val: l.value(),
Line: l.startline,
Col: l.startcol,
Position: l.pos,
}

if t == TokenString {
Expand Down
2 changes: 1 addition & 1 deletion template.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func newTemplate(set *TemplateSet, name string, isTplString bool, tpl []byte) (*
t.Options.Update(set.Options)

// Tokenize it
tokens, err := lex(name, strTpl)
tokens, err := Lex(name, strTpl)
if err != nil {
return nil, err
}
Expand Down