diff options
author | rsc <devnull@localhost> | 2004-04-20 01:42:20 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-04-20 01:42:20 +0000 |
commit | e637c944febf271252e59742aa108d6e0a527eb7 (patch) | |
tree | e4ace5415b3b978ceca3685d2ea3eebe855a9b76 /src/cmd/acid/print.c | |
parent | a196bf0577767d97165f01186b32b0913430a1fe (diff) | |
download | plan9port-e637c944febf271252e59742aa108d6e0a527eb7.tar.gz plan9port-e637c944febf271252e59742aa108d6e0a527eb7.tar.bz2 plan9port-e637c944febf271252e59742aa108d6e0a527eb7.zip |
i hate []
Diffstat (limited to 'src/cmd/acid/print.c')
-rw-r--r-- | src/cmd/acid/print.c | 62 |
1 files changed, 35 insertions, 27 deletions
diff --git a/src/cmd/acid/print.c b/src/cmd/acid/print.c index 00d7b737..96021037 100644 --- a/src/cmd/acid/print.c +++ b/src/cmd/acid/print.c @@ -6,39 +6,47 @@ #define Extern extern #include "acid.h" -static char *binop[] = +static char *binop[NUMO]; + +static void +initbinop(void) { - [OMUL] "*", - [ODIV] "/", - [OMOD] "%", - [OADD] "+", - [OSUB] "-", - [ORSH] ">>", - [OLSH] "<<", - [OLT] "<", - [OGT] ">", - [OLEQ] "<=", - [OGEQ] ">=", - [OEQ] "==", - [ONEQ] "!=", - [OLAND] "&", - [OXOR] "^", - [OLOR] "|", - [OCAND] "&&", - [OCOR] "||", - [OASGN] " = ", + binop[OMUL]= "*"; + binop[ODIV]= "/"; + binop[OMOD]= "%"; + binop[OADD]= "+"; + binop[OSUB]= "-"; + binop[ORSH]= ">>"; + binop[OLSH]= "<<"; + binop[OLT]= "<"; + binop[OGT]= ">"; + binop[OLEQ]= "<="; + binop[OGEQ]= ">="; + binop[OEQ]= "=="; + binop[ONEQ]= "!="; + binop[OLAND]= "&"; + binop[OXOR]= "^"; + binop[OLOR]= "|"; + binop[OCAND]= "&&"; + binop[OCOR]= "||"; + binop[OASGN]= " = "; }; static char *tabs = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; -char *typenames[] = -{ - [TINT] "integer", - [TFLOAT] "float", - [TSTRING] "string", - [TLIST] "list", - [TCODE] "code", +char *typenames[] = { + "integer", + "float", + "string", + "list", + "code", }; +void +initprint(void) +{ + initbinop(); +} + int cmp(const void *va, const void *vb) { |