Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Changed canconvertreturn behaviour. | a1ba7f1d59cc40f56d0b3e4855c31b3d66019d9d | lep | 2015-04-15 16:35:52 |
Rewrote string handling to better handle newlines. | 434a8fe566783969cb69eb73b2792cd74dac71d3 | lep | 2015-02-12 15:13:54 |
Rewrote rawcode handling for somewhat better error messages. | 1e687d921b09149e244d16d7abca398c0639ad6d | lep | 2015-02-08 20:08:22 |
Undefined variables are not suggested for other undefined variables. | c5561c56dde18bbcf1d05bdec7b50804757c5ef8 | lep | 2015-02-08 15:39:10 |
Also changed gNone to gAny in else and elesif cases. | 485e75aaa14eb8ae10058305f7b75c1abd19eb82 | lep | 2015-02-06 15:20:15 |
Changed statement default return type from gNone to gAny. | 7a054ad7b62d77ae4a17ac97d913a19675dad111 | lep | 2015-02-06 15:12:31 |
Propagate returncheck through statements. | b8977b07e11f8fd335851e3a2d69cb473492f85b | lep | 2015-02-06 15:07:36 |
Small changes. Removed some unused symbols. | 83c8b2b0e6811380bddf6e92e3b2f843370d5e05 | lep | 2015-02-05 12:43:24 |
Only put locals into the initialized table. | db20d22434506716774fa4e8577f98073f17d6c2 | lep | 2015-02-04 11:57:00 |
Changed min function to min makro. | b5b6c824896935232743633ae57d060e5c6a046f | lep | 2015-02-04 11:33:14 |
Rewrote the hashtable. | 55c0f9ae7d284df88c48e7c2ac1c547cda1d802a | lep | 2015-02-04 11:24:53 |
Fixed some memory violations. | 26a99d799804d8154c4ee1aa0850cdaad909d1ae | lep | 2015-02-03 23:27:32 |
Reverted smth. | dbd5c217795cf5cd014ed7370655e62591d4d0fe | lep | 2015-02-03 22:12:49 |
Changed sprintf to snprintf. | 02d6efe2aed9186b2e6189b36a5fa50d2e0c2221 | lep | 2015-02-03 21:33:05 |
Wrapped typenode member accesses in getTypePtr. | 372c1f9da68a65de9e14dff3881e1758d5e7114b | lep | 2015-02-03 21:05:11 |
Added ifdefs for memalign functionality. | f005f5e8067994ebd76265e3289e6ab67283b96f | lep | 2015-02-03 20:06:20 |
Missing-return check in elseifs should work now. | 4274d6166e2c92a4591c1e46a0d71f1579a57c7d | lep | 2015-02-03 19:35:39 |
Missing-return checks also checks elseifs. | 889122b0fb788663c728127520d0e7124c2a040c | lep | 2015-02-03 15:18:12 |
Fixed some more warnings. | a5ae36b5299ac419a91592b60b8fcb1dfd8f4374 | lep | 2015-02-03 13:24:56 |
Added early exit to editdistance function. | 82e8d024392d357d56c833c6b7f7632ffd6830a8 | lep | 2015-02-02 16:13:40 |
File | Lines added | Lines deleted |
---|---|---|
Makefile | 10 | 28 |
Makefile.Whatever | 0 | 25 |
Makefile.cygwin | 0 | 25 |
misc.c | 22 | 15 |
misc.h | 1 | 1 |
pjass.res | 0 | 0 |
File Makefile changed (mode: 100644) (index d833c0c..5c2f5a7) | |||
1 | CC=gcc.exe | ||
2 | RESHCK=Reshack\Reshacker.exe | ||
1 | CC=gcc | ||
2 | CFLAGS=-w | ||
3 | |||
4 | .PHONY: all | ||
3 | 5 | ||
4 | 6 | all: pjass | all: pjass |
5 | 7 | ||
6 | pjass: lex.yy.c grammar.tab.c grammar.tab.h misc.o | ||
7 | $(CC) lex.yy.c grammar.tab.c misc.c -o $@ -O2 -mno-cygwin | ||
8 | $(RESHCK) -addskip $@.exe, $@.exe, pjass.res ,,, | ||
8 | pjass: lex.yy.c grammar.tab.c grammar.tab.h misc.c misc.h | ||
9 | $(CC) $(CFLAGS) lex.yy.c grammar.tab.c misc.c -o $@ -O2 -DVERSIONSTR="\"git-$(shell git rev-parse --short HEAD)\"" | ||
10 | |||
9 | 11 | ||
10 | 12 | lex.yy.c: token.l | lex.yy.c: token.l |
11 | 13 | flex $< | flex $< |
12 | 14 | ||
13 | grammar.tab.c: grammar.y | ||
14 | bison -o grammar.tab.c $< | ||
15 | |||
16 | grammar.tab.h: grammar.y | ||
17 | bison -d -o grammar.tab $< | ||
18 | |||
19 | %.o: %.c | ||
20 | $(CC) $< -c | ||
15 | %.tab.c %.tab.h: grammar.y | ||
16 | bison -d $< | ||
21 | 17 | ||
22 | 18 | clean: | clean: |
23 | del grammar.tab.h | ||
24 | del grammar.tab.c | ||
25 | del lex.yy.c | ||
26 | del misc.o | ||
27 | del pjass.exe | ||
28 | |||
29 | t: | ||
30 | ./pjass <t.txt | ||
31 | |||
32 | package: | ||
33 | tar Ccvfz ../ jass2.tar.gz jass2/Makefile jass2/grammar.y jass2/token.l jass2/misc.c jass2/misc.h jass2/readme.txt | ||
34 | |||
35 | binpackage: | ||
36 | rm -f PJASS.zip ; pkzip -a pjass.zip ../doc/readme.txt ./pjass.exe ; mv -f PJASS.zip pjass-bin-091-win32.zip | ||
37 | |||
19 | rm grammar.tab.h grammar.tab.c lex.yy.c pjass.exe |
File Makefile.Whatever deleted (index 04f5f4c..0000000) | |||
1 | all: pjass | ||
2 | |||
3 | pjass: lex.yy.c grammar.tab.c grammar.tab.h misc.o | ||
4 | gcc -O2 lex.yy.c grammar.tab.c misc.c -lfl -o $@ | ||
5 | |||
6 | lex.yy.c: token.l | ||
7 | flex $< | ||
8 | |||
9 | grammar.tab.c: grammar.y | ||
10 | bison $< | ||
11 | |||
12 | grammar.tab.h: grammar.y | ||
13 | bison -d $< | ||
14 | |||
15 | clean: | ||
16 | del grammar.tab.h | ||
17 | del grammar.tab.c | ||
18 | del lex.yy.c | ||
19 | del pjass.exe | ||
20 | |||
21 | t: | ||
22 | ./pjass <t.txt | ||
23 | |||
24 | package: | ||
25 | tar Ccvfz ../ jass2.tar.gz jass2/Makefile jass2/grammar.y jass2/token.l jass2/misc.c jass2/misc.h jass2/readme.txt |
File Makefile.cygwin deleted (index 2da1e03..0000000) | |||
1 | all: pjass | ||
2 | |||
3 | pjass: lex.yy.c grammar.tab.c grammar.tab.h misc.o | ||
4 | gcc lex.yy.c grammar.tab.c misc.c -o $@ -O2 -mno-cygwin -lfl | ||
5 | |||
6 | lex.yy.c: token.l | ||
7 | flex $< | ||
8 | |||
9 | grammar.tab.c: grammar.y | ||
10 | bison $< | ||
11 | |||
12 | grammar.tab.h: grammar.y | ||
13 | bison -d $< | ||
14 | |||
15 | clean: | ||
16 | rm grammar.tab.h grammar.tab.c lex.yy.c pjass.exe pjass | ||
17 | |||
18 | t: | ||
19 | ./pjass <t.txt | ||
20 | |||
21 | package: | ||
22 | tar Ccvfz ../ jass2.tar.gz jass2/Makefile jass2/grammar.y jass2/token.l jass2/misc.c jass2/misc.h jass2/readme.txt | ||
23 | |||
24 | binpackage: | ||
25 | rm -f PJASS.zip ; pkzip -a pjass.zip ../doc/readme.txt ./pjass.exe ; mv -f PJASS.zip pjass-bin-091-win32.zip |
File misc.c changed (mode: 100644) (index 8447f57..a30ea43) | |||
... | ... | int isDerivedFrom(const struct typenode *cur, const struct typenode *base) | |
321 | 321 | do { | do { |
322 | 322 | if (typeeq(cur, base)) return 1; | if (typeeq(cur, base)) return 1; |
323 | 323 | cur = getTypePtr(cur)->superclass; | cur = getTypePtr(cur)->superclass; |
324 | } while (cur); | ||
324 | } while (getTypePtr(cur)); | ||
325 | 325 | return 0; | return 0; |
326 | 326 | } | } |
327 | 327 | ||
... | ... | int canconvert(const struct typenode *ufrom, const struct typenode *uto, const i | |
536 | 536 | } | } |
537 | 537 | ||
538 | 538 | // this is used for return statements only | // this is used for return statements only |
539 | int canconvertreturn(const struct typenode *ufrom, const struct typenode *uto, const int linemod) | ||
539 | void canconvertreturn(const struct typenode *ufrom, const struct typenode *uto, const int linemod) | ||
540 | 540 | { | { |
541 | 541 | const struct typenode *from = ufrom, *to = uto; | const struct typenode *from = ufrom, *to = uto; |
542 | 542 | char ebuf[1024]; | char ebuf[1024]; |
543 | 543 | if (from == NULL || to == NULL) | if (from == NULL || to == NULL) |
544 | return 0; // garbage | ||
544 | return; // garbage | ||
545 | |||
545 | 546 | if (typeeq(from, gAny) || typeeq(to, gAny)) | if (typeeq(from, gAny) || typeeq(to, gAny)) |
546 | return 1; // we don't care | ||
547 | return; // we don't care | ||
548 | |||
547 | 549 | if (isDerivedFrom(from, to)) | if (isDerivedFrom(from, to)) |
548 | return 1; // eg. from = unit, to = handle | ||
550 | return; // eg. from = unit, to = handle | ||
551 | |||
549 | 552 | //if (isDerivedFrom(to, from)) | //if (isDerivedFrom(to, from)) |
550 | 553 | // return 1; // blizzard bug allows downcasting erroneously, we don't support this though | // return 1; // blizzard bug allows downcasting erroneously, we don't support this though |
551 | 554 | if (getTypePtr(from)->typename == NULL || getTypePtr(to)->typename == NULL) | if (getTypePtr(from)->typename == NULL || getTypePtr(to)->typename == NULL) |
552 | return 0; // garbage | ||
555 | return; // garbage | ||
556 | |||
553 | 557 | if (typeeq(from, gNone) || typeeq(to, gNone)) | if (typeeq(from, gNone) || typeeq(to, gNone)) |
554 | return 0; // garbage | ||
558 | return; // garbage | ||
559 | |||
555 | 560 | ||
556 | 561 | from = getPrimitiveAncestor(from); | from = getPrimitiveAncestor(from); |
557 | 562 | to = getPrimitiveAncestor(to); | to = getPrimitiveAncestor(to); |
... | ... | int canconvertreturn(const struct typenode *ufrom, const struct typenode *uto, c | |
559 | 564 | // can't return integer when it expects a real (added 9.5.2005) | // can't return integer when it expects a real (added 9.5.2005) |
560 | 565 | snprintf(ebuf, 1024, "Cannot convert returned value from %s to %s", getTypePtr(from)->typename, getTypePtr(to)->typename); | snprintf(ebuf, 1024, "Cannot convert returned value from %s to %s", getTypePtr(from)->typename, getTypePtr(to)->typename); |
561 | 566 | yyerrorline(1, lineno + linemod, ebuf); | yyerrorline(1, lineno + linemod, ebuf); |
562 | return 0; | ||
567 | return; | ||
563 | 568 | } | } |
569 | |||
564 | 570 | if ((typeeq(from, gNull)) && (!typeeq(to, gInteger)) && (!typeeq(to, gReal)) && (!typeeq(to, gBoolean))) | if ((typeeq(from, gNull)) && (!typeeq(to, gInteger)) && (!typeeq(to, gReal)) && (!typeeq(to, gBoolean))) |
565 | return 1; // can't return null when it expects integer, real or boolean (added 9.5.2005) | ||
571 | return; // can't return null when it expects integer, real or boolean (added 9.5.2005) | ||
566 | 572 | ||
567 | 573 | if (strict) { | if (strict) { |
568 | if (isDerivedFrom(uto, ufrom)) | ||
569 | return 1; | ||
570 | } else if (typeeq(from, to)) | ||
571 | return 1; | ||
572 | |||
574 | if (isDerivedFrom(ufrom, uto)) | ||
575 | return; | ||
576 | } else if (typeeq(ufrom, uto)){ | ||
577 | return; | ||
578 | } | ||
579 | |||
573 | 580 | snprintf(ebuf, 1024, "Cannot convert returned value from %s to %s", getTypePtr(ufrom)->typename, getTypePtr(uto)->typename); | snprintf(ebuf, 1024, "Cannot convert returned value from %s to %s", getTypePtr(ufrom)->typename, getTypePtr(uto)->typename); |
574 | 581 | yyerrorline(1, lineno + linemod, ebuf); | yyerrorline(1, lineno + linemod, ebuf); |
575 | return 0; | ||
582 | return; | ||
576 | 583 | } | } |
577 | 584 | ||
578 | 585 | struct typenode* mkretty(struct typenode *ty, int ret){ | struct typenode* mkretty(struct typenode *ty, int ret){ |
File misc.h changed (mode: 100644) (index 8fa8b32..36f9e24) | |||
... | ... | struct funcdecl *newfuncdecl(); | |
72 | 72 | void showfuncdecl(struct funcdecl *fd); | void showfuncdecl(struct funcdecl *fd); |
73 | 73 | struct typenode *binop(const struct typenode *a, const struct typenode *b); | struct typenode *binop(const struct typenode *a, const struct typenode *b); |
74 | 74 | int canconvert(const struct typenode *from, const struct typenode *to, const int linemod); | int canconvert(const struct typenode *from, const struct typenode *to, const int linemod); |
75 | int canconvertreturn(const struct typenode *from, const struct typenode *to, const int linemod); | ||
75 | void canconvertreturn(const struct typenode *from, const struct typenode *to, const int linemod); | ||
76 | 76 | struct typenode* mkretty(struct typenode *ty, int ret); | struct typenode* mkretty(struct typenode *ty, int ret); |
77 | 77 | struct typenode* getTypePtr(struct typenode *ty); | struct typenode* getTypePtr(struct typenode *ty); |
78 | 78 | int getTypeTag(struct typenode *ty); | int getTypeTag(struct typenode *ty); |
File pjass.res deleted (index c8efdbf..0000000) |