BSD 4 development
[unix-history] / usr / src / cmd / awk / awk.def
index 7de49fc..dedd24a 100644 (file)
@@ -1,11 +1,13 @@
-#define        xfree(a)        { if(a!=NULL) yfree(a); a=NULL;}
+#define hack   int
+#define        AWKFLOAT        float
+#define        xfree(a)        { if(a!=NULL) { yfree(a); a=NULL;} }
 #define yfree free
 #ifdef DEBUG
 #      define  dprintf if(dbg)printf
 #else
 #      define  dprintf(x1, x2, x3, x4)
 #endif
 #define yfree free
 #ifdef DEBUG
 #      define  dprintf if(dbg)printf
 #else
 #      define  dprintf(x1, x2, x3, x4)
 #endif
-typedef        double  awkfloat;
+typedef        AWKFLOAT        awkfloat;
 
 extern char    **FS;
 extern char    **RS;
 
 extern char    **FS;
 extern char    **RS;
@@ -107,7 +109,7 @@ extern obj  true, false;
 extern int     pairstack[], paircnt;
 
 #define cantexec(n)    (n->ntype == NVALUE)
 extern int     pairstack[], paircnt;
 
 #define cantexec(n)    (n->ntype == NVALUE)
-#define notlegal(n)    (proctab[n-FIRSTTOKEN]== nullproc)
+#define notlegal(n)    (n <= FIRSTTOKEN || n >= LASTTOKEN || proctab[n-FIRSTTOKEN]== nullproc)
 #define isexpr(n)      (n->ntype == NEXPR)
 #define isjump(n)      (n.otype == OJUMP)
 #define isexit(n)      (n.otype == OJUMP && n.osub == JEXIT)
 #define isexpr(n)      (n->ntype == NEXPR)
 #define isjump(n)      (n.otype == OJUMP)
 #define isexit(n)      (n.otype == OJUMP && n.osub == JEXIT)
@@ -122,6 +124,6 @@ extern int  pairstack[], paircnt;
 obj    nullproc();
 obj    relop();
 
 obj    nullproc();
 obj    relop();
 
-#define MAXSYM 16
+#define MAXSYM 50
 #define        HAT     0177    /* matches ^ in regular expr */
                        /* watch out for mach dep */
 #define        HAT     0177    /* matches ^ in regular expr */
                        /* watch out for mach dep */