Skip to content

Commit f2d5cea

Browse files
author
Joshua Goller
committed
fix decl output to match cdecl and move src to common to allow compiling
1 parent a6303d6 commit f2d5cea

File tree

5 files changed

+3
-3
lines changed

5 files changed

+3
-3
lines changed
File renamed without changes.

ch-5/decl/src/dirdecl.c ch-5/decl/src/common/dirdecl.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ int dirdecl(void) {
3434
strcat(out, " of");
3535
break;
3636
case '(':
37-
strcat(out, " function with args (");
37+
strcat(out, " function (");
3838
char args[] = {" "};
3939
while ((args[0] = (char)getchar()) != ')') {
4040
strcat(out, args);
4141
}
42-
type = PARENS;
42+
// type = PARENS;
4343
strcpy(token, "()");
4444
strcat(out, ") returning");
4545
break;
File renamed without changes.
File renamed without changes.

ch-5/decl/src/decl-main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ int main() {
99
}
1010
out[0] = '\0';
1111
if (decl() == 0) {
12-
printf("declare %s as %s %s\n", name, out, datatype);
12+
printf("declare %s as%s %s\n", name, out, datatype);
1313
return 0;
1414
} else {
1515
return -1;

0 commit comments

Comments
 (0)