GithubHelp home page GithubHelp logo

kodlian / swiftregexdsl Goto Github PK

View Code? Open in Web Editor NEW
149.0 3.0 5.0 55 KB

A Declarative Structured Language for regular expressions in Swift.

License: MIT License

Swift 100.00%
swift regex resultbuilder functionbuilder dsl

swiftregexdsl's People

Contributors

barnard-b avatar kodlian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

swiftregexdsl's Issues

Cannot find type 'StaticRegex' in scope

The latest commit f54bd19 adding the missing public initializers changed the type of the changed structs from Regex to StaticRegex.

Unfortunately the Type Definition for StaticRegex seems to be missing from the package causing 13 compiler errors:

Cannot find type 'StaticRegex' in scope

'Digit' initializer is inaccessible due to 'internal' protection level

using the following code in a test app, importing the SwiftRegexDSL Package does not work

import SwiftRegexDSL

struct Number:Regex{
    var body: Regex{
        Digit()
            .oneOrMore()
    }
}

and results in the following compiler error:
'Digit' initializer is inaccessible due to 'internal' protection level

Default initializers in Swift are declared internal and can't be accessed from outside the package.

Unfortunately this means you have to manually add a public memberwise initializer to all structs using a default one now (digit is only one example)

Implicit @RegexBuilder

The body property in the Regex protocol can be annotated with @RegexBuilder so that conforming types implicitly get a regex-built body.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.