diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-07-02 18:55:00 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-07-02 18:55:00 +0200 |
commit | 37ae8cdc6e428e68ad76f6b446881ecff305ebd3 (patch) | |
tree | 88068a460ac9846caec742c19d2b36d97af9a50c | |
parent | 47d9133896f0de6b17393309193051e4bd52015e (diff) | |
download | busybox-w32-37ae8cdc6e428e68ad76f6b446881ecff305ebd3.tar.gz busybox-w32-37ae8cdc6e428e68ad76f6b446881ecff305ebd3.tar.bz2 busybox-w32-37ae8cdc6e428e68ad76f6b446881ecff305ebd3.zip |
awk: beautify builtins table, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | editors/awk.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/editors/awk.c b/editors/awk.c index 1925e0771..8d7777ca6 100644 --- a/editors/awk.c +++ b/editors/awk.c | |||
@@ -464,11 +464,12 @@ static const uint32_t tokeninfo[] ALIGN4 = { | |||
464 | // OC_B's are builtins with enforced minimum number of arguments (two upper bits). | 464 | // OC_B's are builtins with enforced minimum number of arguments (two upper bits). |
465 | // Highest byte bit pattern: nn s3s2s1 v3v2v1 | 465 | // Highest byte bit pattern: nn s3s2s1 v3v2v1 |
466 | // nn - min. number of args, sN - resolve Nth arg to string, vN - resolve to var | 466 | // nn - min. number of args, sN - resolve Nth arg to string, vN - resolve to var |
467 | // OC_FBLTIN's are builtins with zero or one argument. | 467 | // OC_F's are builtins with zero or one argument. |
468 | // |Rx| enforces that arg is present for: system, close, cos, sin, exp, int, log, sqrt. | 468 | // |Rx| enforces that arg is present for: system, close, cos, sin, exp, int, log, sqrt. |
469 | // Check for no args is present in builtins' code (not in this table): rand, systime. | 469 | // Check for no args is present in builtins' code (not in this table): rand, systime. |
470 | // Have one _optional_ arg: fflush, srand, length | 470 | // Have one _optional_ arg: fflush, srand, length |
471 | #define OC_B OC_BUILTIN | 471 | #define OC_B OC_BUILTIN |
472 | #define OC_F OC_FBLTIN | ||
472 | #define A1 P(0x40) /*one arg*/ | 473 | #define A1 P(0x40) /*one arg*/ |
473 | #define A2 P(0x80) /*two args*/ | 474 | #define A2 P(0x80) /*two args*/ |
474 | #define A3 P(0xc0) /*three args*/ | 475 | #define A3 P(0xc0) /*three args*/ |
@@ -480,17 +481,17 @@ static const uint32_t tokeninfo[] ALIGN4 = { | |||
480 | #define _ss_vv P(0x1b) | 481 | #define _ss_vv P(0x1b) |
481 | #define _s_vv_ P(0x16) | 482 | #define _s_vv_ P(0x16) |
482 | #define ss_vv_ P(0x36) | 483 | #define ss_vv_ P(0x36) |
483 | OC_B|B_an|_vv|A2, OC_B|B_co|__v|A1, OC_B|B_ls|_vv|A2, OC_B|B_or|_vv|A2, // and compl lshift or | 484 | OC_B|B_an|_vv|A2, OC_B|B_co|__v|A1, OC_B|B_ls|_vv|A2, OC_B|B_or|_vv|A2, // and compl lshift or |
484 | OC_B|B_rs|_vv|A2, OC_B|B_xo|_vv|A2, // rshift xor | 485 | OC_B|B_rs|_vv|A2, OC_B|B_xo|_vv|A2, // rshift xor |
485 | OC_FBLTIN|Sx|Rx|F_cl,OC_FBLTIN|Sx|Rx|F_sy,OC_FBLTIN|Sx|F_ff, OC_B|B_a2|_vv|A2, // close system fflush atan2 | 486 | OC_F|F_cl|Sx|Rx, OC_F|F_sy|Sx|Rx, OC_F|F_ff|Sx, OC_B|B_a2|_vv|A2, // close system fflush atan2 |
486 | OC_FBLTIN|Nx|Rx|F_co,OC_FBLTIN|Nx|Rx|F_ex,OC_FBLTIN|Nx|Rx|F_in,OC_FBLTIN|Nx|Rx|F_lg,// cos exp int log | 487 | OC_F|F_co|Nx|Rx, OC_F|F_ex|Nx|Rx, OC_F|F_in|Nx|Rx, OC_F|F_lg|Nx|Rx, // cos exp int log |
487 | OC_FBLTIN|F_rn, OC_FBLTIN|Nx|Rx|F_si,OC_FBLTIN|Nx|Rx|F_sq,OC_FBLTIN|Nx|F_sr, // rand sin sqrt srand | 488 | OC_F|F_rn, OC_F|F_si|Nx|Rx, OC_F|F_sq|Nx|Rx, OC_F|F_sr|Nx, // rand sin sqrt srand |
488 | OC_B|B_ge|_s_vv_|A3, OC_B|B_gs|ss_vv_|A2, OC_B|B_ix|_ss_vv|A2, // gensub gsub index /*length was here*/ | 489 | OC_B|B_ge|_s_vv_|A3,OC_B|B_gs|ss_vv_|A2,OC_B|B_ix|_ss_vv|A2, // gensub gsub index /*length was here*/ |
489 | OC_B|B_ma|__s__v|A2, OC_B|B_sp|__s_vv|A2, OC_SPRINTF, OC_B|B_su|ss_vv_|A2, // match split sprintf sub | 490 | OC_B|B_ma|__s__v|A2,OC_B|B_sp|__s_vv|A2,OC_SPRINTF, OC_B|B_su|ss_vv_|A2,// match split sprintf sub |
490 | OC_B|B_ss|__svvv|A2, OC_FBLTIN|F_ti, OC_B|B_ti|__s_vv, OC_B|B_mt|__s_vv, // substr systime strftime mktime | 491 | OC_B|B_ss|__svvv|A2,OC_F|F_ti, OC_B|B_ti|__s_vv, OC_B|B_mt|__s_vv, // substr systime strftime mktime |
491 | OC_B|B_lo|__s__v|A1, OC_B|B_up|__s__v|A1, // tolower toupper | 492 | OC_B|B_lo|__s__v|A1,OC_B|B_up|__s__v|A1, // tolower toupper |
492 | OC_FBLTIN|Sx|F_le, // length | 493 | OC_F|F_le|Sx, // length |
493 | OC_GETLINE|SV, // getline | 494 | OC_GETLINE|SV, // getline |
494 | 0, 0, // func function | 495 | 0, 0, // func function |
495 | 0, // BEGIN | 496 | 0, // BEGIN |
496 | 0 // END | 497 | 0 // END |
@@ -498,6 +499,7 @@ static const uint32_t tokeninfo[] ALIGN4 = { | |||
498 | #undef A2 | 499 | #undef A2 |
499 | #undef A3 | 500 | #undef A3 |
500 | #undef OC_B | 501 | #undef OC_B |
502 | #undef OC_F | ||
501 | }; | 503 | }; |
502 | 504 | ||
503 | /* internal variable names and their initial values */ | 505 | /* internal variable names and their initial values */ |