From 6b083fd88435cfe9f520d2af01fdf1d1d9c38230 Mon Sep 17 00:00:00 2001 From: alpha Date: Mon, 18 Jul 2022 02:32:32 +0000 Subject: [PATCH] use transform_values for `TOKENS` FossilOrigin-Name: ecc9a6364a3e9096050cb7ada97436c9a03514ca50e2ca3d50e19f5ff70a8fd3 --- ruby/lox.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby/lox.rb b/ruby/lox.rb index f82ba5d..abe5f6a 100755 --- a/ruby/lox.rb +++ b/ruby/lox.rb @@ -74,7 +74,7 @@ module Lox >= GREATER_EQUAL > GREATER / SLASH - ].each_slice(2).to_h {|k,v| [k, v.to_sym] } + ].each_slice(2).to_h.transform_values(&:to_sym) TOKENS_RE = Regexp.union(TOKENS.keys) KEYWORDS = %w[