git.haldean.org wallbot / 304b5d7
remove old test haldean 3 years ago
2 changed file(s) with 1 addition(s) and 33 deletion(s). Raw diff Collapse all Expand all
44
55 libmeka.a: meka.o
66 $(AR) rcs $@ $<
7
8 test/tokenize: test/tokenize.o libmeka.a
9 $(CC) $(MEKA_CFLAGS) -o $@ $^
107
118 test/pack: test/pack.o libmeka.a
129 $(CC) $(MEKA_CFLAGS) -o $@ $^
3330 test/pack.o \
3431 test/parse \
3532 test/parse.d \
36 test/parse.o \
37 test/tokenize \
38 test/tokenize.d \
39 test/tokenize.o
33 test/parse.o
4034
4135 .PHONY: clean
+0
-26
lang/test/tokenize.c less more
0 #include <inttypes.h>
1 #include <stdio.h>
2 #include "meka.h"
3
4 #define BUF_SIZE 65536
5 static char buf[BUF_SIZE];
6
7 int
8 main()
9 {
10 struct meka_source source;
11 struct meka_token tok;
12 size_t n;
13
14 n = fread(buf, 1, BUF_SIZE, stdin);
15 source.buf = buf;
16 source.next = source.buf;
17 source.end = source.buf + n;
18
19 while (meka_next_token(&tok, &source))
20 {
21 fwrite(tok.data, 1, tok.len, stdout);
22 printf(" (%" PRIuLEAST16 ")\n", tok.len);
23 }
24 return 0;
25 }