Swap definitions of isWhitespace and isSpace #27
Closed
+6
−6
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.
Previously, the behavior of
isWhitespace
did not match what was stated in the documentation:Previously, the behavior of
isSpace
did not match what was stated in the documentation:A strict reading of the documentation for
isSpace
would indicate that it should only match on ASCII value 32 (true space). The change made here will cause it to match only a true space or a tab.I realize this is a breaking change. It is the action recommended in the issue report:
arduino/Arduino#7041 (comment)
The alternative is to leave the code as-is and correct the documentation, which I am happy to do if the decision goes that way.
There is also the question of how
isSpace
should work. I can make it match on space, and not on tab if that's preferable. If left as it currently is in this PR, the documentation will need to be updated (once the updated code has been released) to indicate that it also matches on tab.I'm submitting the PR to this repo as it seems that ArduinoCore-API should now act as the model for the non-architecture specific code in other cores until the time comes for them to transition to using ArduinoCore-API directly. If accepted here, I can submit the equivalent pull requests to the other core repositories.
Fixes arduino/Arduino#7041
Reference: http://forum.arduino.cc/index.php?topic=597290
Demonstration sketch: