mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
.developing preprocessor
git-svn-id: svn://ultimatepp.org/upp/trunk@8156 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
9588f09099
commit
5193e84ff2
3 changed files with 10 additions and 7 deletions
|
|
@ -250,6 +250,12 @@ String Cpp::Preprocess(Stream& in, bool needresult)
|
|||
result.Cat("\n");
|
||||
if(strncmp(s + 1, "define", 6) == 0)
|
||||
Define(s + 7);
|
||||
else
|
||||
if(strncmp(s + 1, "undef", 5) == 0) {
|
||||
CParser p(s + 6);
|
||||
if(p.IsId())
|
||||
macro.UnlinkKey(p.ReadId());
|
||||
}
|
||||
}
|
||||
else
|
||||
if(needresult)
|
||||
|
|
|
|||
|
|
@ -5,13 +5,6 @@
|
|||
|
||||
using namespace Upp;
|
||||
|
||||
class CT {
|
||||
public:
|
||||
struct ST : Moveable<ST> {
|
||||
int x, y;
|
||||
};
|
||||
};
|
||||
|
||||
struct CppMacro : Moveable<CppMacro> {
|
||||
String body;
|
||||
Index<String> param;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@ TEST second line
|
|||
|
||||
TEST // TEST
|
||||
|
||||
#undef TEST
|
||||
|
||||
This should not be expanded, it was undefined: TEST
|
||||
|
||||
#define __Expand1(x) x(1)
|
||||
#define __Expand2(x) __Expand1(x) x(2)
|
||||
#define __Expand3(x) __Expand2(x) x(3)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue