all :: itest
itest.c itest.h : indent_test.mdc parsergen
./parsergen -o itest --LALR --tag indent indent_test.mdc
- indent_test.mk: indent_test.mdc md2c
+ indent_test.mk itest.code: indent_test.mdc md2c
./md2c indent_test.mdc
itest: itest.c | $(filter %.o,$(itestLDLIBS))
$(CC) $(itestCFLAGS) $^ $(itestLDLIBS) -o $@
./itest itest.code
checkitest: itest itest.code
@grep -v '^#' itest.out > .tmp.out
- @./itest itest.code | diff -u - .tmp.out || echo itest FAILED
+ @./itest itest.code | diff -u .tmp.out - || echo itest FAILED
@sed -e 'i\
' itest.code > itest2.code
- @./itest itest2.code| diff -u - .tmp.out || echo itest2 FAILED
+ @./itest itest2.code| diff -u .tmp.out - || echo itest2 FAILED
demos :: doitest
tests :: checkitest
# indent: header
- ./parsergen -o itest --LALR indent_test.cgm
- cc -o itest itest.c lib*.o -licuuc -lgmp
- ./itest itest.code
-
struct expression {
struct text op;
struct expression *left, *right;
else if cond2:
there1 =x
there1a=x
+ if cond + cond2 :
+ hello = x;
+ hello2 = x;
+
+ sum = val +
+ val;
+
+ if condX:
+ foo = x *
+ x +
+ y
+ / two;
+ else if cond2:
+ there1 =x
+ there1a=x
there2=x
there3=x;
all = y;
if a:
if b:
c= d
+ else:
+ f=g
x = y
# File: itest.out
(mister=no);
(there=x);
(all=y);
+ if (cond+cond2):
+ (hello=x);
+ (hello2=x);
+ (sum=(val+val));
+ if condX:
+ (foo=((x*x)+(y/two)));
+ else:
+ if cond2:
+ (there1=x);
+ (there1a=x);
if (cond+cond2):
(hello=x);
(hello2=x);
if a:
if b:
(c=d);
+ else:
+ (f=g);
(x=y);