Skip to content

swift-primitives/swift-parser-primitives

Parser Primitives

Development Status

Parser combinator primitives for Swift — 37 narrow modules spanning byte parsers, combinators (always, backtrack, conditional, constraint, filter, first, lazy, many, not, oneOf, optional, peek, prefix, rest, skip, span, take), and tracing/locating utilities. Each module ships as its own product so consumers depend on exactly the surface they need.

Installation

Add the dependency to your Package.swift:

dependencies: [
    .package(url: "https://github.com/swift-primitives/swift-parser-primitives.git", branch: "main")
]

Pre-1.0: no version tags yet. APIs may change; pin a commit for reproducible builds.

Add the umbrella product to your target (re-exports every module):

.target(
    name: "YourTarget",
    dependencies: [
        .product(name: "Parser Primitives", package: "swift-parser-primitives")
    ]
)

For narrower compile-time surface, depend on individual variant products such as Parser Match Primitives, Parser Span Primitives, or Parser Constraint Primitives. The full product list is in Package.swift.

Requires Swift 6.2+.

License

Apache 2.0. See LICENSE.

About

Byte-oriented parser combinators split into narrow, independently importable modules for Swift.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages