Extract version parsing function out of parse-semantic-version.

Enables parsing of the semantic version without triggering an abort
in case of a parse failure.

Fix typo.
Merge pull request #1640 from phalphalak/separate-control-flow-from-version-parsing

Extract version parsing function out of parse-semantic-version.