Example #1
0
File: yml_lex.go Project: katis/yml
func okState(l *lex.Lexer) lex.State {
	fmt.Println("okState")
	l.Emit(lex.ItemEOF)
	time.Sleep(10 * time.Millisecond)
	return nil
}
Example #2
0
File: yml_lex.go Project: katis/yml
func endState(l *lex.Lexer) lex.State {
	fmt.Println("endState")
	l.Emit(lex.ItemEOF)
	return nil
}
Example #3
0
File: yml_lex.go Project: katis/yml
func startState(l *lex.Lexer) lex.State {
	l.AcceptRun("abcdefghijklmnopqrstuvwxyz")
	l.Emit(alphas)
	return okState
}