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

How to use C language include "test.nut" similar function #256

Open
9844201 opened this issue Sep 17, 2022 · 5 comments
Open

How to use C language include "test.nut" similar function #256

9844201 opened this issue Sep 17, 2022 · 5 comments

Comments

@9844201
Copy link

9844201 commented Sep 17, 2022

I like it so much
How to use C language include "test.nut" similar function

@albertodemichelis
Copy link
Owner

you need a C preprocessor

@zeromus
Copy link
Contributor

zeromus commented Nov 17, 2022

You could implement preprocessing in squirrel, too! Only the person feeding a script to the compiler truly knows how to find other referenced scripts. But it might be good if squirrel had a way to set #line and #file for producing debug data. Not that I'm suggesting it, just thinking out loud.

@albertodemichelis
Copy link
Owner

albertodemichelis commented Nov 17, 2022

I though about it a number of time #include is propably not a good idea to be built in in the language. However #line and #file would be very useful for a DSL that spit out squirrel and wants to retain debugging.

@albertodemichelis
Copy link
Owner

I think the major issue is that the dubug information as is now, assumes 1 source file per SQFunction.

@RizzoRat
Copy link

maybe allow #include only outside any class or function - or generally bracket closure?
(The main problem why we implemented a workaround-include are ENUMs and constants, whereas constants at least have their consttable, ENUMs are bound to compilerruntime and hence just don't work across files at all - so we now can "include" 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

4 participants