1.0.2 • Published 2 years ago

nv-facutil-declprop-modifier v1.0.2

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

nv-facutil-declprop-modifier

  • a string-format for ctx prop-name to include declaration-modifier-infomation

install

  • npm install nv-facutil-declprop-modifier

usage

 const {parse} = require("nv-facutil-declprop-modifier")

syntax

    0 1 2 3  4     5     6     7  8       9           10
    r w x #<num> <.|'> <p|a|l> @<dtype> <%|:space:> <name>

example

    var decl = parse(`r--#0.p@int32 count`);
    decl.dict()

    /*
    _Dict {
      read: true,
      write: false,
      exec: false,
      public: true,
      protected: false,
      private: false,
      internal: false,
      atype: 'prop',
      dtype: 'int32',
      name: 'count'
    }

    > decl.stringify()
    'r--#0.p@int32 count'
    >


    */

    var decl = parse(`rw-#2'a@str arg0`);
    decl.dict()
    /*
    > decl.dict()
    _Dict {
      read: true,
      write: true,
      exec: false,
      public: false,
      protected: false,
      private: true,
      internal: false,
      atype: 'arg',
      dtype: 'str',
      name: 'arg0'
    }
    >
    > decl.stringify()
    "rw-#2'a@str arg0"
    >


    */

    var decl = parse(`rwx#2'l@uint8 var`);

    /*
    > decl.dict()
    _Dict {
      read: true,
      write: true,
      exec: true,
      public: false,
      protected: false,
      private: true,
      internal: false,
      atype: 'let',
      dtype: 'uint8',
      name: 'var'
    }
    > decl.stringify()
    "rwx#2'l@uint8 var"
    >

    */

METHODS

    decl.argify                decl.can_exec              decl.can_read              decl.can_write
    decl.constructor           decl.dict                  decl.dtype_                decl.execify
    decl.internify             decl.is_arg                decl.is_internal           decl.is_let
    decl.is_private            decl.is_prop               decl.is_protected          decl.is_public
    decl.letify                decl.name_                 decl.privatify             decl.propify
    decl.protectify            decl.publicify             decl.readify               decl.stringify
    decl.unexecify             decl.unreadify             decl.unwritify             decl.writify

APIS

  • ATYPE
  • parse(s)
  • DeclProp

LICENSE

  • ISC