X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=blobdiff_plain;f=csrc%2Findent_test.mdc;h=960f63eb8122a2b8791952498e5c7b42832d2029;hp=7e4f95627a57096a6c1982a960330916a9171145;hb=86e54542650f7f72a04c70618e07091f905398c8;hpb=35d743c48140ea96fa56c3f63ee8dd0e032cbb2d diff --git a/csrc/indent_test.mdc b/csrc/indent_test.mdc index 7e4f956..960f63e 100644 --- a/csrc/indent_test.mdc +++ b/csrc/indent_test.mdc @@ -4,17 +4,16 @@ simple assignments with expressions, and then prints out the same with complete bracketing and indenting. # File: indent_test.mk - myCFLAGS := -Wall -g -fplan9-extensions - CFLAGS := $(filter-out $(myCFLAGS),$(CFLAGS)) $(myCFLAGS) - myLDLIBS:= libparser.o libscanner.o libmdcode.o -licuuc - LDLIBS := $(filter-out $(myLDLIBS),$(LDLIBS)) $(myLDLIBS) + itestCFLAGS := -Wall -g -fplan9-extensions + itestLDLIBS:= libparser.o libscanner.o libmdcode.o -licuuc all :: itest - itest.c itest.h : indent_test.mdc parsergen libparser.o libscanner.o libmdcode.o + itest.c itest.h : indent_test.mdc parsergen ./parsergen -o itest --LALR --tag indent indent_test.mdc indent_test.mk: indent_test.mdc md2c ./md2c indent_test.mdc - itest: itest.c + itest: itest.c | $(filter %.o,$(itestLDLIBS)) + $(CC) $(itestCFLAGS) $^ $(itestLDLIBS) -o $@ doitest: itest itest.code ./itest itest.code @@ -138,8 +137,10 @@ with complete bracketing and indenting. Program -> Statementlist ${ print_statement($1, 0); }$ $*statement + Newlines -> NEWLINE + | Newlines NEWLINE Statementlist -> Statements ${ $0 = $<1; }$ - | NEWLINE Statementlist ${ $0 = $<2; }$ + | Newlines Statements ${ $0 = $<2; }$ Statements -> Statements Statement ${ { @@ -155,9 +156,9 @@ $*statement | ERROR ${ printf("statement ERROR\n"); $0 = NULL; }$ Open -> { - | NEWLINE Open + | Newlines { Close -> } - | NEWLINE Close + | Newlines } Block -> Open Statementlist Close ${ $0 = $<2; }$ | Open SimpleStatements } ${ $0 = $<2; }$ | : SimpleStatements ${ $0 = $<2; }$