MiniLexer

master

A teeny-tiny-weeny lexer written in Swift available as a Swift Package.
LuizZak/MiniLexer

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.

Description

  • Swift Tools 5.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Oct 25 2024 01:45:33 GMT-0900 (Hawaii-Aleutian Daylight Time)