[前][次][番号順一覧][スレッド一覧]

ruby-changes:50080

From: kazu <ko1@a...>
Date: Sun, 4 Feb 2018 20:59:24 +0900 (JST)
Subject: [ruby-changes:50080] kazu:r62198 (trunk): Fix typos and remove redundant `/#{}/`

kazu	2018-02-04 20:59:19 +0900 (Sun, 04 Feb 2018)

  New Revision: 62198

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62198

  Log:
    Fix typos and remove redundant `/#{}/`

  Modified files:
    trunk/tool/transform_mjit_header.rb
Index: tool/transform_mjit_header.rb
===================================================================
--- tool/transform_mjit_header.rb	(revision 62197)
+++ tool/transform_mjit_header.rb	(revision 62198)
@@ -52,11 +52,11 @@ module MJITHeader https://github.com/ruby/ruby/blob/trunk/tool/transform_mjit_header.rb#L52
   def self.decl_name_of(decl)
     ident_regex = /\w+/
     decl = decl.gsub(/^#.+$/, '') # remove macros
-    reduced_decl = decl.gsub(/#{ATTR_REGEXP}/, '') # remove attributes
+    reduced_decl = decl.gsub(ATTR_REGEXP, '') # remove attributes
     su1_regex = /{[^{}]*}/
-    su2_regex = /{([^{}]|su1_regex)*}/
-    su3_regex = /{([^{}]|su2_regex)*}/ # 3 nested structs/unions is probably enough
-    reduced_decl.gsub!(/#{su3_regex}/, '') # remove strutcs/unions in the header
+    su2_regex = /{([^{}]|#{su1_regex})*}/
+    su3_regex = /{([^{}]|#{su2_regex})*}/ # 3 nested structs/unions is probably enough
+    reduced_decl.gsub!(su3_regex, '') # remove structs/unions in the header
     id_seq_regex = /\s*(#{ident_regex}(\s+|\s*[*]+\s*))*/
     # Process function header:
     match = /\A#{id_seq_regex}(?<name>#{ident_regex})\s*\(/.match(reduced_decl)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]