Swiftpack.co - LuizZak/MiniLexer as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by LuizZak.
LuizZak/MiniLexer 0.11.0
A teeny-tiny-weeny lexer written in Swift available as a Swift Package.
⭐️ 4
🕓 3 years ago
.package(url: "https://github.com/LuizZak/MiniLexer.git", from: "0.11.0")

MiniLexer

Build Status

A teeny-tiny-weeny lexer written in Swift available as a Swift Package.
Should be present in any programmer-who-likes-to-write-quick-script's toolbelt.

Sample usage:

let text = "123 test"
let lexer = Lexer(input: text)

do {
    let oneTwoThree = try lexer.parseInt()
    lexer.skipWhitespace()
    let test = try lexer.nextIdent()
    
    print("\(oneTwoThree) \(test)")
} catch {
    print("Oopsie! Error: \(error)")
}

There's also a sample URL-parsing example under Sources/URLParseSample, with tests over at Tests/URLParseSampleTests.

GitHub

link
Stars: 4
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics