Slide 11
Slide 11 text
// lex creates a new scanner for the input string.!
func lex(name, input, left, right string) *lexer {!
if left == "" {!
left = leftDelim!
}!
if right == "" {!
right = rightDelim!
}!
l := &lexer{!
name: name,!
input: input,!
leftDelim: left,!
rightDelim: right,!
items: make(chan item),!
}!
go l.run()!
return l!
}