[Ironruby-core] Code Review: re

Tomas Matousek Tomas.Matousek at microsoft.com
Mon Feb 23 14:15:11 EST 2009

ReflectionCacheGenerator: More concise way how to sort an array: 

var methods = ReflectMethods(typeof(RubyOps)).Values;
Array.Sort(methods, (m1, m2) => m1.Name.CompareTo(m2.Name));


I would prefer TransformConcatenation to take 2 parameters (Expr regexOptions, Expr regexCache) rather than params array.

Then this would not be necessary:
                    List<MSA.Expression> allArgs = new List<MSA.Expression>(2 + additionalArgs.Length);

and we could do just:
			  if (regexOptions != null) 
                      opFactory("N").OpCall(paramArray, codePage, regexOptions, regexCache) : ...

Other than that looks good.


-----Original Message-----
From: Shri Borde 
Sent: Monday, February 23, 2009 10:11 AM
To: IronRuby External Code Reviewers
Cc: ironruby-core at rubyforge.org
Subject: Code Review: re

  tfpt review "/shelveset:re;REDMOND\sborde"

  Comment  : 
  Regexp literal support for /o.
  /foo/ should compare equal with /foo/o, so we ensure that RubyRegexpOptions.Once is passed into the RubyOps runtime helper, but we then remove it in the RubyRegex constructor
  Caching of the RubyRegex (and the underlying System.Text.RegularExpressions.Regex) for regexp literals so that the expression is processed only once
  Sort the method names in the generated ReflectionCache. This will make reduce the chances of conflicts during merging. Currently, the order is whatever System.Reflection choses.

More information about the Ironruby-core mailing list