Skip to content

Conversation

@eregon
Copy link
Contributor

@eregon eregon commented Oct 28, 2022

No description provided.

symbol = parts[0].value.to_sym

->(attribute) { attribute == value }
->(node) { node == symbol }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to add a test to validate this change but couldn't find a way to trigger this case.
I tried things like:

    def test_search_string_simple
      results = search(%{"#{'abc'}"}, "StringLiteral[parts: [TStringContent[value: 'abc']]]")

      assert_equal 1, results.length
    end

    def test_search_symbol_simple
      puts %s{:"#{'abc'}"}
      puts ':"#{\'abc\'}"'
      results = search(':"#{\'abc\'}"', ':abc')
      results = search(':"#{\'abc\'}"', ':"#{\'abc\'}"')
      results = search(%{"#{'abc'}"}, "DynaSymbol[parts: [TStringContent[value: 'abc']]]")

      assert_equal 1, results.length
    end

But none seem to match this specific condition.

@kddnewton kddnewton merged commit 999292b into ruby-syntax-tree:main Oct 28, 2022
@eregon eregon deleted the truffleruby-ci branch October 28, 2022 13:59
@eregon eregon restored the truffleruby-ci branch October 28, 2022 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants