basho / cuttlefish

never lose your childlike sense of wonder baby cuttlefish, promise me?
Apache License 2.0
205 stars 124 forks source link

Permit zero in cuttlefish duration datatype #229

Open joecaswell opened 7 years ago

joecaswell commented 7 years ago

When parsing a duration, the current regular expression for "integer" prohibits values that have a leading '0'. This also include the value "0ms", such as in the AAE throttle setting anti_entropy.throttle.tier1.delay = 0ms.

The list_to_integer call in the integer definition deals with the leading zeros properly. However, if it is desired to prohibit leading zeros for aesthetic reasons while permitting the value '0ms', the regular expression ( ([1-9] [0-9]* ) / "0" ) can be used.