-
Notifications
You must be signed in to change notification settings - Fork 30
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
fypp with pypy throwing a FyppFatalError/NameError #32
Comments
Some more context: This happens on a conda-forge feedstock but only for See here for reference: conda-forge/mhm-feedstock#15 |
Thanks, it seems I can reproduce it, after installing pypy with Conda on x86/Linux, I get the same error message. I have not the slightest idea, why this happens, I'd have to check the details... |
I think the smallest reproducer is: program t
print *, ${NAME}$
end program Trying to fyppifying this with: $> fypp -DNAME=hello test.fypp
error: exception at evaluating 'hello' in definition for 'NAME' [FyppFatalError]
error: name 'hello' is not defined [NameError] The problem is that The solution is something obscure like this: $> fypp -DNAME="'hello'" test.fypp to fully escape the name as a string (either single string will be shell-resolved and not passed to I don't know of an elegant solution other than automatically stringifying anything it doesn't name-resolve, but even then it is problematic because you don't know whether it should be a name, or whether it really should be a string. |
Yes, Fypp currently evaluates everything after the Would that be something which would make your life easier? |
Oh, yes, I actually thought of this, thinking I shouldn't propose it !!! ;) haha... I think this could be nice, in particular the delimiters required for string handling in cmake projects are annoying, but not only that, it is also error prone, say if the user them-selves put in quotation that gets caught by cmake, what should one do then? My thought on initial variable names would be:
Might have omitted some? Or are some just overkill? |
That's definitely an overkill, and brought me to change my mind about the converters. 😆 My suggestion would be to implement the As an example, given the file
The command
results in
Note, the quotation in the command above is only needed to prevent bash to evaluate the square brackets... |
Agreed, let's keep it simple, the |
When using fypp with pypy, I get the following strange error:
(file from Fortran stdlib)
Don't know what goes wrong here...
The text was updated successfully, but these errors were encountered: