removed Warnings of non-standard Characters#390
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #390 +/- ##
==========================================
+ Coverage 52.03% 52.10% +0.06%
==========================================
Files 37 37
Lines 5994 5990 -4
Branches 644 642 -2
==========================================
+ Hits 3119 3121 +2
+ Misses 2231 2227 -4
+ Partials 644 642 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Here's a suggestion for the quoting. It's not the most clever implementation, but I think it's pretty predicable: Everything stays exactly as it is, but any entity name (!) can be quoted now. This makes it possible to have names with the forbidden characters Examples of what should work now:
I guess this would also allow names with spaces. I realized that we're not well prepared for non-ASCII names, as we're parsing every name into a |
|
That's great! Thanks. To your last point though: |
|
Didn't we have a long discussion about this for the .janno file, back then, where we realized that |
|
OK, thanks for linking the Post again. It's indeed more complex than I thought to encode Unicode with Having said this, I have no problem with switching to |
stschiff
left a comment
There was a problem hiding this comment.
OK, I left some inline comments. I don't understand P.skipMany (P.char '-') in L200 of EntityTypes.
| parseNameAndVer = do | ||
| namePart <- parseNamePart "" | ||
| namePart <- parseQuoted <|> parseNamePart "" | ||
| P.skipMany (P.char '-') -- for quoted case, where - is not yet handled |
There was a problem hiding this comment.
I'm very confused about this line. What exactly are we skipping here? Minuses? But they work fine in your tests...
There was a problem hiding this comment.
This is about the minus that separates the package name and the package version (for entities like **2029_Schiffels_Sulawesi-1.0.0*).
Look at the code before the confusing line: namePart <- parseQuoted <|> parseNamePart ""
parseNamePart is the old solution. It automatically consumes the - separating namePart and versionPart (if the versionPart exists) in the code following case nextChar of.
parseQuoted does not consume anything outside of the quotes, so the - stays there. So as the comment says for quoted case, where - is not yet handled we have to P.skipMany (P.char '-').
This is a trivial PR that simply removes the warnings for non-standard characters in PoseidonIDs and Group_Names.
@nevrome if you want you could try to implement a smarter forging language here that allows optional quoting, so that even names with non-standard characters can be used. If not, then this PR simply removes the warnings.