Add inline comments support to the xcconfig parser#604
Conversation
Codecov Report
@@ Coverage Diff @@
## main #604 +/- ##
=======================================
Coverage 84.24% 84.25%
=======================================
Files 154 154
Lines 8672 8674 +2
=======================================
+ Hits 7306 7308 +2
Misses 1366 1366
Continue to review full report at Codecov.
|
|
Nice fix @dive! |
fortmarek
left a comment
There was a problem hiding this comment.
Nice! This probably will not catch another edge case where the setting is followed by multiline comment /* but I am not sure if that's something we want to account for
@pepibumur, added. Thanks!
@fortmarek, as far as I know, |
|
Thanks @dive for the explanation, makes sense 👍 |
Resolves #602
Short description 📝
Add support for inline comments in
xcconfigfiles.Solution 📦
Extend the existed regular expression to support
xcconfigcomments and use them as a full-stop condition.Implementation 👩💻👨💻
XCConfig.swiftregular expression (settingRegex) extended with a positive lookahead condition as the last statement. Previously, the expression handles the end of the line ('$') as a final grouping statement and now it parses up until the end of the line or up to the comment indication (//) with the(?=$|\\/\\/)group.XCConfigTestswith failing scenariossettingRegexNSRegularExpressionto support commentsXCConfigTestswith edge-casesP.S. You can play with the updated regular expression here.