Consistent whitespace before duration units and imaginary literal. #496
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes two small adjustments to whitespace lexing, one for duration units and the other for imaginary literals.
Duration units whitespace
For duration units, the language specification currently reads:
But this whitespace was not actually supported by the lexer.
This PR adds this support to match the specification.
Imaginary literal whitespace
For imaginary literals, the language specification currently reads:
This is correctly implemented, but it seems inconsistent to only allows spaces here and not tabs. Tabs and spaces are both allowed for units and generally wherever whitespace is allowed.
This PR updates the specification and the lexer to allow tabs in this case too.
Details and comments
The changes to the lexer appear straightforward. Adding tabs to the YAML reference files required the unfortunate use of literal tab characters, but the other options (double quoted YAML blocks) looked worse.