MCPcopy Create free account
hub / github.com/CloudyKit/jet / lex

Function lex

lex.go:274–289  ·  view source on GitHub ↗

lex creates a new scanner for the input string.

(name, input string, run bool)

Source from the content-addressed store, hash-verified

272
273// lex creates a new scanner for the input string.
274func lex(name, input string, run bool) *lexer {
275 l := &lexer{
276 name: name,
277 input: input,
278 items: make(chan item),
279 leftDelim: defaultLeftDelim,
280 rightDelim: defaultRightDelim,
281 leftComment: defaultLeftComment,
282 rightComment: defaultRightComment,
283 trimRightDelim: rightTrimMarker + defaultRightDelim,
284 }
285 if run {
286 l.run()
287 }
288 return l
289}
290
291// run runs the state machine for the lexer.
292func (l *lexer) run() {

Callers 3

lexerTestCaseFunction · 0.85
parseMethod · 0.85

Calls 1

runMethod · 0.95

Tested by 2

lexerTestCaseFunction · 0.68