github.com/bir3/gocompiler@v0.9.2202/src/cmd/compile/internal/syntax/operator_string.go (about)

     1  // Code generated by "stringer -type Operator -linecomment tokens.go"; DO NOT EDIT.
     2  
     3  package syntax
     4  
     5  import "strconv"
     6  
     7  func _() {
     8  	// An "invalid array index" compiler error signifies that the constant values have changed.
     9  	// Re-run the stringer command to generate them again.
    10  	var x [1]struct{}
    11  	_ = x[Def-1]
    12  	_ = x[Not-2]
    13  	_ = x[Recv-3]
    14  	_ = x[Tilde-4]
    15  	_ = x[OrOr-5]
    16  	_ = x[AndAnd-6]
    17  	_ = x[Eql-7]
    18  	_ = x[Neq-8]
    19  	_ = x[Lss-9]
    20  	_ = x[Leq-10]
    21  	_ = x[Gtr-11]
    22  	_ = x[Geq-12]
    23  	_ = x[Add-13]
    24  	_ = x[Sub-14]
    25  	_ = x[Or-15]
    26  	_ = x[Xor-16]
    27  	_ = x[Mul-17]
    28  	_ = x[Div-18]
    29  	_ = x[Rem-19]
    30  	_ = x[And-20]
    31  	_ = x[AndNot-21]
    32  	_ = x[Shl-22]
    33  	_ = x[Shr-23]
    34  }
    35  
    36  const _Operator_name = ":!<-~||&&==!=<<=>>=+-|^*/%&&^<<>>"
    37  
    38  var _Operator_index = [...]uint8{0, 1, 2, 4, 5, 7, 9, 11, 13, 14, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 31, 33}
    39  
    40  func (i Operator) String() string {
    41  	i -= 1
    42  	if i >= Operator(len(_Operator_index)-1) {
    43  		return "Operator(" + strconv.FormatInt(int64(i+1), 10) + ")"
    44  	}
    45  	return _Operator_name[_Operator_index[i]:_Operator_index[i+1]]
    46  }