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

Parameter substitution in template extras are broken #99

Open
nicopap opened this issue Oct 11, 2023 · 0 comments
Open

Parameter substitution in template extras are broken #99

nicopap opened this issue Oct 11, 2023 · 0 comments
Labels
C-chirp relates to the cuicui_chirp file format crate specifically T-bug Something isn't working

Comments

@nicopap
Copy link
Owner

nicopap commented Oct 11, 2023

Variable scoping is still flaky.

Reproducible example chirp file

In the following code, width in green_row should be replaced by

fn button(width_rule, button_text) {
    Button(focus row rules(width_rule, 30px)) {
        ButtonText(text(button_text))
    }
}

fn long_button(text) { button!(80%, text) }

fn green_row(name, width, neg_width) {
    Entity(row rules(99%, 35px)) {
        long_button!(Go to right menu)(rules(width, 30px) named(name))
        Entity(row menu(name) bg(#FFFFFF20) rules(neg_width, 100%) main_margin(3.)) {
            Entity(width(0%))
            square_button!(1)
            square_button!(2)
            square_button!(3)
            Entity(width(0%))
        }
    }
}

RootRoot(column screen_root) {
    green_row!(green_1, 50%, 49%)
}

I get this error:

Error:   × Rule format was not recognized: 'width', rules end with '%', '*' or 'px'. Examples:
  │ '53%', '0.35*' and '1024px'
    ╭─[ultimate_menu.chirp:35:1]
 35 │ fn green_row(name, width, neg_width) {
 36 │     Entity(row rules(99%, 35px)) {
 37 │         long_button!(Go to right menu)(rules(width, 30px) named(name))
    ·                                              ───────────
 38 │         Entity(row menu(name) bg(#FFFFFF20) rules(neg_width, 100%) main_margin(3.)) {
 39 │             Entity(width(0%))
    ╰────
  help: The error comes from the ParseDsl implementation.
@nicopap nicopap added T-bug Something isn't working C-chirp relates to the cuicui_chirp file format crate specifically labels Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-chirp relates to the cuicui_chirp file format crate specifically T-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant