Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAPIONAccessGenerator referencing values #11

Open
yoyosource opened this issue Nov 7, 2022 · 0 comments
Open

YAPIONAccessGenerator referencing values #11

yoyosource opened this issue Nov 7, 2022 · 0 comments

Comments

@yoyosource
Copy link
Owner

yoyosource commented Nov 7, 2022

While writing a config I came across a mayor flaw writing them:

{
    @name(Config)
    colors!{
        background!{
            @type(STRING)
            constraints(c -> c.matches("#[0-9a-fA-F]{6}"))
            default("#333333")
        }
        hover!{
            @type(STRING)
            constraints(c -> c.matches("#[0-9a-fA-F]{6}"))
            default("#636363")
        }
        text!{
            @type(STRING)
            constraints(c -> c.matches("#[0-9a-fA-F]{6}"))
            default("#636363")
        }
    }
    nameOrder(STRING[])
}

There are many duplicates of the same thing. Maybe there should be a way to extract the common part from them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant