1.0.10 • Published 2 years ago

nv-cli-ascii-cmmn-char v1.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

nv-cli-ascii-cmmn-char

  • cli-tool
  • generate some one-line function FOR ascii cmmn-chars (32-127)
  • used for TEST nvlang DSL building tools
  • normally USESLESS

install

  • npm install nv-cli-ascii-cmmn-char -g

usage

example

            nv-cli-ascii-cmmn-char# nv_cli_ascii_cmmn_char -a 
            module.exports = {
                is_upper_a2z     = (c) => (c>=65 && c<=90),
                is_lower_a2z     = (c) => (c>=97 && c<=122),
                is_a2z           = (c) => is_upper_a2z(c) || is_lower_a2z(c),
                is_digit         = (c) => c>=48 && c <=57,
                is_name_body     = (c) => is_a2z(c) || is_digit(c) || is_lodash(c),
                is_dev_name_head = (c) => is_a2z(c) || is_lodash(c),
                is_nv_name_body  = (c) => is_lower_a2z(c) || is_digit(c) || is_lodash(c),
            }

            nv-cli-ascii-cmmn-char# nv_cli_ascii_cmmn_char -a  -c
            const is_upper_a2z     = (c) => (c>=65 && c<=90);
            const is_lower_a2z     = (c) => (c>=97 && c<=122);
            const is_a2z           = (c) => is_upper_a2z(c) || is_lower_a2z(c);
            const is_digit         = (c) => c>=48 && c <=57;
            const is_name_body     = (c) => is_a2z(c) || is_digit(c) || is_lodash(c);
            const is_dev_name_head = (c) => is_a2z(c) || is_lodash(c);
            const is_nv_name_body  = (c) => is_lower_a2z(c) || is_digit(c) || is_lodash(c);
            nv-cli-ascii-cmmn-char# 

            nv-cli-ascii-cmmn-char# nv_cli_ascii_cmmn_char -B
            module.exports = {
                is_paren     : (c) => is_lp(c)     || is_rp(c),
                is_bracket   : (c) => is_lbk(c)    || is_rbk(c),
                is_brace     : (c) => is_lbc(c)    || is_rbc(c),
                is_pkc_blk   : (c) => is_paren(c)  || is_bracket(c) || is_brace(c),
                is_pkc_lb    : (c) => is_lp(c) || is_lbk(c) || is_lbc(c),
                is_pkc_rb    : (c) => is_rp(c) || is_rbk(c) || is_rbc(c),
                is_arrow_blk : (c) => is_lt(c)  || is_gt(c),
                is_pkca_blk  : (c) => is_pkc_blk(c) || is_arrow_blk(c),
                is_pkca_lb   : (c) => is_lt(c) || is_pkc_lb(c),
                is_pkca_rb   : (c) => is_gt(c) || is_pkc_rb(c),
                /*--*/
                get_pkc_lb  : (c) => is_rp(c)?40:(is_rbk(c)?91:(is_rbc(c)?123:-1)),
                get_pkca_lb : (c) => is_gt(c)?60:pkc_lb(c),
                get_pkc_rb  : (c) => is_lp(c)?41:(is_lbk(c)?93:(is_lbc(c)?125:-1)),
                get_pkca_rb : (c) => is_lt(c)?62:pkc_rb(c),
            }

            nv-cli-ascii-cmmn-char#
            nv-cli-ascii-cmmn-char# nv_cli_ascii_cmmn_char -B -c
            const is_paren     = (c) => is_lp(c)     || is_rp(c);
            const is_bracket   = (c) => is_lbk(c)    || is_rbk(c);
            const is_brace     = (c) => is_lbc(c)    || is_rbc(c);
            const is_pkc_blk   = (c) => is_paren(c)  || is_bracket(c) || is_brace(c);
            const is_pkc_lb    = (c) => is_lp(c) || is_lbk(c) || is_lbc(c);
            const is_pkc_rb    = (c) => is_rp(c) || is_rbk(c) || is_rbc(c);
            const is_arrow_blk = (c) => is_lt(c)  || is_gt(c);
            const is_pkca_blk  = (c) => is_pkc_blk(c) || is_arrow_blk(c);
            const is_pkca_lb   = (c) => is_lt(c) || is_pkc_lb(c);
            const is_pkca_rb   = (c) => is_gt(c) || is_pkc_rb(c);
            /*--*/
            const get_pkc_lb  = (c) => is_rp(c)?40:(is_rbk(c)?91:(is_rbc(c)?123:-1));
            const get_pkca_lb = (c) => is_gt(c)?60:pkc_lb(c);
            const get_pkc_rb  = (c) => is_lp(c)?41:(is_lbk(c)?93:(is_lbc(c)?125:-1));
            const get_pkca_rb = (c) => is_lt(c)?62:pkc_rb(c);
            nv-cli-ascii-cmmn-char#

        nv-cli-ascii-cmmn-char# nv_cli_ascii_cmmn_char -b -s 65 90 97 122
           is_$upper_a_upper_z$lower_a_lower_z : (c) => (c>=65 && c<=90) || (c>=97 && c<=122),
       nv-cli-ascii-cmmn-char# nv_cli_ascii_cmmn_char -b -s 65 90 97 122 -c 
           const is_$upper_a_upper_z$lower_a_lower_z = (c) => (c>=65 && c<=90) || (c>=97 && c<=122);
          

            nv-cli-ascii-cmmn-char# nv_cli_ascii_cmmn_char -x -c

            //alias: is_$del :
            const codify_to_slashx = (c) => '\\x' + c.toString(16);
            const is_slash_x = (c) => (c === 127);

       nv-cli-ascii-cmmn-char# -o -s lod  esc -c -f is_xxx
       const is_xxx = (c === 95) || (c === 92);

        nv-cli-ascii-cmmn-char# nv_cli_ascii_cmmn_char -s upp  

            module.exports = {
                is_upper_a : (c) => c===65 ,
                is_upper_b : (c) => c===66 ,
                is_upper_c : (c) => c===67 ,
                is_upper_d : (c) => c===68 ,
                is_upper_e : (c) => c===69 ,
                is_upper_f : (c) => c===70 ,
                is_upper_g : (c) => c===71 ,
                is_upper_h : (c) => c===72 ,
                is_upper_i : (c) => c===73 ,
                is_upper_j : (c) => c===74 ,
                is_upper_k : (c) => c===75 ,
                is_upper_l : (c) => c===76 ,
                is_upper_m : (c) => c===77 ,
                is_upper_n : (c) => c===78 ,
                is_upper_o : (c) => c===79 ,
                is_upper_p : (c) => c===80 ,
                is_upper_q : (c) => c===81 ,
                is_upper_r : (c) => c===82 ,
                is_upper_s : (c) => c===83 ,
                is_upper_t : (c) => c===84 ,
                is_upper_u : (c) => c===85 ,
                is_upper_v : (c) => c===86 ,
                is_upper_w : (c) => c===87 ,
                is_upper_x : (c) => c===88 ,
                is_upper_y : (c) => c===89 ,
                is_upper_z : (c) => c===90 ,
            }

        nv-cli-ascii-cmmn-char# nv_cli_ascii_cmmn_char -c -s upp 

            const is_upper_a = (c) => c===65 ;
            const is_upper_b = (c) => c===66 ;
            const is_upper_c = (c) => c===67 ;
            const is_upper_d = (c) => c===68 ;
            const is_upper_e = (c) => c===69 ;
            const is_upper_f = (c) => c===70 ;
            const is_upper_g = (c) => c===71 ;
            const is_upper_h = (c) => c===72 ;
            const is_upper_i = (c) => c===73 ;
            const is_upper_j = (c) => c===74 ;
            const is_upper_k = (c) => c===75 ;
            const is_upper_l = (c) => c===76 ;
            const is_upper_m = (c) => c===77 ;
            const is_upper_n = (c) => c===78 ;
            const is_upper_o = (c) => c===79 ;
            const is_upper_p = (c) => c===80 ;
            const is_upper_q = (c) => c===81 ;
            const is_upper_r = (c) => c===82 ;
            const is_upper_s = (c) => c===83 ;
            const is_upper_t = (c) => c===84 ;
            const is_upper_u = (c) => c===85 ;
            const is_upper_v = (c) => c===86 ;
            const is_upper_w = (c) => c===87 ;
            const is_upper_x = (c) => c===88 ;
            const is_upper_y = (c) => c===89 ;
            const is_upper_z = (c) => c===90 ;

        nv-cli-ascii-cmmn-char# nv_cli_ascii_cmmn_char  -c

            const is_sp      = (c) => c===32  ;
            const is_ex      = (c) => c===33  ;
            const is_dq      = (c) => c===34  ;
            const is_hash    = (c) => c===35  ;
            const is_dolr    = (c) => c===36  ;
            const is_prcnt   = (c) => c===37  ;
            const is_amp     = (c) => c===38  ;
            const is_sq      = (c) => c===39  ;
            const is_lp      = (c) => c===40  ;
            const is_rp      = (c) => c===41  ;
            const is_aster   = (c) => c===42  ;
            const is_add     = (c) => c===43  ;
            const is_comma   = (c) => c===44  ;
            const is_hypen   = (c) => c===45  ;
            const is_dot     = (c) => c===46  ;
            const is_slash   = (c) => c===47  ;
            const is_0       = (c) => c===48  ;
            const is_1       = (c) => c===49  ;
            const is_2       = (c) => c===50  ;
            const is_3       = (c) => c===51  ;
            const is_4       = (c) => c===52  ;
            const is_5       = (c) => c===53  ;
            const is_6       = (c) => c===54  ;
            const is_7       = (c) => c===55  ;
            const is_8       = (c) => c===56  ;
            const is_9       = (c) => c===57  ;
            const is_colon   = (c) => c===58  ;
            const is_semi    = (c) => c===59  ;
            const is_lt      = (c) => c===60  ;
            const is_ltq     = (c) => c===96  ;
            const is_eq      = (c) => c===61  ;
            const is_gt      = (c) => c===62  ;
            const is_q       = (c) => c===63  ;
            const is_upper_q = (c) => c===81  ;
            const is_lower_q = (c) => c===113 ;
            const is_at      = (c) => c===64  ;
            const is_upper_a = (c) => c===65  ;
            const is_upper_b = (c) => c===66  ;
            const is_upper_c = (c) => c===67  ;
            const is_upper_d = (c) => c===68  ;
            const is_upper_e = (c) => c===69  ;
            const is_upper_f = (c) => c===70  ;
            const is_upper_g = (c) => c===71  ;
            const is_upper_h = (c) => c===72  ;
            const is_upper_i = (c) => c===73  ;
            const is_upper_j = (c) => c===74  ;
            const is_upper_k = (c) => c===75  ;
            const is_upper_l = (c) => c===76  ;
            const is_upper_m = (c) => c===77  ;
            const is_upper_n = (c) => c===78  ;
            const is_upper_o = (c) => c===79  ;
            const is_upper_p = (c) => c===80  ;
            const is_upper_r = (c) => c===82  ;
            const is_upper_s = (c) => c===83  ;
            const is_upper_t = (c) => c===84  ;
            const is_upper_u = (c) => c===85  ;
            const is_upper_v = (c) => c===86  ;
            const is_upper_w = (c) => c===87  ;
            const is_upper_x = (c) => c===88  ;
            const is_upper_y = (c) => c===89  ;
            const is_upper_z = (c) => c===90  ;
            const is_lbk     = (c) => c===91  ;
            const is_esc     = (c) => c===92  ;
            const is_rbk     = (c) => c===93  ;
            const is_caret   = (c) => c===94  ;
            const is_lodash  = (c) => c===95  ;
            const is_lower_a = (c) => c===97  ;
            const is_lower_b = (c) => c===98  ;
            const is_lower_c = (c) => c===99  ;
            const is_lower_d = (c) => c===100 ;
            const is_lower_e = (c) => c===101 ;
            const is_lower_f = (c) => c===102 ;
            const is_lower_g = (c) => c===103 ;
            const is_lower_h = (c) => c===104 ;
            const is_lower_i = (c) => c===105 ;
            const is_lower_j = (c) => c===106 ;
            const is_lower_k = (c) => c===107 ;
            const is_lower_l = (c) => c===108 ;
            const is_lower_m = (c) => c===109 ;
            const is_lower_n = (c) => c===110 ;
            const is_lower_o = (c) => c===111 ;
            const is_lower_p = (c) => c===112 ;
            const is_lower_r = (c) => c===114 ;
            const is_lower_s = (c) => c===115 ;
            const is_lower_t = (c) => c===116 ;
            const is_lower_u = (c) => c===117 ;
            const is_lower_v = (c) => c===118 ;
            const is_lower_w = (c) => c===119 ;
            const is_lower_x = (c) => c===120 ;
            const is_lower_y = (c) => c===121 ;
            const is_lower_z = (c) => c===122 ;
            const is_lbc     = (c) => c===123 ;
            const is_vbar    = (c) => c===124 ;
            const is_rbc     = (c) => c===125 ;
            const is_tild    = (c) => c===126 ;
            const is_del     = (c) => c===127 ;

LICENSE

  • ISC