aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/pp.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-10-13 19:06:52 +0200
committerlemon <lsof@mailbox.org>2025-10-13 19:09:48 +0200
commit9812f88a9a612144bea02c7acf499867eb0cbeb9 (patch)
tree0575b7c6b6b72b0683c4ffae108292b3d44998be /test/pp.c
parent3048a0b59baae16727d0c259353ff4be1ae559b4 (diff)
implement most of preprocessor
- concatenation (##) - builtin macros (__FILE__ etc) - fails in some edge cases, and code needs cleanup - add embedded system include files (stddef.h, stdarg.h for now) - can handle stdio.h now
Diffstat (limited to 'test/pp.c')
-rw-r--r--test/pp.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/pp.c b/test/pp.c
index 1c1549f..0aa5287 100644
--- a/test/pp.c
+++ b/test/pp.c
@@ -1,12 +1,24 @@
#include "pp.h"
#include "pp.h"
+#include <stddef.h>
+#include <stdio.h>
+//
+#define CATl(a) a##bar
+#define CATr(a) foo##a
+#define CAT(a,b) a##b
+
int
main(void)
{
+ int CATl(foo);
+ ++foobar;
+ --CATr(bar);
+ CAT(foo,bar) += 3;
printf("%s %s\n",STR ( ok /1 "\n"n ;.&
05.5), STR(ADD(1,2)));
hi(ADD(Foo, SQR(Bar+1)));
- printf("%s %s\n", str(Foo), xstr(Foo));
+ int foo123 = 77;
+ printf("%s %s %g\n", str(Foo,5), xstr(Foo), CAT(1.5,e3f) + CAT(7,)-CAT(1,));
}