self == other -> boolRuby 3.3 から[permalink][rdoc][edit]-
other が同じ
typeとvalueを持つPrism::Tokenであれば true を返します。位置(location)は比較しないため、ソースコード上の別の場所にある同じ内容のトークンどうしも等しいと判定されます。- [PARAM]
other: - 比較対象のオブジェクト
require "prism" tokens = Prism.lex("1 + 1").value p tokens[0][0] == tokens[2][0] # => true (別の位置の "1" どうし) - [PARAM]