This started with just trying to parse the date format:
December 21st, 2013 7:00pm, which was failing with a bad_date error.
The solution involved setting up "Hinted Months", which was just a term
I used to indicate that a month was specified by name (ie "December"),
rather than by number (ie, "12"). Previously, named months were simply
replaced by their respective numbers in the parser. This tags those
named months so that the parser will unambiguously parse them correctly.
A tagged "Hinted Month" is simply a tuple with the tag `?MONTH_TAG`. For
example: "December" gets converted to `{?MONTH_TAG, 12}`
For example: "Aug 12" and "12 Aug". It's clear to the *reader* what is
meant, but when converted to simply 8 and 12, the parser has no way of
knowing which is which.
Doing this was aided with the addition of some macros to help it
along, since doing just straight comparisons with the hinted months was
yielding unexpected results. For example: `{mon, 1} > 31` returns
true, so changing that comparison to an ?is_year/1 macro that does:
`is_integer(Y) andalso Y > 31`.
It might not be a bad idea to help the parser be *very* unambiguous by
putting these macros on all comparisons.
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
* canonical/next:
massively expand the documentation in the README
bring ec_plists up to erlware standards
replace ec_plists with Stephan's plists
add Stephen Marsh's plists to the system
reorder default tasks so dialyzer is run after compile
add a clean and rebuild task to makefile
add fullpath to the makefile
enable the rebar semver plugin on erlware_commons
cleanup the rebar config
support non-numeric versions in major/minor/patch/minor-patch
support reasonable versioning for erlware_commons
add exists to ec_file
fix bug in ec_file:copy/3 spec
export mkdir_p (this should have been done already)
support four primary version numbers of in parsing
minor whitespace cleanup for ec_semver
provide the ability to format a version into a string as well as parse a version
make sure the docs get run as part of a bare make
fixes for edoc compilation
compilation utilities for the implementors
This allows for two things. The first is support for non rigorous
versions. However, it still fully supports semver. So if you have
semver versions they work correctly, if you have alpha versions they
also work correctly but using natural alpha ordering.
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
The OTP Versions distributed with erlang tend to have four version
numbers not three. This is a fairly minor deviation from semver that
we can support. Basically, the semver parser treats the fourth version
in exactly the same way as the other three.
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
* next:
version bump 0.8.0
minor fixes and enhancements to the makefile
given a complete semver parser ec_string no longer makes sense to retain
suport proper semver parsing and comparison in the semver module
move ec_file away from exceptions to return values
minor whitespace cleanup
make sure ec_dictionary gets built first
fixes to dialyzer
add travis support to the system
fix edoc errors in various modules
add a full makefile that drives rebar
add rebar files to gitignore
In an attempt to unify on the accepted use of return values ec_file is
changing its API to use return values instead of exceptions.
Signed-off-by: Jordan Wilberding <diginux@gmail.com>