diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2011-07-15 15:35:34 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2011-07-15 15:35:34 +0300 |
commit | 46f2db24d9e7f792f60149f5ee89ef4f22e3f4a9 (patch) | |
tree | 4522982b751d8643ee05022e60bdac757dfd0956 /awk.h | |
parent | 84658669a180b3f1e63d20b6ea166f7c5733786b (diff) | |
download | egawk-46f2db24d9e7f792f60149f5ee89ef4f22e3f4a9.tar.gz egawk-46f2db24d9e7f792f60149f5ee89ef4f22e3f4a9.tar.bz2 egawk-46f2db24d9e7f792f60149f5ee89ef4f22e3f4a9.zip |
Fix gsub losing white space when working on fields.
Diffstat (limited to 'awk.h')
-rw-r--r-- | awk.h | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -521,6 +521,7 @@ typedef enum opcodeval { Op_K_nextfile, Op_builtin, + Op_sub_builtin, /* sub, gsub and gensub */ Op_in_array, /* boolean test of membership in array */ /* function call instruction */ @@ -626,6 +627,16 @@ typedef struct exp_instruction { #define target_jmp d.di #define target_break x.xi +/* Op_sub_builtin */ +#define sub_flags d.dl +#define GSUB 0x01 /* builtin is gsub */ +#define GENSUB 0x02 /* builtin is gensub */ +#define AFTER_ASSIGN 0x04 /* (g)sub target is a field or a special var with + * set_XX routine. + */ +#define LITERAL 0x08 /* target is a literal string */ + + /* Op_K_exit */ #define target_end d.di #define target_atexit x.xi @@ -1181,9 +1192,7 @@ extern NODE *do_cos(int nargs); extern NODE *do_rand(int nargs); extern NODE *do_srand(int nargs); extern NODE *do_match(int nargs); -extern NODE *do_gsub(int nargs); -extern NODE *do_sub(int nargs); -extern NODE *do_gensub(int nargs); +extern NODE *do_sub(int nargs, unsigned int flags, int *num_matches); extern NODE *format_tree(const char *, size_t, NODE **, long); extern NODE *do_lshift(int nargs); extern NODE *do_rshift(int nargs); |