Closed esummers closed 11 years ago
This is definitely a problem. I've done some investigation into automatic handling of "legacy" function-like macros, but haven't been happy with the results yet. We will look into it more.
The "escaped section" is also an interesting idea.
Work in progress can be found in branch "legacy_macros":
https://github.com/eerolanguage/clang-trunk/tree/legacy_macros
Very nice!
Just a quick update on this one: it's still undergoing testing, but looks good overall. It's still in the "legacy_macros" branch for now, and will be merged into master when this issue gets closed. ETA is a couple more days from now.
As of commit e04381ca59 (binary clang-eero-2013-08-09.zip), support for standard CPP macros is greatly improved. No special syntax is needed, they should just work. Parameters are parsed as eero syntax.
Tested with Foundation, ReactiveCocoa (incl 2.0), SenTestingKit, and other macros. Kiwi is more like a DSL, and doesn't work well embedded in eero code. I'll try to work on some workarounds for it. Closing this issue as I think the solution should be adequate for now.
Good work!
Thanks! Please feel free to report any other issues you find.
The biggest problem I encountered playing with EERO is compatibility with CPP macros. This prevents Sen, Kiwi, Reactive Cocoa, etc. from working properly.
I think the obvious solution is to add syntax to escape to standard Objective-C and insert code that would otherwise be invalid in EERO. Ideally EERO should also automatically escape for CPP macros from non-EERO source files so they just work. Parameters to the macros would need to be excluded. This may also be useful for embedding C++ code that would otherwise have problems.
Example: (using "begin_objc { … }" as example syntax)