github.com/coyove/nj@v0.0.0-20221110084952-c7f8db1065c3/typ/types.go (about)

     1  package typ
     2  
     3  type ValueType byte
     4  
     5  const (
     6  	Nil    ValueType = 0
     7  	Bool   ValueType = 1
     8  	Number ValueType = 3
     9  	String ValueType = 7
    10  	Object ValueType = 15
    11  	Native ValueType = 31
    12  )
    13  
    14  func (t ValueType) String() string {
    15  	if t > Native {
    16  		return "?"
    17  	}
    18  	return [...]string{
    19  		"nil", "bool", "?", "number",
    20  		"?", "?", "?", "string",
    21  		"?", "?", "?", "?",
    22  		"?", "?", "?", "object",
    23  		"?", "?", "?", "?",
    24  		"?", "?", "?", "?",
    25  		"?", "?", "?", "?",
    26  		"?", "?", "?", "native"}[t]
    27  }
    28  
    29  const (
    30  	RegA          = 0x8000
    31  	RegPhantom    = 0xffff
    32  	RegLocalMask  = 0x7fff
    33  	RegNil        = 0x8001
    34  	RegMaxAddress = 0x7ff0
    35  )