Scanner update: Character-based; kind-type removal; unit tests - #187
Merged
Conversation
In namelists, endlines have no semantic meaning (outside of strings, and even that is tricky), so the line-based iteration was a bit unintuitive in some places. And the comment line-complete optimization made less sense, since we want the endline and following whitespace to join the comment token. In order to better align with these facts, and line-based logic has been dropped and the iterator is now solely per-character.
First draft of a few scanner unit tests. Needs work. Several new tests by Codex (but needs polishing) Also found some bugs :O
The simpler nature of multiline strings in namelists, along with other changes in the DFA machine, mean that we no longer need to check against \n when running the Unicode KeyError exception test. This block has been simplified and the endline is no longer tested.
Kind-type specification with _ is not supported in either namelists or list-directed IO. This tokenization was leftover from the Fortran scanner. This patch eliminates this content. Tests have been added to ensure that lexemes like `1_8` are not formed.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #187 +/- ##
==========================================
+ Coverage 97.21% 97.63% +0.42%
==========================================
Files 9 10 +1
Lines 2152 2666 +514
Branches 358 466 +108
==========================================
+ Hits 2092 2603 +511
- Misses 35 36 +1
- Partials 25 27 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a minor update to the scanner parser: