1 package filtering 2 3 // Token represents a token in a filter expression. 4 type Token struct { 5 // Position of the token. 6 Position Position 7 // Type of the token. 8 Type TokenType 9 // Value of the token, if the token is a text or a string. 10 Value string 11 } 12 13 func (t Token) Unquote() string { 14 if t.Type == TokenTypeString { 15 if len(t.Value) <= 2 { 16 return "" 17 } 18 return t.Value[1 : len(t.Value)-1] 19 } 20 return t.Value 21 } 22