aboutsummaryrefslogtreecommitdiffstats
path: root/awk.h
diff options
context:
space:
mode:
Diffstat (limited to 'awk.h')
-rw-r--r--awk.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/awk.h b/awk.h
index e3f458b2..6f0f5163 100644
--- a/awk.h
+++ b/awk.h
@@ -49,9 +49,7 @@
#include <stdio.h>
#include <assert.h>
-#ifdef HAVE_LIMITS_H
#include <limits.h>
-#endif /* HAVE_LIMITS_H */
#include <ctype.h>
#include <setjmp.h>
@@ -71,11 +69,8 @@
#endif
#endif
-#if defined(HAVE_STDARG_H)
#include <stdarg.h>
-#else
-#error "gawk no longer supports <varargs.h>. Please update your compiler and runtime"
-#endif
+#include <stdbool.h>
#include <signal.h>
#include <time.h>
#include <errno.h>
@@ -87,11 +82,6 @@ extern int errno;
#include <stdlib.h>
#endif /* not STDC_HEADERS */
-#ifdef HAVE_STDBOOL_H
-#include <stdbool.h>
-#else
-#include "missing_d/gawkbool.h"
-#endif
/* We can handle multibyte strings. */
#include <wchar.h>
@@ -306,6 +296,12 @@ typedef union bucket_item {
} hi;
} BUCKET;
+enum commenttype {
+ EOL_COMMENT = 1,
+ BLOCK_COMMENT,
+ FOR_COMMENT // special case
+};
+
/* string hash table */
#define ahnext hs.next
#define ahname hs.name /* a string index node */
@@ -350,6 +346,7 @@ typedef struct exp_node {
struct exp_node *extra;
void (*aptr)(void);
long xl;
+ void *cmnt; // used by pretty printer
} x;
char *name;
size_t reserved;
@@ -378,6 +375,7 @@ typedef struct exp_node {
wchar_t *wsp;
size_t wslen;
struct exp_node *typre;
+ enum commenttype comtype;
} val;
} sub;
NODETYPE type;
@@ -575,9 +573,7 @@ typedef struct exp_node {
#define alevel sub.nodep.x.xl
/* Op_comment */
-#define comment_type sub.val.idx
-#define EOL_COMMENT 1
-#define FULL_COMMENT 2
+#define comment_type sub.val.comtype
/* --------------------------------lint warning types----------------------------*/
typedef enum lintvals {
@@ -774,6 +770,7 @@ typedef struct exp_instruction {
awk_ext_func_t *exf;
} x;
+ struct exp_instruction *comment;
short source_line;
short pool_size; // memory management in symbol.c
OPCODE opcode;
@@ -1019,6 +1016,7 @@ typedef struct srcfile {
char *lexeme;
char *lexptr_begin;
int lasttok;
+ INSTRUCTION *comment; /* comment on @load line */
} SRCFILE;
// structure for INSTRUCTION pool, needed mainly for debugger