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

mini-language: parsing error with a combination of functions and "this" #2731

Open
oliver-sanders opened this issue Oct 19, 2023 · 0 comments
Labels

Comments

@oliver-sanders
Copy link
Member

oliver-sanders commented Oct 19, 2023

A niche interaction between:

  • fail-if statements which use this
  • functions such as any()
  • the duplicate=true metadata configuration

Reproducible Example

This example:

# meta/rose-meta.conf

[namelist:a]                                                                                                 
duplicate=true                        
                         
[namelist:a=var]    
fail-if=any(this == "foo")
length=:   
# rose-app.conf

[namelist:a]                                                                                                 
var=foo     

Will fail validation:

$ rose macro -V
[V] rose.macros.DefaultValidators: issues: 2
    namelist:a=None=None
        incorrect "duplicate=true" metadata
    namelist:a=var=foo
        failed because: any(this == "foo")

Whereas this example:

# rose-app.conf

[namelist:a(1)]                                                                                                                    
var=foo 

Will not:

$ rose macro -V

Cause

From inspection it would appear the REC_CONFIG_ID regex is including the opening bracket in the varible name.

I.E. it is matching:

(namelist:a(1)=var(1)

Rather than:

namelist:a(1)=var(1)

Due to some, curious, logic, this error gets swallowed rather than resulting in traceback.

Workaround

Replace this with the full name of the config.

# meta/rose-meta.conf

[namelist:a]                                                                                                 
duplicate=true                        
                         
[namelist:a=var]    
fail-if=any(namelist:a=var == "foo")
length=:   
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant