MCPcopy
hub / github.com/cortesi/modd / lexOptions

Function lexOptions

conf/lex.go:446–463  ·  view source on GitHub ↗

lexOptions lexes the options that precede a command specification.

(l *lexer)

Source from the content-addressed store, hash-verified

444
445// lexOptions lexes the options that precede a command specification.
446func lexOptions(l *lexer) stateFn {
447 for {
448 n := l.next()
449 if any(n, spaces) {
450 l.acceptRun(spaces)
451 l.emit(itemSpace)
452 } else if n == ':' {
453 l.emit(itemColon)
454 return lexCommand
455 } else if n == '+' {
456 l.acceptWord()
457 l.emit(itemBareString)
458 } else {
459 l.errorf("invalid command option")
460 return nil
461 }
462 }
463}
464
465// lexCommand lexes a single command. Commands can either be unquoted and on a
466// single line, or quoted and span multiple lines.

Callers

nothing calls this directly

Calls 6

anyFunction · 0.85
acceptRunMethod · 0.80
emitMethod · 0.80
acceptWordMethod · 0.80
nextMethod · 0.45
errorfMethod · 0.45

Tested by

no test coverage detected