Improve parsing of literal numbers, to include invalid representations

These are then reported as a SemanticError.
Resolves #2595
Merge pull request #2623 from cleishm/improved-literal-number-parsing

Improve parsing of literal numbers, to include invalid representations