// digitsOrMinus consumes either a sequence of digits or the single // char '-' followed by a space. func digitsOrMinus(l *lexrec.Lexer, t lexrec.ItemType, emit bool) (success bool) { if l.AcceptRun(digits) || (l.Accept("-") && l.Peek() == ' ') { if emit { l.Emit(t) } else { l.Skip() } return true } l.Errorf("expected a '-' or a sequence of %q, got %q", digits, l.Peek()) return false }