[swift-users] CRLF-line parsing library

Daryle Walker darylew at mac.com
Sun Dec 24 02:27:53 CST 2017


Since parsing lines along CR and/or LF breaks seems very common in the text processing code I read, I’ve decided to make my own speciality code for that purpose before  the next phase of my plans. Right now, it’s at a branch <https://github.com/CTMacUser/InternetLines/tree/develop>, and I need fresh sets of eyes to help out.

* Someone to see if a Linux version would work, and can test.
* The option-click pop-up on the “purge” method shows blank spots for the parameters of the closure parameter. The source has explanations for those inner parameters, but I can’t figure out how to get the markup to show them.
* The code in the Data extension that handles CR and LF being in separate sub-blocks hasn’t been tested. A sample could only be created with DispaatchData, but that type IS-NOT-A Data, although that relationship exists in their Objective-C equivalents. Testing that would require heroic measures with mixed Objective-C code. If someone wants to try that, and make it work with the Swift Package Manager, a pull request would be appreciated. Otherwise, we have to wait until the bug in Foundation is fixed. (Discussed on the Cocoa-Dev list. rdar:36204480 <rdar:36204480>)
* The Read-Me doesn’t match what I’ve seen of SPM project read-me files on GitHub. It needs to be redone, with examples in the Installation and Usage sections. A pull request here would be REALLY appreciated.

It deals in units of Data, not String. Any conversions will have to be applied after parsing. It recognizes not only CRLF, but CR-only, LF-only, and CRCRLF (which is generally created by mistake).

— 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20171224/4c7df5c1/attachment.html>


More information about the swift-users mailing list