From db476cc71cb6c690bd5b32cebebf7ebcbff604ad Mon Sep 17 00:00:00 2001 From: yui-knk Date: Mon, 1 Jan 2024 01:31:28 +0900 Subject: Introduce NODE_SYM to manage symbol literal `:sym` was managed by `NODE_LIT` with `Symbol` object. This commit introduces `NODE_SYM` so that 1. Symbol literal is detectable from AST Node 2. Reduce dependency on ruby object --- test/ruby/test_ast.rb | 2 +- test/ruby/test_rubyoptions.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'test/ruby') diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 5f4a440976..efd27548bd 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -1013,7 +1013,7 @@ dummy const: nil kw: (HASH@2:4-2:13 - (LIST@2:4-2:13 (LIT@2:4-2:6 :a) (CONST@2:7-2:13 :String) nil)) + (LIST@2:4-2:13 (SYM@2:4-2:6 :a) (CONST@2:7-2:13 :String) nil)) kwrest: nil) (BEGIN@2:14-2:14 nil) nil))) EXP end diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 6298c829e3..b8327d15b5 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -568,12 +568,14 @@ class TestRubyOptions < Test::Unit::TestCase t.puts "if a = {}; end" t.puts "if a = {1=>2}; end" t.puts "if a = {3=>a}; end" + t.puts "if a = :sym; end" t.flush err = ["#{t.path}:1:#{warning}", "#{t.path}:2:#{warning}", "#{t.path}:3:#{warning}", "#{t.path}:5:#{warning}", "#{t.path}:6:#{warning}", + "#{t.path}:8:#{warning}", ] feature4299 = '[ruby-dev:43083]' assert_in_out_err(["-w", t.path], "", [], err, feature4299) -- cgit v1.2.3