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

nested functions and macros aren't picked up #39

Closed
expipiplus1 opened this issue Oct 24, 2024 · 4 comments
Closed

nested functions and macros aren't picked up #39

expipiplus1 opened this issue Oct 24, 2024 · 4 comments

Comments

@expipiplus1
Copy link

This for examples warns about an unknown function bar

function(foo)
    macro(bar)
    endmacro()
    bar()
endfunction()
@BlankSpruce
Copy link
Owner

Is there a repository that I could clone and experiment with that use-case? I'd like to evaluate whether it's worth to interpret these nested commands. I'm afraid it could lead to warnings like shown here when those nested definitions reuse names:

function(foo1)
    macro(bar)
    endmacro()
    bar()
endfunction()

function(foo2)
    macro(bar)
    endmacro()
    bar()
endfunction()

@expipiplus1
Copy link
Author

Sure check out https://github.com/shader-slang/slang there's a script calling gersemi here: shader-slang/slang@f1da05f (#5409)

@BlankSpruce
Copy link
Owner

Fixed in 0.17.0.

I've noticed in extras/formatting.sh that you're listing CMake files with git ls-files but it's probably not necessary because gersemi was always capable to search these patterns in passed directories itself. I've extended --help so it's a little bit more obvious.

@expipiplus1
Copy link
Author

ah, thanks, but in this case I specifically didn't want to format files in submodules

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

2 participants