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

Can I avoid "#include <iostream>" being preprocessed ? #24

Open
aachenhang opened this issue Apr 21, 2017 · 3 comments
Open

Can I avoid "#include <iostream>" being preprocessed ? #24

aachenhang opened this issue Apr 21, 2017 · 3 comments

Comments

@aachenhang
Copy link

If I don't want to preprocess the "#include" and instead want to simply copy it to the output file, what can I do?

@mjspncr
Copy link
Owner

mjspncr commented Apr 23, 2017

Typically you put your include directives in

#hdr
copied verbatim to top of header file
#end

or

#src
copied verbatim to top of cpp file
#end

Note you can put these lines anywhere in the lzz file. Include directives outside these blocks are processed by lzz -- but just to pull in macros. You might want to do this if you have macros that expand to function or class definitions for example.

@brokenbeta
Copy link

Since it seems like this is a very common pattern, would you be open to an abbreviated syntax that only takes up a single line?

#src #include "foo.h"
#src include "foo.h"
#srcinclude "foo.h"

or similar?

@mjspncr
Copy link
Owner

mjspncr commented May 1, 2017

Yeah, kind of neat. Could say anything after #src goes to source file .. last 2 options could just be special case of the first.

@mjspncr mjspncr reopened this May 1, 2017
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

3 participants