Enable durations to be specified without “” marks

This commit is contained in:
Tobie Morgan Hitchcock 2016-11-04 10:04:55 +00:00
parent 4d9f9b297e
commit b5c8b21eb6

View file

@ -547,6 +547,10 @@ func (s *scanner) scanNumber(chp ...rune) (tok Token, lit string, val interface{
}
}
if val, err := time.ParseDuration(buf.String()); err == nil {
return DURATION, buf.String(), val
}
return tok, buf.String(), nil
}