...
- Mixing of '-' (dash) and '.' (dot) separators
- Transition between characters and digits also constitutes a separator:
Wiki Markup 1.0alpha1 => \[1, 0, alpha, 1\]; This fixes '1.0alpha10 < 1.0alpha2'
- Unlimited number of version components
- Version components in the text can be digits or strings
- strings are checked for well-known qualifiers and the qualifier ordering is used for version ordering
- well-known qualifiers (case insensitive)
- snapshot (NOTE; snapshot needs discussion)
- alpha or a
- beta or b
- milestone or m
- rc or cr
- snapshot (NOTE; snapshot needs discussion)
- (the empty string) or ga or final
- sp
- well-known qualifiers (case insensitive)
- version components prefixed with '-' will result in a sub-list of version components.
A dash usually precedes a qualifier, and is always less important than something preceded with a dot.
We need to somehow record the separators themselves, which is done by sublists.
Parse examples:Wiki Markup 1.0-alpha1 => \[1, 0, \["alpha", 1\]\]
Wiki Markup 1.0-rc-2 => \[1, 0, \["rc", \[2\]\]\]
...
Wiki Markup |
---|
<ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="ff5689bd2b1c08d9-182ca50d-418f4324-93c0afc8-e4c14c9f8e7f15c5b586cbe6"><ac:parameter ac:name="">osgi</ac:parameter></ac:structured-macro> \[0\] [OSGi Service Platform Release 4 Version 4.1 Core Specification|http://www.osgi.org/Release4/Download], §3.2.4 "Version" and §3.2.5 "Version Ranges" on page 38, §3.5.3 "Bundle-Version" on page 46, §6.1.26.5 "Version.compareTo()" on page 200 |