edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializer.Generated.cs;C427406 File: Initializer.Generated.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializer.Generated.cs;C427406 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializer.Generated.cs;bugfixes9 @@ -22,31 +22,32 @@ // Skipped primitive: __ClassSingleton // Skipped primitive: __MainSingleton - Ruby.Builtins.RubyModule def33 = DefineGlobalModule("Comparable", typeof(Ruby.Builtins.Comparable), new System.Action(LoadComparable_Instance), null, Ruby.Builtins.RubyModule.EmptyArray); + Ruby.Builtins.RubyModule def40 = DefineGlobalModule("Comparable", typeof(Ruby.Builtins.Comparable), new System.Action(LoadComparable_Instance), null, Ruby.Builtins.RubyModule.EmptyArray); Ruby.Builtins.RubyModule def11 = DefineGlobalModule("Digest", typeof(Ruby.StandardLibrary.Digest), null, new System.Action(LoadDigest_Class), Ruby.Builtins.RubyModule.EmptyArray); Ruby.Builtins.RubyModule def14 = DefineModule("Digest::Instance", typeof(Ruby.StandardLibrary.Digest.Instance), new System.Action(LoadDigest__Instance_Instance), null, Ruby.Builtins.RubyModule.EmptyArray); - Ruby.Builtins.RubyModule def21 = DefineGlobalModule("Enumerable", typeof(Ruby.Builtins.Enumerable), new System.Action(LoadEnumerable_Instance), null, Ruby.Builtins.RubyModule.EmptyArray); + Ruby.Builtins.RubyModule def28 = DefineGlobalModule("Enumerable", typeof(Ruby.Builtins.Enumerable), new System.Action(LoadEnumerable_Instance), null, Ruby.Builtins.RubyModule.EmptyArray); Ruby.Builtins.RubyModule def3 = DefineGlobalModule("Errno", typeof(Ruby.Builtins.Errno), null, null, Ruby.Builtins.RubyModule.EmptyArray); // Skipped primitive: Kernel DefineGlobalModule("Math", typeof(Ruby.Builtins.Math), new System.Action(LoadMath_Instance), new System.Action(LoadMath_Class), Ruby.Builtins.RubyModule.EmptyArray); DefineClass("Microsoft::Scripting::Actions::TypeTracker", typeof(Microsoft.Scripting.Actions.TypeTracker), typeof(Ruby.Runtime.TypeTrackerOps), new System.Action(LoadMicrosoft__Scripting__Actions__TypeTracker_Instance), null, classRef0, Ruby.Builtins.RubyModule.EmptyArray, null); Ruby.Builtins.RubyModule def16 = DefineGlobalModule("OpenSSL", typeof(Ruby.StandardLibrary.OpenSSL), null, null, Ruby.Builtins.RubyModule.EmptyArray); Ruby.Builtins.RubyModule def17 = DefineModule("OpenSSL::Digest", typeof(Ruby.StandardLibrary.OpenSSL.DigestFactory), null, null, Ruby.Builtins.RubyModule.EmptyArray); - Ruby.Builtins.RubyModule def29 = DefineGlobalModule("Precision", typeof(Ruby.Builtins.Precision), new System.Action(LoadPrecision_Instance), new System.Action(LoadPrecision_Class), Ruby.Builtins.RubyModule.EmptyArray); + Ruby.Builtins.RubyModule def36 = DefineGlobalModule("Precision", typeof(Ruby.Builtins.Precision), new System.Action(LoadPrecision_Instance), new System.Action(LoadPrecision_Class), Ruby.Builtins.RubyModule.EmptyArray); DefineClass("System::Type", typeof(System.Type), typeof(Ruby.Runtime.TypeOps), new System.Action(LoadSystem__Type_Instance), null, classRef2, Ruby.Builtins.RubyModule.EmptyArray, null); + Ruby.Builtins.RubyModule def20 = DefineGlobalModule("Zlib", typeof(Ruby.StandardLibrary.Zlib), new System.Action(LoadZlib_Instance), null, Ruby.Builtins.RubyModule.EmptyArray); // Skipped primitive: __ClassSingletonSingleton #if !SILVERLIGHT - object def1 = DefineSingleton(new System.Action(Load__Singleton_ArgFilesSingletonOps_Instance), null, new Ruby.Builtins.RubyModule[] {def21, }); + object def1 = DefineSingleton(new System.Action(Load__Singleton_ArgFilesSingletonOps_Instance), null, new Ruby.Builtins.RubyModule[] {def28, }); #endif #if !SILVERLIGHT - object def2 = DefineSingleton(new System.Action(Load__Singleton_EnvironmentSingletonOps_Instance), null, new Ruby.Builtins.RubyModule[] {def21, }); + object def2 = DefineSingleton(new System.Action(Load__Singleton_EnvironmentSingletonOps_Instance), null, new Ruby.Builtins.RubyModule[] {def28, }); #endif // Skipped primitive: Object - Ruby.Builtins.RubyModule def27 = DefineModule("System::Collections::Generic::IDictionary", typeof(System.Collections.Generic.IDictionary), new System.Action(LoadSystem__Collections__Generic__IDictionary_Instance), null, new Ruby.Builtins.RubyModule[] {def21, }); - DefineModule("System::Collections::IEnumerable", typeof(System.Collections.IEnumerable), new System.Action(LoadSystem__Collections__IEnumerable_Instance), null, new Ruby.Builtins.RubyModule[] {def21, }); - Ruby.Builtins.RubyModule def35 = DefineModule("System::Collections::IList", typeof(System.Collections.IList), new System.Action(LoadSystem__Collections__IList_Instance), null, new Ruby.Builtins.RubyModule[] {def21, }); - DefineModule("System::IComparable", typeof(System.IComparable), new System.Action(LoadSystem__IComparable_Instance), null, new Ruby.Builtins.RubyModule[] {def33, }); - DefineGlobalClass("Time", typeof(System.DateTime), typeof(Ruby.Builtins.TimeOps), new System.Action(LoadTime_Instance), new System.Action(LoadTime_Class), classRef1, new Ruby.Builtins.RubyModule[] {def33, }, new System.Delegate[] { + Ruby.Builtins.RubyModule def34 = DefineModule("System::Collections::Generic::IDictionary", typeof(System.Collections.Generic.IDictionary), new System.Action(LoadSystem__Collections__Generic__IDictionary_Instance), null, new Ruby.Builtins.RubyModule[] {def28, }); + Ruby.Builtins.RubyModule def47 = DefineModule("System::Collections::IEnumerable", typeof(System.Collections.IEnumerable), new System.Action(LoadSystem__Collections__IEnumerable_Instance), null, new Ruby.Builtins.RubyModule[] {def28, }); + Ruby.Builtins.RubyModule def42 = DefineModule("System::Collections::IList", typeof(System.Collections.IList), new System.Action(LoadSystem__Collections__IList_Instance), null, new Ruby.Builtins.RubyModule[] {def28, }); + DefineModule("System::IComparable", typeof(System.IComparable), new System.Action(LoadSystem__IComparable_Instance), null, new Ruby.Builtins.RubyModule[] {def40, }); + DefineGlobalClass("Time", typeof(System.DateTime), typeof(Ruby.Builtins.TimeOps), new System.Action(LoadTime_Instance), new System.Action(LoadTime_Class), classRef1, new Ruby.Builtins.RubyModule[] {def40, }, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.TimeOps.Create), new Microsoft.Scripting.Utils.Function(Ruby.Builtins.TimeOps.Create), new Microsoft.Scripting.Utils.Function(Ruby.Builtins.TimeOps.Create), @@ -60,7 +61,7 @@ new Microsoft.Scripting.Utils.Function(Ruby.Builtins.TimeOps.Create), new Microsoft.Scripting.Utils.Function(Ruby.Builtins.TimeOps.Create), }); - DefineGlobalClass("Array", typeof(Ruby.Builtins.RubyArray), typeof(Ruby.Builtins.ArrayOps), new System.Action(LoadArray_Instance), new System.Action(LoadArray_Class), Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def21, }, new System.Delegate[] { + DefineGlobalClass("Array", typeof(Ruby.Builtins.RubyArray), typeof(Ruby.Builtins.ArrayOps), new System.Action(LoadArray_Instance), new System.Action(LoadArray_Class), Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def28, }, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ArrayOps.CreateArray), new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ArrayOps.CreateArray), new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ArrayOps.CreateArray), @@ -70,18 +71,18 @@ new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ArrayOps.CreateArray), }); DefineGlobalClass("Binding", typeof(Ruby.Builtins.Binding), typeof(Ruby.Builtins.BindingOps), null, null, Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, null); - DefineGlobalClass("ClrString", typeof(System.String), typeof(Ruby.Builtins.StringOps), new System.Action(LoadClrString_Instance), null, Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, null); + DefineGlobalClass("ClrString", typeof(System.String), typeof(Ruby.Builtins.StringOps), new System.Action(LoadClrString_Instance), null, Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def47, }, null); Ruby.Builtins.RubyClass def13 = DefineClass("Digest::Class", typeof(Ruby.StandardLibrary.Digest.Class), null, null, new System.Action(LoadDigest__Class_Class), Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def14, }, null); - DefineGlobalClass("Dir", typeof(Ruby.Builtins.RubyDir), null, new System.Action(LoadDir_Instance), new System.Action(LoadDir_Class), Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def21, }, null); - Ruby.Builtins.RubyClass def34 = Context.ExceptionClass = DefineGlobalClass("Exception", typeof(System.Exception), typeof(Ruby.Builtins.ExceptionOps), new System.Action(LoadException_Instance), new System.Action(LoadException_Class), Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + DefineGlobalClass("Dir", typeof(Ruby.Builtins.RubyDir), null, new System.Action(LoadDir_Instance), new System.Action(LoadDir_Class), Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def28, }, null); + Ruby.Builtins.RubyClass def41 = Context.ExceptionClass = DefineGlobalClass("Exception", typeof(System.Exception), typeof(Ruby.Builtins.ExceptionOps), new System.Action(LoadException_Instance), new System.Action(LoadException_Class), Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ExceptionOps.Factory), }); Context.FalseClass = DefineGlobalClass("FalseClass", typeof(Ruby.Builtins.FalseClass), null, new System.Action(LoadFalseClass_Instance), null, Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, null); - DefineGlobalClass("Hash", typeof(Ruby.Builtins.Hash), typeof(Ruby.Builtins.HashOps), new System.Action(LoadHash_Instance), new System.Action(LoadHash_Class), Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def21, }, new System.Delegate[] { + DefineGlobalClass("Hash", typeof(Ruby.Builtins.Hash), typeof(Ruby.Builtins.HashOps), new System.Action(LoadHash_Instance), new System.Action(LoadHash_Class), Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def28, }, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.HashOps.Hash), new Microsoft.Scripting.Utils.Function(Ruby.Builtins.HashOps.Hash), }); - Ruby.Builtins.RubyClass def22 = DefineGlobalClass("IO", typeof(Ruby.Builtins.RubyIO), typeof(Ruby.Builtins.RubyIOOps), new System.Action(LoadIO_Instance), new System.Action(LoadIO_Class), Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + Ruby.Builtins.RubyClass def29 = DefineGlobalClass("IO", typeof(Ruby.Builtins.RubyIO), typeof(Ruby.Builtins.RubyIOOps), new System.Action(LoadIO_Instance), new System.Action(LoadIO_Class), Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RubyIOOps.CreateIO), new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RubyIOOps.CreateIO), new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RubyIOOps.CreateIO), @@ -90,121 +91,137 @@ DefineGlobalClass("Method", typeof(Ruby.Builtins.RubyMethod), typeof(Ruby.Builtins.MethodOps), new System.Action(LoadMethod_Instance), null, Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, null); // Skipped primitive: Module Context.NilClass = DefineGlobalClass("NilClass", typeof(Microsoft.Scripting.None), typeof(Ruby.Builtins.NilClassOps), new System.Action(LoadNilClass_Instance), null, Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, null); - Ruby.Builtins.RubyClass def28 = DefineGlobalClass("Numeric", typeof(Ruby.Builtins.Numeric), null, new System.Action(LoadNumeric_Instance), null, Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def33, }, null); + Ruby.Builtins.RubyClass def35 = DefineGlobalClass("Numeric", typeof(Ruby.Builtins.Numeric), null, new System.Action(LoadNumeric_Instance), null, Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def40, }, null); Ruby.Builtins.RubyClass def18 = DefineClass("OpenSSL::Digest::Digest", typeof(Ruby.StandardLibrary.OpenSSL.DigestFactory.Digest), null, new System.Action(LoadOpenSSL__Digest__Digest_Instance), null, Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, null); Ruby.Builtins.RubyClass def19 = DefineClass("OpenSSL::HMAC", typeof(Ruby.StandardLibrary.OpenSSL.HMAC), null, null, new System.Action(LoadOpenSSL__HMAC_Class), Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, null); DefineGlobalClass("Proc", typeof(Ruby.Builtins.Proc), typeof(Ruby.Builtins.ProcOps), new System.Action(LoadProc_Instance), null, Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ProcOps.CreateProc), new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ProcOps.CreateProc), }); - DefineGlobalClass("Range", typeof(Ruby.Builtins.Range), typeof(Ruby.Builtins.RangeOps), new System.Action(LoadRange_Instance), null, Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def21, }, new System.Delegate[] { + DefineGlobalClass("Range", typeof(Ruby.Builtins.Range), typeof(Ruby.Builtins.RangeOps), new System.Action(LoadRange_Instance), null, Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def28, }, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RangeOps.CreateRange), }); - DefineGlobalClass("Regexp", typeof(Ruby.Builtins.Regexp), typeof(Ruby.Builtins.RegexpOps), new System.Action(LoadRegexp_Instance), new System.Action(LoadRegexp_Class), Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def21, }, null); - DefineGlobalClass("String", typeof(Ruby.Builtins.MutableString), typeof(Ruby.Builtins.MutableStringOps), new System.Action(LoadString_Instance), null, Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def21, def33, }, null); + DefineGlobalClass("Regexp", typeof(Ruby.Builtins.Regexp), typeof(Ruby.Builtins.RegexpOps), new System.Action(LoadRegexp_Instance), new System.Action(LoadRegexp_Class), Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def28, }, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RegexpOps.Create), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RegexpOps.Create), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RegexpOps.Create), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RegexpOps.Create), + }); + DefineGlobalClass("String", typeof(Ruby.Builtins.MutableString), typeof(Ruby.Builtins.MutableStringOps), new System.Action(LoadString_Instance), null, Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def28, def40, }, null); DefineGlobalClass("StringScanner", typeof(Ruby.Builtins.StringScanner), null, new System.Action(LoadStringScanner_Instance), new System.Action(LoadStringScanner_Class), Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, null); - DefineGlobalClass("Struct", typeof(Ruby.Builtins.RubyStruct), typeof(Ruby.Builtins.RubyStructOps), new System.Action(LoadStruct_Instance), null, Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def21, }, new System.Delegate[] { + DefineGlobalClass("Struct", typeof(Ruby.Builtins.RubyStruct), typeof(Ruby.Builtins.RubyStructOps), new System.Action(LoadStruct_Instance), null, Context.ObjectClass, new Ruby.Builtins.RubyModule[] {def28, }, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RubyStructOps.CreateStructClass), }); DefineGlobalClass("Symbol", typeof(Microsoft.Scripting.SymbolId), typeof(Ruby.Builtins.SymbolOps), new System.Action(LoadSymbol_Instance), new System.Action(LoadSymbol_Class), Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, null); DefineGlobalClass("Thread", typeof(System.Threading.Thread), typeof(Ruby.Builtins.ThreadOps), new System.Action(LoadThread_Instance), new System.Action(LoadThread_Class), Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, null); Context.TrueClass = DefineGlobalClass("TrueClass", typeof(Ruby.Builtins.TrueClass), null, new System.Action(LoadTrueClass_Instance), null, Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, null); DefineGlobalClass("UnboundMethod", typeof(Ruby.Builtins.UnboundMethod), null, new System.Action(LoadUnboundMethod_Instance), null, Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, null); + Ruby.Builtins.RubyClass def22 = DefineClass("Zlib::GzipFile", typeof(Ruby.StandardLibrary.Zlib.GZipFile), null, null, null, Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, null); + Ruby.Builtins.RubyClass def26 = DefineClass("Zlib::ZStream", typeof(Ruby.StandardLibrary.Zlib.ZStream), null, new System.Action(LoadZlib__ZStream_Instance), null, Context.ObjectClass, Ruby.Builtins.RubyModule.EmptyArray, null); #if !SILVERLIGHT - Ruby.Builtins.RubyClass def30 = DefineGlobalClass("BasicSocket", typeof(Ruby.Builtins.BasicSocket), null, new System.Action(LoadBasicSocket_Instance), null, def22, Ruby.Builtins.RubyModule.EmptyArray, null); + Ruby.Builtins.RubyClass def37 = DefineGlobalClass("BasicSocket", typeof(Ruby.Builtins.BasicSocket), null, new System.Action(LoadBasicSocket_Instance), null, def29, Ruby.Builtins.RubyModule.EmptyArray, null); #endif // Skipped primitive: Class Ruby.Builtins.RubyClass def12 = DefineClass("Digest::Base", typeof(Ruby.StandardLibrary.Digest.Base), null, new System.Action(LoadDigest__Base_Instance), null, def13, Ruby.Builtins.RubyModule.EmptyArray, null); - DefineGlobalClass("File", typeof(Ruby.Builtins.RubyFile), typeof(Ruby.Builtins.RubyFileOps), new System.Action(LoadFile_Instance), new System.Action(LoadFile_Class), def22, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + DefineGlobalClass("File", typeof(Ruby.Builtins.RubyFile), typeof(Ruby.Builtins.RubyFileOps), new System.Action(LoadFile_Instance), new System.Action(LoadFile_Class), def29, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RubyFileOps.CreateIO), new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RubyFileOps.CreateIO), }); - DefineGlobalClass("Float", typeof(System.Double), typeof(Ruby.Builtins.FloatOps), new System.Action(LoadFloat_Instance), new System.Action(LoadFloat_Class), def28, new Ruby.Builtins.RubyModule[] {def29, }, null); - Ruby.Builtins.RubyClass def20 = DefineGlobalClass("Integer", typeof(Ruby.Builtins.Integer), null, new System.Action(LoadInteger_Instance), new System.Action(LoadInteger_Class), def28, new Ruby.Builtins.RubyModule[] {def29, }, null); - DefineGlobalClass("NoMemoryError", typeof(Ruby.Builtins.NoMemoryError), null, null, null, def34, Ruby.Builtins.RubyModule.EmptyArray, null); - Ruby.Builtins.RubyClass def31 = DefineGlobalClass("ScriptError", typeof(Ruby.Builtins.ScriptError), typeof(Ruby.Builtins.ScriptErrorOps), null, null, def34, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + DefineGlobalClass("Float", typeof(System.Double), typeof(Ruby.Builtins.FloatOps), new System.Action(LoadFloat_Instance), new System.Action(LoadFloat_Class), def35, new Ruby.Builtins.RubyModule[] {def36, }, null); + Ruby.Builtins.RubyClass def27 = DefineGlobalClass("Integer", typeof(Ruby.Builtins.Integer), null, new System.Action(LoadInteger_Instance), new System.Action(LoadInteger_Class), def35, new Ruby.Builtins.RubyModule[] {def36, }, null); + DefineGlobalClass("NoMemoryError", typeof(Ruby.Builtins.NoMemoryError), null, null, null, def41, Ruby.Builtins.RubyModule.EmptyArray, null); + Ruby.Builtins.RubyClass def38 = DefineGlobalClass("ScriptError", typeof(Ruby.Builtins.ScriptError), typeof(Ruby.Builtins.ScriptErrorOps), null, null, def41, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ScriptErrorOps.Factory), }); - Ruby.Builtins.RubyClass def32 = Context.StandardErrorClass = DefineGlobalClass("StandardError", typeof(System.SystemException), typeof(Ruby.Builtins.SystemExceptionOps), null, null, def34, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + Ruby.Builtins.RubyClass def39 = Context.StandardErrorClass = DefineGlobalClass("StandardError", typeof(System.SystemException), typeof(Ruby.Builtins.SystemExceptionOps), null, null, def41, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.SystemExceptionOps.Factory), }); - DefineGlobalClass("SystemExit", typeof(Ruby.Builtins.SystemExit), typeof(Ruby.Builtins.SystemExitOps), new System.Action(LoadSystemExit_Instance), null, def34, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + DefineGlobalClass("SystemExit", typeof(Ruby.Builtins.SystemExit), typeof(Ruby.Builtins.SystemExitOps), new System.Action(LoadSystemExit_Instance), null, def41, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.SystemExitOps.Factory), }); - DefineGlobalClass("SystemStackError", typeof(Ruby.Builtins.SystemStackError), typeof(Ruby.Builtins.SystemStackErrorOps), null, null, def34, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + DefineGlobalClass("SystemStackError", typeof(Ruby.Builtins.SystemStackError), typeof(Ruby.Builtins.SystemStackErrorOps), null, null, def41, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.SystemStackErrorOps.Factory), }); - DefineGlobalClass("ArgumentError", typeof(System.ArgumentException), typeof(Ruby.Builtins.ArgumentErrorOps), new System.Action(LoadArgumentError_Instance), null, def32, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + Ruby.Builtins.RubyClass def24 = DefineClass("Zlib::GzipReader", typeof(Ruby.StandardLibrary.Zlib.GZipReader), null, new System.Action(LoadZlib__GzipReader_Instance), new System.Action(LoadZlib__GzipReader_Class), def22, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.GZipReader.Initialize), + }); + Ruby.Builtins.RubyClass def25 = DefineClass("Zlib::Inflate", typeof(Ruby.StandardLibrary.Zlib.Inflate), null, new System.Action(LoadZlib__Inflate_Instance), new System.Action(LoadZlib__Inflate_Class), def26, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.Inflate.Initialize), + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.Inflate.Initialize), + }); + DefineGlobalClass("ArgumentError", typeof(System.ArgumentException), typeof(Ruby.Builtins.ArgumentErrorOps), new System.Action(LoadArgumentError_Instance), null, def39, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ArgumentErrorOps.Factory), }); - DefineGlobalClass("Bignum", typeof(Microsoft.Scripting.Math.BigInteger), typeof(Ruby.Builtins.BignumOps), new System.Action(LoadBignum_Instance), null, def20, Ruby.Builtins.RubyModule.EmptyArray, null); + DefineGlobalClass("Bignum", typeof(Microsoft.Scripting.Math.BigInteger), typeof(Ruby.Builtins.BignumOps), new System.Action(LoadBignum_Instance), null, def27, Ruby.Builtins.RubyModule.EmptyArray, null); #if !SILVERLIGHT Ruby.Builtins.RubyClass def15 = DefineClass("Digest::MD5", typeof(Ruby.StandardLibrary.Digest.MD5), null, null, null, def12, Ruby.Builtins.RubyModule.EmptyArray, null); #endif - DefineGlobalClass("Fixnum", typeof(System.Int32), typeof(Ruby.Builtins.FixnumOps), new System.Action(LoadFixnum_Instance), new System.Action(LoadFixnum_Class), def20, Ruby.Builtins.RubyModule.EmptyArray, null); - DefineGlobalClass("IndexError", typeof(System.IndexOutOfRangeException), typeof(Ruby.Builtins.IndexErrorOps), null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + DefineGlobalClass("Fixnum", typeof(System.Int32), typeof(Ruby.Builtins.FixnumOps), new System.Action(LoadFixnum_Instance), new System.Action(LoadFixnum_Class), def27, Ruby.Builtins.RubyModule.EmptyArray, null); + DefineGlobalClass("IndexError", typeof(System.IndexOutOfRangeException), typeof(Ruby.Builtins.IndexErrorOps), null, null, def39, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.IndexErrorOps.Factory), }); - Ruby.Builtins.RubyClass def24 = DefineGlobalClass("IOError", typeof(System.IO.IOException), typeof(Ruby.Builtins.IOErrorOps), null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + Ruby.Builtins.RubyClass def31 = DefineGlobalClass("IOError", typeof(System.IO.IOException), typeof(Ruby.Builtins.IOErrorOps), null, null, def39, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.IOErrorOps.Factory), }); #if !SILVERLIGHT - Ruby.Builtins.RubyClass def37 = DefineGlobalClass("IPSocket", typeof(Ruby.Builtins.IPSocket), null, new System.Action(LoadIPSocket_Instance), new System.Action(LoadIPSocket_Class), def30, Ruby.Builtins.RubyModule.EmptyArray, null); + Ruby.Builtins.RubyClass def44 = DefineGlobalClass("IPSocket", typeof(Ruby.Builtins.IPSocket), null, new System.Action(LoadIPSocket_Instance), new System.Action(LoadIPSocket_Class), def37, Ruby.Builtins.RubyModule.EmptyArray, null); #endif - DefineGlobalClass("LoadError", typeof(Ruby.Builtins.LoadError), typeof(Ruby.Builtins.LoadErrorOps), null, null, def31, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + DefineGlobalClass("LoadError", typeof(Ruby.Builtins.LoadError), typeof(Ruby.Builtins.LoadErrorOps), null, null, def38, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.LoadErrorOps.Factory), }); - DefineGlobalClass("LocalJumpError", typeof(Ruby.Builtins.LocalJumpError), typeof(Ruby.Builtins.LocalJumpErrorOps), null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + DefineGlobalClass("LocalJumpError", typeof(Ruby.Builtins.LocalJumpError), typeof(Ruby.Builtins.LocalJumpErrorOps), null, null, def39, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.LocalJumpErrorOps.Factory), }); - Ruby.Builtins.RubyClass def38 = DefineGlobalClass("NameError", typeof(System.MemberAccessException), typeof(Ruby.Builtins.NameErrorOps), null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + Ruby.Builtins.RubyClass def46 = DefineGlobalClass("NameError", typeof(System.MemberAccessException), typeof(Ruby.Builtins.NameErrorOps), null, null, def39, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.NameErrorOps.Factory), }); - DefineGlobalClass("NotImplementedError", typeof(Ruby.Builtins.NotImplementedError), typeof(Ruby.Builtins.NotImplementedErrorOps), null, null, def31, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + DefineGlobalClass("NotImplementedError", typeof(Ruby.Builtins.NotImplementedError), typeof(Ruby.Builtins.NotImplementedErrorOps), null, null, def38, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.NotImplementedErrorOps.Factory), }); - Ruby.Builtins.RubyClass def26 = DefineGlobalClass("RangeError", typeof(System.ArgumentOutOfRangeException), typeof(Ruby.Builtins.RangeErrorOps), new System.Action(LoadRangeError_Instance), null, def32, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + Ruby.Builtins.RubyClass def33 = DefineGlobalClass("RangeError", typeof(System.ArgumentOutOfRangeException), typeof(Ruby.Builtins.RangeErrorOps), new System.Action(LoadRangeError_Instance), null, def39, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RangeErrorOps.Factory), }); - DefineGlobalClass("RegexpError", typeof(Ruby.Builtins.RegexpError), typeof(Ruby.Builtins.RegexpErrorOps), null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + DefineGlobalClass("RegexpError", typeof(Ruby.Builtins.RegexpError), typeof(Ruby.Builtins.RegexpErrorOps), null, null, def39, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RegexpErrorOps.Factory), }); - Context.RuntimeErrorClass = DefineGlobalClass("RuntimeError", typeof(Ruby.Builtins.RuntimeError), null, null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, null); - DefineGlobalClass("SecurityError", typeof(System.Security.SecurityException), typeof(Ruby.Builtins.SecurityErrorOps), null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + Ruby.Builtins.RubyClass def45 = Context.RuntimeErrorClass = DefineGlobalClass("RuntimeError", typeof(Ruby.Builtins.RuntimeError), null, null, null, def39, Ruby.Builtins.RubyModule.EmptyArray, null); + DefineGlobalClass("SecurityError", typeof(System.Security.SecurityException), typeof(Ruby.Builtins.SecurityErrorOps), null, null, def39, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.SecurityErrorOps.Factory), }); - DefineGlobalClass("SyntaxError", typeof(Ruby.Builtins.SyntaxError), typeof(Ruby.Builtins.SyntaxErrorOps), null, null, def31, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + DefineGlobalClass("SyntaxError", typeof(Ruby.Builtins.SyntaxError), typeof(Ruby.Builtins.SyntaxErrorOps), null, null, def38, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.SyntaxErrorOps.Factory), }); - Ruby.Builtins.RubyClass def25 = DefineGlobalClass("SystemCallError", typeof(System.Runtime.InteropServices.ExternalException), typeof(Ruby.Builtins.SystemCallErrorOps), null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + Ruby.Builtins.RubyClass def32 = DefineGlobalClass("SystemCallError", typeof(System.Runtime.InteropServices.ExternalException), typeof(Ruby.Builtins.SystemCallErrorOps), null, null, def39, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.SystemCallErrorOps.Factory), }); - DefineGlobalClass("ThreadError", typeof(Ruby.Builtins.ThreadError), null, null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, null); - DefineGlobalClass("TypeError", typeof(System.InvalidOperationException), typeof(Ruby.Builtins.TypeErrorOps), null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + DefineGlobalClass("ThreadError", typeof(Ruby.Builtins.ThreadError), null, null, null, def39, Ruby.Builtins.RubyModule.EmptyArray, null); + DefineGlobalClass("TypeError", typeof(System.InvalidOperationException), typeof(Ruby.Builtins.TypeErrorOps), null, null, def39, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.TypeErrorOps.Factory), }); - DefineGlobalClass("ZeroDivisionError", typeof(System.DivideByZeroException), typeof(Ruby.Builtins.ZeroDivisionErrorOps), null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + DefineGlobalClass("ZeroDivisionError", typeof(System.DivideByZeroException), typeof(Ruby.Builtins.ZeroDivisionErrorOps), null, null, def39, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ZeroDivisionErrorOps.Factory), }); - DefineGlobalClass("EOFError", typeof(Ruby.Builtins.EOFError), null, null, null, def24, Ruby.Builtins.RubyModule.EmptyArray, null); - Ruby.Builtins.RubyClass def4 = DefineClass("Errno::EACCES", typeof(Ruby.Builtins.Errno.AccessError), null, null, null, def25, Ruby.Builtins.RubyModule.EmptyArray, null); - Ruby.Builtins.RubyClass def5 = DefineClass("Errno::EBADF", typeof(Ruby.Builtins.Errno.BadFileDescriptorError), null, null, null, def25, Ruby.Builtins.RubyModule.EmptyArray, null); - Ruby.Builtins.RubyClass def6 = DefineClass("Errno::EDOM", typeof(Ruby.Builtins.Errno.DomainError), null, null, null, def25, Ruby.Builtins.RubyModule.EmptyArray, null); - Ruby.Builtins.RubyClass def7 = DefineClass("Errno::EEXIST", typeof(Ruby.Builtins.Errno.ExistError), null, null, null, def25, Ruby.Builtins.RubyModule.EmptyArray, null); - Ruby.Builtins.RubyClass def8 = DefineClass("Errno::EINVAL", typeof(Ruby.Builtins.Errno.InvalidError), null, null, null, def25, Ruby.Builtins.RubyModule.EmptyArray, null); - Ruby.Builtins.RubyClass def9 = DefineClass("Errno::ENOENT", typeof(Ruby.Builtins.Errno.NoEntryError), null, null, null, def25, Ruby.Builtins.RubyModule.EmptyArray, null); - Ruby.Builtins.RubyClass def10 = DefineClass("Errno::ENOTDIR", typeof(Ruby.Builtins.Errno.NotDirectoryError), null, null, null, def25, Ruby.Builtins.RubyModule.EmptyArray, null); - DefineGlobalClass("FloatDomainError", typeof(Ruby.Builtins.FloatDomainError), null, null, null, def26, Ruby.Builtins.RubyModule.EmptyArray, null); - DefineGlobalClass("NoMethodError", typeof(System.MissingMethodException), typeof(Ruby.Builtins.NoMethodErrorOps), new System.Action(LoadNoMethodError_Instance), null, def38, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + DefineGlobalClass("EOFError", typeof(Ruby.Builtins.EOFError), null, null, null, def31, Ruby.Builtins.RubyModule.EmptyArray, null); + Ruby.Builtins.RubyClass def4 = DefineClass("Errno::EACCES", typeof(Ruby.Builtins.Errno.AccessError), null, null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, null); + Ruby.Builtins.RubyClass def5 = DefineClass("Errno::EBADF", typeof(Ruby.Builtins.Errno.BadFileDescriptorError), null, null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, null); + Ruby.Builtins.RubyClass def6 = DefineClass("Errno::EDOM", typeof(Ruby.Builtins.Errno.DomainError), null, null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, null); + Ruby.Builtins.RubyClass def7 = DefineClass("Errno::EEXIST", typeof(Ruby.Builtins.Errno.ExistError), null, null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, null); + Ruby.Builtins.RubyClass def8 = DefineClass("Errno::EINVAL", typeof(Ruby.Builtins.Errno.InvalidError), null, null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, null); + Ruby.Builtins.RubyClass def9 = DefineClass("Errno::ENOENT", typeof(Ruby.Builtins.Errno.NoEntryError), null, null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, null); + Ruby.Builtins.RubyClass def10 = DefineClass("Errno::ENOTDIR", typeof(Ruby.Builtins.Errno.NotDirectoryError), null, null, null, def32, Ruby.Builtins.RubyModule.EmptyArray, null); + DefineGlobalClass("FloatDomainError", typeof(Ruby.Builtins.FloatDomainError), null, null, null, def33, Ruby.Builtins.RubyModule.EmptyArray, null); + DefineGlobalClass("NoMethodError", typeof(System.MissingMethodException), typeof(Ruby.Builtins.NoMethodErrorOps), new System.Action(LoadNoMethodError_Instance), null, def46, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.NoMethodErrorOps.Factory), }); #if !SILVERLIGHT - Ruby.Builtins.RubyClass def36 = DefineGlobalClass("TCPSocket", typeof(Ruby.Builtins.TCPSocket), null, new System.Action(LoadTCPSocket_Instance), new System.Action(LoadTCPSocket_Class), def37, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + Ruby.Builtins.RubyClass def43 = DefineGlobalClass("TCPSocket", typeof(Ruby.Builtins.TCPSocket), null, new System.Action(LoadTCPSocket_Instance), new System.Action(LoadTCPSocket_Class), def44, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.TCPSocket.CreateTCPSocket), }); #endif + Ruby.Builtins.RubyClass def21 = DefineClass("Zlib::DataError", typeof(Ruby.StandardLibrary.Zlib.DataError), null, null, null, def45, Ruby.Builtins.RubyModule.EmptyArray, null); + Ruby.Builtins.RubyClass def23 = DefineClass("Zlib::GzipFile::Error", typeof(Ruby.StandardLibrary.Zlib.GZipFile.Error), null, null, null, def45, Ruby.Builtins.RubyModule.EmptyArray, null); #if !SILVERLIGHT - DefineGlobalClass("TCPServer", typeof(Ruby.Builtins.TCPServer), null, new System.Action(LoadTCPServer_Instance), null, def36, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { + DefineGlobalClass("TCPServer", typeof(Ruby.Builtins.TCPServer), null, new System.Action(LoadTCPServer_Instance), null, def43, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.TCPServer.CreateTCPServer), }); #endif @@ -219,7 +236,11 @@ def11.SetConstant("Class", def13); def17.SetConstant("Digest", def18); def16.SetConstant("HMAC", def19); + def20.SetConstant("GzipFile", def22); + def20.SetConstant("ZStream", def26); def11.SetConstant("Base", def12); + def20.SetConstant("GzipReader", def24); + def20.SetConstant("Inflate", def25); #if !SILVERLIGHT def11.SetConstant("MD5", def15); #endif @@ -230,6 +251,8 @@ def3.SetConstant("EINVAL", def8); def3.SetConstant("ENOENT", def9); def3.SetConstant("ENOTDIR", def10); + def20.SetConstant("DataError", def21); + def22.SetConstant("Error", def23); } private void Load__ClassSingleton_Instance(Ruby.Builtins.RubyModule/*!*/ module) { @@ -332,6 +355,10 @@ new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ArrayOps.InPlaceReverse), }); + module.DefineMethod("reverse_each", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ArrayOps.ReverseEach), + }); + module.DefineMethod("sort", 0x9, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ArrayOps.Sort), }); @@ -2262,10 +2289,35 @@ private void LoadModule_Instance(Ruby.Builtins.RubyModule/*!*/ module) { + module.DefineMethod("<", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ModuleOps.IsSubclassOrIncluded), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ModuleOps.InvalidComparison), + }); + + module.DefineMethod("<=", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ModuleOps.IsSubclassSameOrIncluded), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ModuleOps.InvalidComparison), + }); + + module.DefineMethod("<=>", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ModuleOps.Comparison), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ModuleOps.Comparison), + }); + module.DefineMethod("===", 0x9, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ModuleOps.CaseEquals), }); + module.DefineMethod(">", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ModuleOps.IsNotSubclassOrIncluded), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ModuleOps.InvalidComparison), + }); + + module.DefineMethod(">=", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ModuleOps.IsNotSubclassSameOrIncluded), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ModuleOps.InvalidComparison), + }); + module.DefineMethod("alias_method", 0xa, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ModuleOps.AliasMethod), new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ModuleOps.AliasMethod), @@ -2467,6 +2519,7 @@ module.DefineMethod("undef_method", 0xa, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ModuleOps.UndefineMethod), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ModuleOps.UndefineMethod), }); } @@ -2790,6 +2843,13 @@ module.SetConstant("IGNORECASE", Ruby.Builtins.RegexpOps.IGNORECASE); module.SetConstant("MULTILINE", Ruby.Builtins.RegexpOps.MULTILINE); + module.DefineMethod("compile", 0x11, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RegexpOps.Compile), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RegexpOps.Compile), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RegexpOps.Compile), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RegexpOps.Compile), + }); + module.DefineMethod("escape", 0x11, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RegexpOps.Escape), new Microsoft.Scripting.Utils.Function(Ruby.Builtins.RegexpOps.Escape), @@ -3033,6 +3093,14 @@ new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.MutableStringLength), }); + module.DefineMethod("ljust", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.LeftJustify), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.LeftJustify), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.LeftJustify), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.LeftJustify), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.LeftJustify), + }); + module.DefineMethod("match", 0x9, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.MatchRegexp), new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.MatchObject), @@ -3043,6 +3111,14 @@ new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.Replace), }); + module.DefineMethod("rjust", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.RightJustify), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.RightJustify), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.RightJustify), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.RightJustify), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.RightJustify), + }); + module.DefineMethod("scan", 0x9, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.Scan), new Microsoft.Scripting.Utils.Function(Ruby.Builtins.MutableStringOps.Scan), @@ -4285,5 +4361,139 @@ } + private void LoadZlib_Instance(Ruby.Builtins.RubyModule/*!*/ module) { + module.SetConstant("FIXLCODES", Ruby.StandardLibrary.Zlib.FIXLCODES); + module.SetConstant("MAX_WBITS", Ruby.StandardLibrary.Zlib.MAX_WBITS); + module.SetConstant("MAXBITS", Ruby.StandardLibrary.Zlib.MAXBITS); + module.SetConstant("MAXCODES", Ruby.StandardLibrary.Zlib.MAXCODES); + module.SetConstant("MAXDCODES", Ruby.StandardLibrary.Zlib.MAXDCODES); + module.SetConstant("MAXLCODES", Ruby.StandardLibrary.Zlib.MAXLCODES); + module.SetConstant("VERSION", Ruby.StandardLibrary.Zlib.VERSION); + module.SetConstant("Z_DEFLATED", Ruby.StandardLibrary.Zlib.Z_DEFLATED); + module.SetConstant("ZLIB_VERSION", Ruby.StandardLibrary.Zlib.ZLIB_VERSION); + + } + + private void LoadZlib__GzipReader_Instance(Ruby.Builtins.RubyModule/*!*/ module) { + module.SetConstant("OSES", Ruby.StandardLibrary.Zlib.GZipReader.OSES); + + module.DefineMethod("comment", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.GZipReader.Comment), + }); + + module.DefineMethod("open", 0xa, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.GZipReader.Open), + }); + + module.DefineMethod("original_name", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.GZipReader.OriginalName), + }); + + module.DefineMethod("read", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.GZipReader.Read), + }); + + module.DefineMethod("xtra_field", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function>(Ruby.StandardLibrary.Zlib.GZipReader.ExtraField), + }); + + } + + private void LoadZlib__GzipReader_Class(Ruby.Builtins.RubyModule/*!*/ module) { + module.SetConstant("OSES", Ruby.StandardLibrary.Zlib.GZipReader.OSES); + + module.DefineMethod("open", 0x11, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.GZipReader.Open), + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.GZipReader.Open), + new Microsoft.Scripting.Utils.Action(Ruby.StandardLibrary.Zlib.GZipReader.Open), + new Microsoft.Scripting.Utils.Action(Ruby.StandardLibrary.Zlib.GZipReader.Open), + }); + + } + + private void LoadZlib__Inflate_Instance(Ruby.Builtins.RubyModule/*!*/ module) { + + module.DefineMethod("close", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.Inflate.Close), + }); + + module.DefineMethod("inflate", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.Inflate.InflateStream), + }); + + } + + private void LoadZlib__Inflate_Class(Ruby.Builtins.RubyModule/*!*/ module) { + + module.DefineMethod("inflate", 0x11, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.Inflate.InflateStream), + }); + + } + + private void LoadZlib__ZStream_Instance(Ruby.Builtins.RubyModule/*!*/ module) { + + module.DefineMethod("adler", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.ZStream.Adler), + }); + + module.DefineMethod("avail_in", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.ZStream.AvailIn), + }); + + module.DefineMethod("avail_out", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.ZStream.GetAvailOut), + }); + + module.DefineMethod("avail_out=", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.ZStream.SetAvailOut), + }); + + module.DefineMethod("close", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.ZStream.Close), + }); + + module.DefineMethod("closed?", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.ZStream.IsClosed), + }); + + module.DefineMethod("data_type", 0x9, new System.Delegate[] { + new System.Action(Ruby.StandardLibrary.Zlib.ZStream.DataType), + }); + + module.DefineMethod("finish", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.ZStream.Close), + }); + + module.DefineMethod("finished?", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.ZStream.IsClosed), + }); + + module.DefineMethod("flush_next_in", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function>(Ruby.StandardLibrary.Zlib.ZStream.FlushNextIn), + }); + + module.DefineMethod("flush_next_out", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function>(Ruby.StandardLibrary.Zlib.ZStream.FlushNextOut), + }); + + module.DefineMethod("reset", 0x9, new System.Delegate[] { + new System.Action(Ruby.StandardLibrary.Zlib.ZStream.Reset), + }); + + module.DefineMethod("stream_end?", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.ZStream.IsClosed), + }); + + module.DefineMethod("total_in", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.ZStream.TotalIn), + }); + + module.DefineMethod("total_out", 0x9, new System.Delegate[] { + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.Zlib.ZStream.TotalOut), + }); + + } + } } =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/IronRuby.Libraries.csproj;C420856 File: IronRuby.Libraries.csproj =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/IronRuby.Libraries.csproj;C420856 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/IronRuby.Libraries.csproj;bugfixes9 @@ -128,6 +128,7 @@ + =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ArrayOps.cs;C417565 File: ArrayOps.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ArrayOps.cs;C417565 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ArrayOps.cs;bugfixes9 @@ -97,6 +97,33 @@ return self; } + //----------------------------------------------------- Array#reverse_each + // array.reverse_each {|item| block } + //------------------------------------------------------------------------ + // Same as +Array#each+, but traverses _self_ in reverse order. + // a = [ "a", "b", "c" ] + // a.reverse_each {|x| print x, " " } + // produces: + // c b a + + private static readonly DynamicSite/*!*/ ReverseEachSharedSite = + CallSiteFactory.CreateSimpleCallSite(RubyContext.RubyBinder); + + [RubyMethod("reverse_each")] + public static object ReverseEach(CodeContext/*!*/ context, RubyArray/*!*/ self, BlockParam block) { + Assert.NotNull(context, self); + + if (self.Count > 0 && block == null) { + throw new LocalJumpError("no block given"); + } + + for (int i = self.Count - 1; i >= 0; --i) { + object result = ReverseEachSharedSite.Invoke(context, block, self[i]); + if (block.BlockJumped(result)) return result; + } + return self; + } + #region sort!, sort private static readonly DynamicSite _SortSite = CallSiteFactory.CreateSimpleCallSite(RubyContext.RubyBinder); =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ModuleOps.cs;C427406 File: ModuleOps.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ModuleOps.cs;C427406 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ModuleOps.cs;bugfixes9 @@ -384,26 +384,79 @@ return self; } + [RubyMethod("undef_method", RubyMethodAttributes.PrivateInstance)] + public static RubyModule/*!*/ UndefineMethod(CodeContext/*!*/ context, RubyModule/*!*/ self, MutableString/*!*/ name) { + return UndefineMethod(self, Protocols.CastToSymbol(context, name)); + } + #endregion #endregion #region Public Instance Methods - #region <, >, <=, >=, <=>, ==, ===, ancestors, included_modules, include? // TODO: + #region <, >, <=, >=, <=>, ==, ===, ancestors, included_modules, include? - // < - // <= - // <=> - // > - // >= - // == - [RubyMethod("===")] public static bool CaseEquals(RubyModule/*!*/ self, object other) { return self.ExecutionContext.GetClassOf(other).HasAncestor(self); } + [RubyMethod("<")] + public static object IsSubclassOrIncluded(RubyModule/*!*/ self, [NotNull]RubyModule/*!*/ module) { + if (Object.ReferenceEquals(self, module)) + return false; + return self.HasAncestor(module) ? (object)true : null; + } + + [RubyMethod("<=")] + public static object IsSubclassSameOrIncluded(RubyModule/*!*/ self, [NotNull]RubyModule/*!*/ module) { + if (self.HasAncestor(module)) + return true; + return module.HasAncestor(self) ? (object)false : null; + } + + [RubyMethod(">")] + public static object IsNotSubclassOrIncluded(RubyModule/*!*/ self, [NotNull]RubyModule/*!*/ module) { + if (Object.ReferenceEquals(self, module)) + return false; + return module.HasAncestor(self) ? (object)true : null; + } + + [RubyMethod(">=")] + public static object IsNotSubclassSameOrIncluded(RubyModule/*!*/ self, [NotNull]RubyModule/*!*/ module) { + if (module.HasAncestor(self)) + return true; + return self.HasAncestor(module) ? (object)false : null; + } + + [RubyMethod("<=>")] + public static object Comparison(RubyModule/*!*/ self, [NotNull]RubyModule/*!*/ module) { + if (Object.ReferenceEquals(self, module)) + return RuntimeHelpers.Int32ToObject(0); + + if (self.HasAncestor(module)) + return RuntimeHelpers.Int32ToObject(-1); + + if (module.HasAncestor(self)) + return RuntimeHelpers.Int32ToObject(1); + + return null; + } + + [RubyMethod("<=>")] + public static object Comparison(RubyModule/*!*/ self, object module) { + return null; + } + + [RubyMethod("<")] + [RubyMethod(">")] + [RubyMethod("<=")] + [RubyMethod(">=")] + public static object InvalidComparison(RubyModule/*!*/ self, object module) { + throw RubyExceptions.CreateTypeError("compared with non class/module"); + } + [RubyMethod("ancestors")] public static RubyArray/*!*/ Ancestors(RubyModule/*!*/ self) { RubyArray ancestors = new RubyArray(); =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/MutableStringOps.cs;C422137 File: MutableStringOps.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/MutableStringOps.cs;C422137 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/MutableStringOps.cs;bugfixes9 @@ -2817,5 +2817,122 @@ } #endregion + + //----------------------------------------------------------- String#ljust + // str.ljust(integer, padstr=' ') => new_str + //------------------------------------------------------------------------ + // If _integer_ is greater than the length of _str_, returns a new + // +String+ of length _integer_ with _str_ left justified and padded + // with _padstr_; otherwise, returns _str_. + + // "hello".ljust(4) #=> "hello" + // "hello".ljust(20) #=> "hello " + // "hello".ljust(20, '1234') #=> "hello123412341234123" + + #region ljust + + [RubyMethod("ljust")] + public static MutableString/*!*/ LeftJustify(CodeContext/*!*/ context, MutableString/*!*/ self, int width, [NotNull]MutableString/*!*/ padding) { + if (padding.Length == 0) + throw RubyExceptions.CreateArgumentError("zero width padding"); + + int count = width - self.Length; + if (count <= 0) + return self; + + int iterations = count / padding.Length; + int remainder = count % padding.Length; + MutableString result = CreateSubClass(context, self, self); + + for (int i = 0; i < iterations; i++) + result.Append(padding); + + result.Append(padding.Substring(0, remainder)); + + return Kernel.FlowTaint(context, self, padding, result); + } + + [RubyMethod("ljust")] + public static MutableString/*!*/ LeftJustify(CodeContext/*!*/ context, MutableString/*!*/ self, object width, [NotNull]MutableString/*!*/ padding) { + return LeftJustify(context, self, Protocols.CastToFixnum(context, width), padding); + } + + [RubyMethod("ljust")] + public static MutableString/*!*/ LeftJustify(CodeContext/*!*/ context, MutableString/*!*/ self, object width, object padding) { + return LeftJustify(context, self, Protocols.CastToFixnum(context, width), Protocols.CastToString(context, padding)); + } + + [RubyMethod("ljust")] + public static MutableString/*!*/ LeftJustify(CodeContext/*!*/ context, MutableString/*!*/ self, int width) { + // TODO: is this correct? Is it just a space or is this some configurable whitespace thing? + return LeftJustify(context, self, width, new MutableString(" ")); + } + + [RubyMethod("ljust")] + public static MutableString/*!*/ LeftJustify(CodeContext/*!*/ context, MutableString/*!*/ self, object width) { + // TODO: is this correct? Is it just a space or is this some configurable whitespace thing? + return LeftJustify(context, self, Protocols.CastToFixnum(context, width), new MutableString(" ")); + } + + #endregion + + //----------------------------------------------------------- String#rjust + // str.rjust(integer, padstr=' ') => new_str + //------------------------------------------------------------------------ + // If _integer_ is greater than the length of _str_, returns a new + // +String+ of length _integer_ with _str_ right justified and padded + // with _padstr_; otherwise, returns _str_. + + // "hello".rjust(4) #=> "hello" + // "hello".rjust(20) #=> " hello" + // "hello".rjust(20, '1234') #=> "123412341234123hello" + + #region rjust + + [RubyMethod("rjust")] + public static MutableString/*!*/ RightJustify(CodeContext/*!*/ context, MutableString/*!*/ self, int width, MutableString/*!*/ padding) { + if (padding.Length == 0) + throw RubyExceptions.CreateArgumentError("zero width padding"); + + int count = width - self.Length; + if (count <= 0) + return self; + + int iterations = count / padding.Length; + int remainder = count % padding.Length; + MutableString result = CreateSubClass(context, self); + + for (int i = 0; i < iterations; i++) + result.Append(padding); + + result.Append(padding.Substring(0, remainder)); + result.Append(self); + + return Kernel.FlowTaint(context, self, padding, result); + } + + [RubyMethod("rjust")] + public static MutableString/*!*/ RightJustify(CodeContext/*!*/ context, MutableString/*!*/ self, object width, [NotNull]MutableString/*!*/ padding) { + return RightJustify(context, self, Protocols.CastToFixnum(context, width), padding); + } + + [RubyMethod("rjust")] + public static MutableString/*!*/ RightJustify(CodeContext/*!*/ context, MutableString/*!*/ self, object width, object padding) { + return RightJustify(context, self, Protocols.CastToFixnum(context, width), Protocols.CastToString(context, padding)); + } + + [RubyMethod("rjust")] + public static MutableString/*!*/ RightJustify(CodeContext/*!*/ context, MutableString/*!*/ self, int width) { + // TODO: is this correct? Is it just a space or is this some configurable whitespace thing? + return RightJustify(context, self, width, new MutableString(" ")); + } + + [RubyMethod("rjust")] + public static MutableString/*!*/ RightJustify(CodeContext/*!*/ context, MutableString/*!*/ self, object width) { + // TODO: is this correct? Is it just a space or is this some configurable whitespace thing? + return RightJustify(context, self, Protocols.CastToFixnum(context, width), new MutableString(" ")); + } + + #endregion } } =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/Numeric.cs;C415805 File: Numeric.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/Numeric.cs;C415805 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/Numeric.cs;bugfixes9 @@ -28,6 +28,8 @@ [RubyClass("Numeric"), Includes(typeof(Comparable))] public abstract class Numeric : Object { + public Numeric() { } + #region +@ /// /// Unary plus - returns the receivers value =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/RegexpOps.cs;C422137 File: RegexpOps.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/RegexpOps.cs;C422137 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/RegexpOps.cs;bugfixes9 @@ -26,7 +26,6 @@ //declared private instance methods: // initialize // initialize_copy - //declared protected instance methods: //declared public instance methods: // == // casefold? @@ -39,10 +38,75 @@ // taguri= // to_s //declared singleton methods: - // compile // union - //declared class variables: + //------------------------------------------------------------ Regexp::new + // Regexp.new(string [, options [, lang]]) => regexp + // Regexp.new(regexp) => regexp + // Regexp.compile(string [, options [, lang]]) => regexp + // Regexp.compile(regexp) => regexp + //------------------------------------------------------------------------ + // Constructs a new regular expression from _pattern_, which can be + // either a +String+ or a +Regexp+ (in which case that regexp's + // options are propagated, and new options may not be specified (a + // change as of Ruby 1.8). If _options_ is a +Fixnum+, it should be + // one or more of the constants +Regexp::EXTENDED+, + // +Regexp::IGNORECASE+, and +Regexp::MULTILINE+, _or_-ed together. + // Otherwise, if _options_ is not +nil+, the regexp will be case + // insensitive. The _lang_ parameter enables multibyte support for the + // regexp: `n', `N' = none, `e', `E' = EUC, `s', `S' = SJIS, `u', `U' + // = UTF-8. + + // r1 = Regexp.new('^a-z+:\s+\w+') #=> /^a-z+:\s+\w+/ + // r2 = Regexp.new('cat', true) #=> /cat/i + // r3 = Regexp.new('dog', Regexp::EXTENDED) #=> /dog/x + // r4 = Regexp.new(r2) #=> /cat/i + + #region constructors, compile + + [RubyConstructor] + public static Regexp/*!*/ Create() { + return new Regexp(); + } + + [RubyConstructor] + public static Regexp/*!*/ Create(MutableString/*!*/ str) { + return RubyOps.CreateRegexp(Ruby.Compiler.Ast.RegExOptions.NONE, str); + } + + [RubyConstructor] + public static Regexp/*!*/ Create(MutableString/*!*/ str, int options) { + return RubyOps.CreateRegexp((Ruby.Compiler.Ast.RegExOptions)options, str); + } + + // TODO: today we are ignoring the lang parameter + [RubyConstructor] + public static Regexp/*!*/ Create(MutableString/*!*/ str, int options, MutableString/*!*/ lang) { + return RubyOps.CreateRegexp((Ruby.Compiler.Ast.RegExOptions)options, str); + } + + [RubyMethod("compile", RubyMethodAttributes.PublicSingleton)] + public static Regexp/*!*/ Compile(RubyClass/*!*/ self) { + return Create(); + } + + [RubyMethod("compile", RubyMethodAttributes.PublicSingleton)] + public static Regexp/*!*/ Compile(RubyClass/*!*/ self, MutableString/*!*/ str) { + return Create(str); + } + + [RubyMethod("compile", RubyMethodAttributes.PublicSingleton)] + public static Regexp/*!*/ Compile(RubyClass/*!*/ self, MutableString/*!*/ str, int options) { + return Create(str, options); + } + + [RubyMethod("compile", RubyMethodAttributes.PublicSingleton)] + public static Regexp/*!*/ Compile(RubyClass/*!*/ self, MutableString/*!*/ str, int options, MutableString/*!*/ lang) { + return Create(str, options, lang); + } + + #endregion + [RubyConstant] public const int IGNORECASE = 1; =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/Regexp.cs;C417565 File: Regexp.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/Regexp.cs;C417565 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/Regexp.cs;bugfixes9 @@ -30,11 +30,6 @@ _regex = regex; } - public Regexp(string/*!*/ str) { - ContractUtils.RequiresNotNull(str, "str"); - _regex = new Regex(str); - } - public Regexp(MutableString/*!*/ str) { ContractUtils.RequiresNotNull(str, "str"); _regex = new Regex(str); =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Parser/Parser.Generated.cs;C392185 File: Parser.Generated.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Parser/Parser.Generated.cs;C392185 (server) 5/2/2008 11:04 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Parser/Parser.Generated.cs;bugfixes9 @@ -3776,6 +3776,7 @@ // @8 -> #line 1067 "Parser.y" { + yyval.Integer = _tokenizer.CMDARG; _tokenizer.CMDARG_PUSH(1); } } @@ -3783,9 +3784,9 @@ private void _260() { // command_args -> @8 command_args_content -#line 1071 "Parser.y" +#line 1072 "Parser.y" { - _tokenizer.CMDARG_POP(); + _tokenizer.CMDARG = GetValue(2).Integer; yyval.Arguments = GetValue(1).Arguments; } } @@ -3793,7 +3794,7 @@ private void _262() { // @9 -> -#line 1080 "Parser.y" +#line 1081 "Parser.y" { _tokenizer.SetState(LexicalState.EXPR_ENDARG); } @@ -3802,7 +3803,7 @@ private void _263() { // command_args_content -> LparenArg @9 ')' -#line 1084 "Parser.y" +#line 1085 "Parser.y" { _tokenizer.ReportWarning("don't put space before argument parentheses"); yyval.Arguments = null; @@ -3812,7 +3813,7 @@ private void _264() { // @10 -> -#line 1089 "Parser.y" +#line 1090 "Parser.y" { _tokenizer.SetState(LexicalState.EXPR_ENDARG); } @@ -3821,7 +3822,7 @@ private void _265() { // command_args_content -> LparenArg closed_args @10 ')' -#line 1093 "Parser.y" +#line 1094 "Parser.y" { _tokenizer.ReportWarning("don't put space before argument parentheses"); yyval.Arguments = GetValue(3).Arguments; @@ -3831,7 +3832,7 @@ private void _266() { // block_arg -> Ampersand arg -#line 1100 "Parser.y" +#line 1101 "Parser.y" { yyval.BlockReference = new BlockReference(GetValue(1).Expression, yyloc); } @@ -3840,7 +3841,7 @@ private void _267() { // opt_block_arg -> ',' block_arg -#line 1106 "Parser.y" +#line 1107 "Parser.y" { yyval.BlockReference = GetValue(1).BlockReference; } @@ -3849,7 +3850,7 @@ private void _268() { // opt_block_arg -> -#line 1110 "Parser.y" +#line 1111 "Parser.y" { yyval.BlockReference = null; } @@ -3858,7 +3859,7 @@ private void _269() { // args -> arg -#line 1116 "Parser.y" +#line 1117 "Parser.y" { yyval.Expressions = CollectionUtils.MakeList(GetValue(1).Expression); } @@ -3867,7 +3868,7 @@ private void _270() { // args -> args ',' arg -#line 1120 "Parser.y" +#line 1121 "Parser.y" { GetValue(3).Expressions.Add(GetValue(1).Expression); yyval.Expressions = GetValue(3).Expressions; @@ -3877,7 +3878,7 @@ private void _272() { // primary -> symbol -#line 1128 "Parser.y" +#line 1129 "Parser.y" { yyval.Expression = new Literal(GetValue(1).SymbolId, yyloc); } @@ -3886,7 +3887,7 @@ private void _274() { // primary -> string_concatenation -#line 1133 "Parser.y" +#line 1134 "Parser.y" { yyval.Expression = new StringConstructor(GetValue(1).Expressions, StringKind.Mutable, GetLocation(1)); } @@ -3895,7 +3896,7 @@ private void _280() { // primary -> match_reference -#line 1142 "Parser.y" +#line 1143 "Parser.y" { yyval.Expression = GetValue(1).RegexMatchReference; } @@ -3904,7 +3905,7 @@ private void _281() { // primary -> FunctionIdentifier -#line 1146 "Parser.y" +#line 1147 "Parser.y" { yyval.Expression = new MethodCall(null, GetValue(1).SymbolId, new Arguments(GetLocation(1)), yyloc); } @@ -3913,7 +3914,7 @@ private void _282() { // primary -> primary SeparatingDoubleColon ConstantIdentifier -#line 1150 "Parser.y" +#line 1151 "Parser.y" { yyval.Expression = new ConstantVariable(GetValue(3).Expression, GetValue(1).SymbolId, yyloc); } @@ -3922,7 +3923,7 @@ private void _283() { // primary -> LeadingDoubleColon ConstantIdentifier -#line 1154 "Parser.y" +#line 1155 "Parser.y" { yyval.Expression = new ConstantVariable(null, GetValue(1).SymbolId, yyloc); } @@ -3931,7 +3932,7 @@ private void _284() { // primary -> primary '[' array_key ']' -#line 1158 "Parser.y" +#line 1159 "Parser.y" { yyval.Expression = new ArrayItemAccess(GetValue(4).Expression, GetValue(2).Arguments, yyloc); } @@ -3940,7 +3941,7 @@ private void _285() { // primary -> Lbrack array_key ']' -#line 1162 "Parser.y" +#line 1163 "Parser.y" { yyval.Expression = new ArrayConstructor(GetValue(2).Arguments, yyloc); } @@ -3949,7 +3950,7 @@ private void _286() { // primary -> Lbrace '}' -#line 1166 "Parser.y" +#line 1167 "Parser.y" { yyval.Expression = new HashConstructor(null, null, yyloc); } @@ -3958,7 +3959,7 @@ private void _287() { // primary -> Lbrace maplets trailer '}' -#line 1170 "Parser.y" +#line 1171 "Parser.y" { yyval.Expression = new HashConstructor(GetValue(3).Maplets, null, yyloc); } @@ -3967,7 +3968,7 @@ private void _288() { // primary -> Lbrace args trailer '}' -#line 1174 "Parser.y" +#line 1175 "Parser.y" { yyval.Expression = new HashConstructor(null, CheckHashExpressions(GetValue(3).Expressions, GetLocation(2)), yyloc); } @@ -3976,7 +3977,7 @@ private void _289() { // primary -> Yield '(' open_args ')' -#line 1178 "Parser.y" +#line 1179 "Parser.y" { yyval.Expression = new YieldCall(GetValue(2).Arguments, yyloc); } @@ -3985,7 +3986,7 @@ private void _290() { // primary -> Yield '(' ')' -#line 1182 "Parser.y" +#line 1183 "Parser.y" { yyval.Expression = new YieldCall(new Arguments(GetLocation(3)), yyloc); } @@ -3994,7 +3995,7 @@ private void _291() { // primary -> Yield -#line 1186 "Parser.y" +#line 1187 "Parser.y" { yyval.Expression = new YieldCall(new Arguments(GetLocation(1)), GetLocation(1)); } @@ -4003,7 +4004,7 @@ private void _292() { // primary -> Defined opt_nl '(' expr ')' -#line 1190 "Parser.y" +#line 1191 "Parser.y" { yyval.Expression = new IsDefinedExpression(GetValue(2).Expression, yyloc); } @@ -4012,7 +4013,7 @@ private void _293() { // primary -> operation brace_block -#line 1194 "Parser.y" +#line 1195 "Parser.y" { yyval.Expression = new MethodCall(null, GetValue(2).SymbolId, new Arguments(null, null, null, GetValue(1).BlockDefinition, GetLocation(2)), yyloc); } @@ -4021,7 +4022,7 @@ private void _295() { // primary -> method_call brace_block -#line 1199 "Parser.y" +#line 1200 "Parser.y" { yyval.Expression = GetValue(2).CallExpression; GetValue(2).CallExpression.SetBlockArgument(GetValue(1).BlockDefinition, GetLocation(1)); @@ -4031,7 +4032,7 @@ private void _296() { // primary -> If expr then compstmt if_tail End -#line 1204 "Parser.y" +#line 1205 "Parser.y" { yyval.Expression = MakeIfExpression(GetValue(5).Expression, GetValue(3).Statements, GetValue(2).ElseIfClauses, yyloc); } @@ -4040,7 +4041,7 @@ private void _297() { // primary -> Unless expr then compstmt else_opt End -#line 1208 "Parser.y" +#line 1209 "Parser.y" { yyval.Expression = new UnlessExpression(GetValue(5).Expression, GetValue(3).Statements, GetValue(2).ElseIfClause, yyloc); } @@ -4049,7 +4050,7 @@ private void _298() { // @11 -> -#line 1212 "Parser.y" +#line 1213 "Parser.y" { _tokenizer.COND_PUSH(1); } @@ -4058,7 +4059,7 @@ private void _299() { // @12 -> -#line 1216 "Parser.y" +#line 1217 "Parser.y" { _tokenizer.COND_POP(); } @@ -4067,7 +4068,7 @@ private void _300() { // primary -> While @11 expr do @12 compstmt End -#line 1220 "Parser.y" +#line 1221 "Parser.y" { yyval.Expression = new WhileLoopExpression(CurrentScope, GetValue(5).Expression, true, GetValue(2).Statements, yyloc); } @@ -4076,7 +4077,7 @@ private void _301() { // @13 -> -#line 1224 "Parser.y" +#line 1225 "Parser.y" { _tokenizer.COND_PUSH(1); } @@ -4085,7 +4086,7 @@ private void _302() { // @14 -> -#line 1228 "Parser.y" +#line 1229 "Parser.y" { _tokenizer.COND_POP(); } @@ -4094,7 +4095,7 @@ private void _303() { // primary -> Until @13 expr do @14 compstmt End -#line 1232 "Parser.y" +#line 1233 "Parser.y" { yyval.Expression = new WhileLoopExpression(CurrentScope, GetValue(5).Expression, false, GetValue(2).Statements, yyloc); } @@ -4103,7 +4104,7 @@ private void _305() { // @15 -> -#line 1237 "Parser.y" +#line 1238 "Parser.y" { _tokenizer.COND_PUSH(1); } @@ -4112,7 +4113,7 @@ private void _306() { // @16 -> -#line 1241 "Parser.y" +#line 1242 "Parser.y" { _tokenizer.COND_POP(); } @@ -4121,7 +4122,7 @@ private void _307() { // primary -> For block_parameters In @15 expr do @16 compstmt End -#line 1245 "Parser.y" +#line 1246 "Parser.y" { yyval.Expression = new ForLoopExpression(GetValue(8).CompoundLeftValue, GetValue(5).Expression, GetValue(2).Statements, yyloc); } @@ -4130,7 +4131,7 @@ private void _310() { // @17 -> -#line 1254 "Parser.y" +#line 1255 "Parser.y" { _tokenizer.SetState(LexicalState.EXPR_ENDARG); } @@ -4139,7 +4140,7 @@ private void _311() { // block_expression -> LparenArg expr @17 opt_nl ')' -#line 1258 "Parser.y" +#line 1259 "Parser.y" { _tokenizer.ReportWarning("(...) interpreted as grouped expression"); yyval.Expression = new BlockExpression(new Body(CollectionUtils.MakeList(new ExpressionStatement(GetValue(4).Expression)), null, null, null, yyloc), yyloc); @@ -4149,7 +4150,7 @@ private void _312() { // block_expression -> LeftParen compstmt ')' -#line 1263 "Parser.y" +#line 1264 "Parser.y" { yyval.Expression = new BlockExpression(new Body(GetValue(2).Statements, null, null, null, yyloc), yyloc); } @@ -4158,7 +4159,7 @@ private void _313() { // block_expression -> Begin body End -#line 1267 "Parser.y" +#line 1268 "Parser.y" { yyval.Expression = new BlockExpression(GetValue(2).Body, yyloc); } @@ -4167,7 +4168,7 @@ private void _314() { // @18 -> -#line 1274 "Parser.y" +#line 1275 "Parser.y" { EnterNewScope(ScopeKind.Module); } @@ -4176,7 +4177,7 @@ private void _315() { // declaration_expression -> Class qualified_module_name superclass @18 body End -#line 1278 "Parser.y" +#line 1279 "Parser.y" { if (InMethod) { ErrorSink.Add(_sourceUnit, "class definition in method body", GetLocation(6), -1, Severity.Error); @@ -4189,7 +4190,7 @@ private void _316() { // @19 -> -#line 1286 "Parser.y" +#line 1287 "Parser.y" { yyval.Integer = _inInstanceMethodDefinition; _inInstanceMethodDefinition = 0; @@ -4199,7 +4200,7 @@ private void _317() { // @20 -> -#line 1291 "Parser.y" +#line 1292 "Parser.y" { yyval.Integer = _inSingletonMethodDefinition; _inSingletonMethodDefinition = 0; @@ -4210,7 +4211,7 @@ private void _318() { // declaration_expression -> Class Lshft expr @19 term @20 body End -#line 1297 "Parser.y" +#line 1298 "Parser.y" { _inInstanceMethodDefinition = GetValue(5).Integer; _inSingletonMethodDefinition = GetValue(3).Integer; @@ -4221,7 +4222,7 @@ private void _319() { // @21 -> -#line 1303 "Parser.y" +#line 1304 "Parser.y" { EnterNewScope(ScopeKind.Module); } @@ -4230,7 +4231,7 @@ private void _320() { // declaration_expression -> Module qualified_module_name @21 body End -#line 1307 "Parser.y" +#line 1308 "Parser.y" { if (InMethod) { ErrorSink.Add(_sourceUnit, "module definition in method body", GetLocation(5), -1, Severity.Error); @@ -4243,7 +4244,7 @@ private void _321() { // @22 -> -#line 1315 "Parser.y" +#line 1316 "Parser.y" { _inInstanceMethodDefinition++; EnterNewScope(ScopeKind.Method); @@ -4253,7 +4254,7 @@ private void _322() { // declaration_expression -> Def method_name @22 parameters_declaration body End -#line 1320 "Parser.y" +#line 1321 "Parser.y" { _inInstanceMethodDefinition--; yyval.Expression = new MethodDeclaration(CurrentScope, null, GetValue(5).SymbolId, GetValue(3).Parameters, GetValue(2).Body, yyloc); @@ -4264,7 +4265,7 @@ private void _323() { // @23 -> -#line 1326 "Parser.y" +#line 1327 "Parser.y" { _tokenizer.SetState(LexicalState.EXPR_FNAME); } @@ -4273,7 +4274,7 @@ private void _324() { // @24 -> -#line 1330 "Parser.y" +#line 1331 "Parser.y" { _inSingletonMethodDefinition++; _tokenizer.SetState(LexicalState.EXPR_END); @@ -4284,7 +4285,7 @@ private void _325() { // declaration_expression -> Def singleton dot_or_colon @23 method_name @24 parameters_declaration body End -#line 1336 "Parser.y" +#line 1337 "Parser.y" { _inSingletonMethodDefinition--; yyval.Expression = new MethodDeclaration(CurrentScope, GetValue(8).Expression, GetValue(5).SymbolId, GetValue(3).Parameters, GetValue(2).Body, yyloc); @@ -4295,7 +4296,7 @@ private void _326() { // body -> compstmt rescue_clauses_opt else_opt ensure_opt -#line 1345 "Parser.y" +#line 1346 "Parser.y" { ElseIfClause elseIf = GetValue(2).ElseIfClause; Debug.Assert(elseIf == null || elseIf.Condition == null); @@ -4311,7 +4312,7 @@ private void _327() { // case_expression -> Case expr opt_terms when_clauses else_opt End -#line 1359 "Parser.y" +#line 1360 "Parser.y" { yyval.Expression = new CaseExpression(GetValue(5).Expression, GetValue(3).WhenClauses, GetValue(2).ElseIfClause, yyloc); } @@ -4320,7 +4321,7 @@ private void _328() { // case_expression -> Case opt_terms when_clauses else_opt End -#line 1363 "Parser.y" +#line 1364 "Parser.y" { yyval.Expression = new CaseExpression(null, GetValue(3).WhenClauses, GetValue(2).ElseIfClause, yyloc); } @@ -4329,7 +4330,7 @@ private void _329() { // case_expression -> Case expr opt_terms else_opt End -#line 1367 "Parser.y" +#line 1368 "Parser.y" { yyval.Expression = new CaseExpression(GetValue(4).Expression, null, GetValue(2).ElseIfClause, yyloc); } @@ -4338,7 +4339,7 @@ private void _330() { // case_expression -> Case opt_terms else_opt End -#line 1371 "Parser.y" +#line 1372 "Parser.y" { yyval.Expression = new CaseExpression(null, null, GetValue(2).ElseIfClause, yyloc); } @@ -4347,7 +4348,7 @@ private void _338() { // if_tail -> else_opt -#line 1391 "Parser.y" +#line 1392 "Parser.y" { yyval.ElseIfClauses = MakeListAddOpt(GetValue(1).ElseIfClause); } @@ -4356,7 +4357,7 @@ private void _339() { // if_tail -> Elsif expr then compstmt if_tail -#line 1395 "Parser.y" +#line 1396 "Parser.y" { GetValue(1).ElseIfClauses.Add(new ElseIfClause(GetValue(4).Expression, GetValue(2).Statements, yyloc)); yyval.ElseIfClauses = GetValue(1).ElseIfClauses; @@ -4366,7 +4367,7 @@ private void _340() { // else_opt -> -#line 1402 "Parser.y" +#line 1403 "Parser.y" { yyval.ElseIfClause = null; } @@ -4375,7 +4376,7 @@ private void _341() { // else_opt -> Else compstmt -#line 1406 "Parser.y" +#line 1407 "Parser.y" { yyval.ElseIfClause = new ElseIfClause(null, GetValue(1).Statements, yyloc); } @@ -4384,7 +4385,7 @@ private void _342() { // block_parameters -> lhs -#line 1413 "Parser.y" +#line 1414 "Parser.y" { yyval.CompoundLeftValue = new CompoundLeftValue(CollectionUtils.MakeList(GetValue(1).LeftValue), null, GetLocation(1)); } @@ -4393,7 +4394,7 @@ private void _343() { // block_parameters -> compound_lhs -#line 1417 "Parser.y" +#line 1418 "Parser.y" { yyval.CompoundLeftValue = GetValue(1).CompoundLeftValue; } @@ -4402,7 +4403,7 @@ private void _344() { // block_parameters_opt -> -#line 1424 "Parser.y" +#line 1425 "Parser.y" { yyval.CompoundLeftValue = CompoundLeftValue.Null; } @@ -4411,7 +4412,7 @@ private void _345() { // block_parameters_opt -> '|' '|' -#line 1428 "Parser.y" +#line 1429 "Parser.y" { yyval.CompoundLeftValue = CompoundLeftValue.Null; } @@ -4420,7 +4421,7 @@ private void _346() { // block_parameters_opt -> BitwiseOr -#line 1432 "Parser.y" +#line 1433 "Parser.y" { yyval.CompoundLeftValue = CompoundLeftValue.Null; } @@ -4429,7 +4430,7 @@ private void _347() { // block_parameters_opt -> '|' block_parameters '|' -#line 1436 "Parser.y" +#line 1437 "Parser.y" { yyval.CompoundLeftValue = GetValue(2).CompoundLeftValue; } @@ -4438,7 +4439,7 @@ private void _348() { // @25 -> -#line 1442 "Parser.y" +#line 1443 "Parser.y" { EnterNewScope(ScopeKind.Block); } @@ -4447,7 +4448,7 @@ private void _349() { // @26 -> -#line 1446 "Parser.y" +#line 1447 "Parser.y" { // Empty placeholder } @@ -4456,7 +4457,7 @@ private void _350() { // do_block -> BlockDo @25 block_parameters_opt @26 compstmt End -#line 1450 "Parser.y" +#line 1451 "Parser.y" { yyval.BlockDefinition = new BlockDefinition(CurrentScope, GetValue(4).CompoundLeftValue, GetValue(2).Statements, yyloc); LeaveScope(); @@ -4466,7 +4467,7 @@ private void _351() { // block_call -> command do_block -#line 1457 "Parser.y" +#line 1458 "Parser.y" { GetValue(2).CallExpression.Arguments.Block = GetValue(1).BlockDefinition; yyval.CallExpression = GetValue(2).CallExpression; @@ -4476,7 +4477,7 @@ private void _352() { // block_call -> block_call '.' operation2 opt_paren_args -#line 1462 "Parser.y" +#line 1463 "Parser.y" { yyval.CallExpression = new MethodCall(GetValue(4).CallExpression, GetValue(2).SymbolId, GetValue(1).Arguments, yyloc); } @@ -4485,7 +4486,7 @@ private void _353() { // block_call -> block_call SeparatingDoubleColon operation2 opt_paren_args -#line 1466 "Parser.y" +#line 1467 "Parser.y" { yyval.CallExpression = new MethodCall(GetValue(4).CallExpression, GetValue(2).SymbolId, GetValue(1).Arguments, yyloc); } @@ -4494,7 +4495,7 @@ private void _354() { // method_call -> operation paren_args -#line 1472 "Parser.y" +#line 1473 "Parser.y" { yyval.CallExpression = new MethodCall(null, GetValue(2).SymbolId, GetValue(1).Arguments, yyloc); } @@ -4503,7 +4504,7 @@ private void _355() { // method_call -> primary '.' operation2 opt_paren_args -#line 1476 "Parser.y" +#line 1477 "Parser.y" { yyval.CallExpression = new MethodCall(GetValue(4).Expression, GetValue(2).SymbolId, GetValue(1).Arguments, yyloc); } @@ -4512,7 +4513,7 @@ private void _356() { // method_call -> primary SeparatingDoubleColon operation2 paren_args -#line 1480 "Parser.y" +#line 1481 "Parser.y" { yyval.CallExpression = new MethodCall(GetValue(4).Expression, GetValue(2).SymbolId, GetValue(1).Arguments, yyloc); } @@ -4521,7 +4522,7 @@ private void _357() { // method_call -> primary SeparatingDoubleColon operation3 -#line 1484 "Parser.y" +#line 1485 "Parser.y" { yyval.CallExpression = new MethodCall(GetValue(3).Expression, GetValue(1).SymbolId, new Arguments(GetLocation(1)), yyloc); } @@ -4530,7 +4531,7 @@ private void _358() { // method_call -> Super paren_args -#line 1488 "Parser.y" +#line 1489 "Parser.y" { yyval.CallExpression = new SuperCall(CurrentScope, GetValue(1).Arguments, yyloc); } @@ -4539,7 +4540,7 @@ private void _359() { // method_call -> Super -#line 1492 "Parser.y" +#line 1493 "Parser.y" { yyval.CallExpression = new SuperCall(CurrentScope, null, yyloc); } @@ -4548,7 +4549,7 @@ private void _360() { // @27 -> -#line 1499 "Parser.y" +#line 1500 "Parser.y" { EnterNewScope(ScopeKind.Block); } @@ -4557,7 +4558,7 @@ private void _361() { // @28 -> -#line 1503 "Parser.y" +#line 1504 "Parser.y" { } } @@ -4565,7 +4566,7 @@ private void _362() { // brace_block -> '{' @27 block_parameters_opt @28 compstmt '}' -#line 1506 "Parser.y" +#line 1507 "Parser.y" { yyval.BlockDefinition = new BlockDefinition(CurrentScope, GetValue(4).CompoundLeftValue, GetValue(2).Statements, yyloc); LeaveScope(); @@ -4575,7 +4576,7 @@ private void _363() { // @29 -> -#line 1511 "Parser.y" +#line 1512 "Parser.y" { EnterNewScope(ScopeKind.Block); } @@ -4584,7 +4585,7 @@ private void _364() { // @30 -> -#line 1515 "Parser.y" +#line 1516 "Parser.y" { } } @@ -4592,7 +4593,7 @@ private void _365() { // brace_block -> Do @29 block_parameters_opt @30 compstmt End -#line 1518 "Parser.y" +#line 1519 "Parser.y" { yyval.BlockDefinition = new BlockDefinition(CurrentScope, GetValue(4).CompoundLeftValue, GetValue(2).Statements, yyloc); LeaveScope(); @@ -4602,7 +4603,7 @@ private void _366() { // when_clauses -> when_clause -#line 1525 "Parser.y" +#line 1526 "Parser.y" { yyval.WhenClauses = CollectionUtils.MakeList(GetValue(1).WhenClause); } @@ -4611,7 +4612,7 @@ private void _367() { // when_clauses -> when_clauses when_clause -#line 1529 "Parser.y" +#line 1530 "Parser.y" { GetValue(2).WhenClauses.Add(GetValue(1).WhenClause); yyval.WhenClauses = GetValue(2).WhenClauses; @@ -4621,7 +4622,7 @@ private void _368() { // when_clause -> When when_args then compstmt -#line 1536 "Parser.y" +#line 1537 "Parser.y" { yyval.WhenClause = new WhenClause(GetValue(3).Arguments, GetValue(1).Statements, yyloc); } @@ -4630,7 +4631,7 @@ private void _369() { // when_args -> args -#line 1542 "Parser.y" +#line 1543 "Parser.y" { yyval.Arguments = new Arguments(GetValue(1).Expressions, null, null, null, yyloc); } @@ -4639,7 +4640,7 @@ private void _370() { // when_args -> args ',' Star arg -#line 1546 "Parser.y" +#line 1547 "Parser.y" { yyval.Arguments = new Arguments(GetValue(4).Expressions, null, GetValue(1).Expression, null, yyloc); } @@ -4648,7 +4649,7 @@ private void _371() { // when_args -> Star arg -#line 1550 "Parser.y" +#line 1551 "Parser.y" { yyval.Arguments = new Arguments(null, null, GetValue(1).Expression, null, yyloc); } @@ -4657,7 +4658,7 @@ private void _374() { // rescue_clauses -> rescue_clause -#line 1560 "Parser.y" +#line 1561 "Parser.y" { yyval.RescueClauses = CollectionUtils.MakeList(GetValue(1).RescueClause); } @@ -4666,7 +4667,7 @@ private void _375() { // rescue_clauses -> rescue_clauses rescue_clause -#line 1564 "Parser.y" +#line 1565 "Parser.y" { GetValue(2).RescueClauses.Add(GetValue(1).RescueClause); yyval.RescueClauses = GetValue(2).RescueClauses; @@ -4676,7 +4677,7 @@ private void _376() { // rescue_clause -> Rescue exc_list exc_var then compstmt -#line 1572 "Parser.y" +#line 1573 "Parser.y" { yyval.RescueClause = new RescueClause(GetValue(4).Expressions, GetValue(3).LeftValue, GetValue(1).Statements, yyloc); } @@ -4685,7 +4686,7 @@ private void _377() { // exc_list -> arg -#line 1578 "Parser.y" +#line 1579 "Parser.y" { yyval.Expressions = CollectionUtils.MakeList(GetValue(1).Expression); } @@ -4694,7 +4695,7 @@ private void _378() { // exc_list -> compound_rhs -#line 1582 "Parser.y" +#line 1583 "Parser.y" { yyval.Expressions = GetValue(1).CompoundRightValue.RightValues; } @@ -4703,7 +4704,7 @@ private void _380() { // exc_var -> Assoc lhs -#line 1589 "Parser.y" +#line 1590 "Parser.y" { yyval.LeftValue = GetValue(1).LeftValue; } @@ -4712,7 +4713,7 @@ private void _383() { // ensure_opt -> Ensure compstmt -#line 1597 "Parser.y" +#line 1598 "Parser.y" { yyval.Statements = GetValue(1).Statements; } @@ -4721,7 +4722,7 @@ private void _384() { // string_concatenation -> string -#line 1604 "Parser.y" +#line 1605 "Parser.y" { yyval.Expressions = CollectionUtils.MakeList(GetValue(1).Expression); } @@ -4730,7 +4731,7 @@ private void _385() { // string_concatenation -> string_concatenation string -#line 1608 "Parser.y" +#line 1609 "Parser.y" { GetValue(2).Expressions.Add(GetValue(1).Expression); yyval.Expressions = GetValue(2).Expressions; @@ -4740,7 +4741,7 @@ private void _386() { // string -> StringBeg string_contents StringEnd -#line 1616 "Parser.y" +#line 1617 "Parser.y" { yyval.Expression = new StringConstructor(GetValue(2).Expressions, StringKind.Mutable, yyloc); } @@ -4749,7 +4750,7 @@ private void _387() { // shell_string -> ShellStringBegin string_contents StringEnd -#line 1623 "Parser.y" +#line 1624 "Parser.y" { yyval.Expression = new StringConstructor(GetValue(2).Expressions, StringKind.Command, yyloc); } @@ -4758,7 +4759,7 @@ private void _388() { // immutable_string -> Symbeg string_contents StringEnd -#line 1630 "Parser.y" +#line 1631 "Parser.y" { yyval.Expression = new StringConstructor(GetValue(2).Expressions, StringKind.Immutable, yyloc); } @@ -4767,7 +4768,7 @@ private void _389() { // regexp -> RegexpBeg string_contents RegexpEnd -#line 1637 "Parser.y" +#line 1638 "Parser.y" { yyval.Expression = new RegularExpression(GetValue(2).Expressions, GetValue(1).RegExOptions, yyloc); } @@ -4776,7 +4777,7 @@ private void _390() { // words -> WordsBeg WordSeparator StringEnd -#line 1643 "Parser.y" +#line 1644 "Parser.y" { yyval.Expression = new ArrayConstructor(null, yyloc); } @@ -4785,7 +4786,7 @@ private void _391() { // words -> WordsBeg word_list StringEnd -#line 1647 "Parser.y" +#line 1648 "Parser.y" { yyval.Expression = new ArrayConstructor(new Arguments(GetValue(2).Expressions, null, null, null, GetLocation(2)), yyloc); } @@ -4794,7 +4795,7 @@ private void _392() { // word_list -> -#line 1653 "Parser.y" +#line 1654 "Parser.y" { yyval.Expressions = new List(); } @@ -4803,7 +4804,7 @@ private void _393() { // word_list -> word_list word WordSeparator -#line 1657 "Parser.y" +#line 1658 "Parser.y" { GetValue(3).Expressions.Add(new StringConstructor(GetValue(2).Expressions, StringKind.Mutable, GetLocation(2))); yyval.Expressions = GetValue(3).Expressions; @@ -4813,7 +4814,7 @@ private void _394() { // word -> string_content -#line 1664 "Parser.y" +#line 1665 "Parser.y" { yyval.Expressions = CollectionUtils.MakeList(GetValue(1).Expression); } @@ -4822,7 +4823,7 @@ private void _395() { // word -> word string_content -#line 1668 "Parser.y" +#line 1669 "Parser.y" { GetValue(2).Expressions.Add(GetValue(1).Expression); yyval.Expressions = GetValue(2).Expressions; @@ -4832,7 +4833,7 @@ private void _396() { // verbatim_words -> VerbatimWordsBegin WordSeparator StringEnd -#line 1675 "Parser.y" +#line 1676 "Parser.y" { yyval.Expression = new ArrayConstructor(null, yyloc); } @@ -4841,7 +4842,7 @@ private void _397() { // verbatim_words -> VerbatimWordsBegin verbatim_word_list StringEnd -#line 1679 "Parser.y" +#line 1680 "Parser.y" { yyval.Expression = new ArrayConstructor(new Arguments(GetValue(2).Expressions, null, null, null, GetLocation(2)), yyloc); } @@ -4850,7 +4851,7 @@ private void _398() { // verbatim_word_list -> -#line 1685 "Parser.y" +#line 1686 "Parser.y" { yyval.Expressions = new List(); } @@ -4859,7 +4860,7 @@ private void _399() { // verbatim_word_list -> verbatim_word_list StringContent WordSeparator -#line 1689 "Parser.y" +#line 1690 "Parser.y" { GetValue(3).Expressions.Add(new Literal(GetValue(2).String, GetLocation(2))); yyval.Expressions = GetValue(3).Expressions; @@ -4869,7 +4870,7 @@ private void _400() { // string_contents -> -#line 1697 "Parser.y" +#line 1698 "Parser.y" { yyval.Expressions = new List(); } @@ -4878,7 +4879,7 @@ private void _401() { // string_contents -> string_contents string_content -#line 1701 "Parser.y" +#line 1702 "Parser.y" { GetValue(2).Expressions.Add(GetValue(1).Expression); yyval.Expressions = GetValue(2).Expressions; @@ -4888,7 +4889,7 @@ private void _402() { // string_content -> StringContent -#line 1709 "Parser.y" +#line 1710 "Parser.y" { yyval.Expression = new Literal(GetValue(1).String, yyloc); } @@ -4897,7 +4898,7 @@ private void _403() { // @31 -> -#line 1713 "Parser.y" +#line 1714 "Parser.y" { // $$.term is used as a stack for nested string info @@ -4909,7 +4910,7 @@ private void _404() { // string_content -> StringEmbeddedVariableBegin @31 string_embedded_variable -#line 1720 "Parser.y" +#line 1721 "Parser.y" { // pop _tokenizer.StringEmbeddedVariableEnd(GetValue(2).term); @@ -4920,7 +4921,7 @@ private void _405() { // @32 -> -#line 1726 "Parser.y" +#line 1727 "Parser.y" { // push yyval.term = _tokenizer.StringEmbeddedCodeBegin(); @@ -4930,7 +4931,7 @@ private void _406() { // string_content -> StringEmbeddedCodeBegin @32 compstmt '}' -#line 1731 "Parser.y" +#line 1732 "Parser.y" { // pop _tokenizer.StringEmbeddedCodeEnd(GetValue(3).term); @@ -4941,7 +4942,7 @@ private void _407() { // string_embedded_variable -> GlobalVariable -#line 1740 "Parser.y" +#line 1741 "Parser.y" { yyval.Expression = new GlobalVariable(GetValue(1).SymbolId, yyloc); } @@ -4950,7 +4951,7 @@ private void _408() { // string_embedded_variable -> match_reference -#line 1744 "Parser.y" +#line 1745 "Parser.y" { yyval.Expression = GetValue(1).RegexMatchReference; } @@ -4959,7 +4960,7 @@ private void _409() { // string_embedded_variable -> InstanceVariable -#line 1748 "Parser.y" +#line 1749 "Parser.y" { yyval.Expression = new InstanceVariable(GetValue(1).SymbolId, yyloc); } @@ -4968,7 +4969,7 @@ private void _410() { // string_embedded_variable -> ClassVariable -#line 1752 "Parser.y" +#line 1753 "Parser.y" { yyval.Expression = new ClassVariable(GetValue(1).SymbolId, yyloc); } @@ -4977,7 +4978,7 @@ private void _411() { // symbol -> Symbeg sym -#line 1759 "Parser.y" +#line 1760 "Parser.y" { _tokenizer.SetState(LexicalState.EXPR_END); yyval.SymbolId = GetValue(1).SymbolId; @@ -4987,7 +4988,7 @@ private void _416() { // numeric_literal -> Integer -#line 1774 "Parser.y" +#line 1775 "Parser.y" { // unsigned integer: yyval.Expression = new Literal(GetValue(1).Integer, yyloc); @@ -4997,7 +4998,7 @@ private void _417() { // numeric_literal -> BigInteger -#line 1779 "Parser.y" +#line 1780 "Parser.y" { yyval.Expression = new Literal(GetValue(1).BigInteger, yyloc); } @@ -5006,7 +5007,7 @@ private void _418() { // numeric_literal -> Float -#line 1783 "Parser.y" +#line 1784 "Parser.y" { yyval.Expression = new Literal(GetValue(1).Double, yyloc); } @@ -5015,7 +5016,7 @@ private void _419() { // numeric_literal -> UminusNum Integer -#line 1787 "Parser.y" +#line 1788 "Parser.y" { // cannot overflow INTEGER is unsigned and Int32.MaxValue < |Int32.MinValue| yyval.Expression = new Literal(-GetValue(1).Integer, yyloc); @@ -5025,7 +5026,7 @@ private void _420() { // numeric_literal -> UminusNum BigInteger -#line 1792 "Parser.y" +#line 1793 "Parser.y" { // TODO: -|Int32.MinValue| actually ends up here (converted to bigint) instead of being Int32. We should fix that. yyval.Expression = new Literal(-GetValue(1).BigInteger, yyloc); @@ -5035,7 +5036,7 @@ private void _421() { // numeric_literal -> UminusNum Float -#line 1797 "Parser.y" +#line 1798 "Parser.y" { yyval.Expression = new Literal(-GetValue(1).Double, yyloc); } @@ -5044,84 +5045,84 @@ private void _422() { // variable -> Identifier -#line 1803 "Parser.y" +#line 1804 "Parser.y" { yyval.VariableFactory = VariableFactory.Identifier; yyval.SymbolId = GetValue(1).SymbolId; } } private void _423() { // variable -> InstanceVariable -#line 1804 "Parser.y" +#line 1805 "Parser.y" { yyval.VariableFactory = VariableFactory.Instance; yyval.SymbolId = GetValue(1).SymbolId; } } private void _424() { // variable -> GlobalVariable -#line 1805 "Parser.y" +#line 1806 "Parser.y" { yyval.VariableFactory = VariableFactory.Global; yyval.SymbolId = GetValue(1).SymbolId; } } private void _425() { // variable -> ConstantIdentifier -#line 1806 "Parser.y" +#line 1807 "Parser.y" { yyval.VariableFactory = VariableFactory.Constant; yyval.SymbolId = GetValue(1).SymbolId; } } private void _426() { // variable -> ClassVariable -#line 1807 "Parser.y" +#line 1808 "Parser.y" { yyval.VariableFactory = VariableFactory.Class; yyval.SymbolId = GetValue(1).SymbolId; } } private void _427() { // variable -> Nil -#line 1808 "Parser.y" +#line 1809 "Parser.y" { yyval.VariableFactory = VariableFactory.Nil; } } private void _428() { // variable -> Self -#line 1809 "Parser.y" +#line 1810 "Parser.y" { yyval.VariableFactory = VariableFactory.Self; } } private void _429() { // variable -> True -#line 1810 "Parser.y" +#line 1811 "Parser.y" { yyval.VariableFactory = VariableFactory.True; } } private void _430() { // variable -> False -#line 1811 "Parser.y" +#line 1812 "Parser.y" { yyval.VariableFactory = VariableFactory.False; } } private void _431() { // variable -> File -#line 1812 "Parser.y" +#line 1813 "Parser.y" { yyval.VariableFactory = VariableFactory.File; } } private void _432() { // variable -> Line -#line 1813 "Parser.y" +#line 1814 "Parser.y" { yyval.VariableFactory = VariableFactory.Line; } } private void _433() { // var_ref -> variable -#line 1818 "Parser.y" +#line 1819 "Parser.y" { yyval.Expression = GetValue(1).VariableFactory.MakeRead(this, GetValue(1).SymbolId, yyloc); } @@ -5130,7 +5131,7 @@ private void _434() { // var_lhs -> variable -#line 1825 "Parser.y" +#line 1826 "Parser.y" { yyval.LeftValue = GetValue(1).VariableFactory.MakeLeftValue(this, GetValue(1).SymbolId, yyloc); } @@ -5139,7 +5140,7 @@ private void _435() { // match_reference -> MatchReference -#line 1832 "Parser.y" +#line 1833 "Parser.y" { yyval.RegexMatchReference = new RegexMatchReference(GetValue(1).Integer, GetLocation(1)); } @@ -5148,7 +5149,7 @@ private void _436() { // superclass -> term -#line 1838 "Parser.y" +#line 1839 "Parser.y" { yyval.Expression = null; } @@ -5157,7 +5158,7 @@ private void _437() { // @33 -> -#line 1842 "Parser.y" +#line 1843 "Parser.y" { _tokenizer.SetState(LexicalState.EXPR_BEG); } @@ -5166,7 +5167,7 @@ private void _438() { // superclass -> '<' @33 expr term -#line 1846 "Parser.y" +#line 1847 "Parser.y" { yyval.Expression = GetValue(2).Expression; } @@ -5175,7 +5176,7 @@ private void _439() { // superclass -> Error term -#line 1850 "Parser.y" +#line 1851 "Parser.y" { StopErrorRecovery(); yyval.Expression = null; @@ -5185,7 +5186,7 @@ private void _440() { // parameters_declaration -> '(' parameters opt_nl ')' -#line 1857 "Parser.y" +#line 1858 "Parser.y" { yyval.Parameters = GetValue(3).Parameters; _tokenizer.SetState(LexicalState.EXPR_BEG); @@ -5195,7 +5196,7 @@ private void _441() { // parameters_declaration -> parameters term -#line 1862 "Parser.y" +#line 1863 "Parser.y" { yyval.Parameters = GetValue(2).Parameters; } @@ -5204,7 +5205,7 @@ private void _442() { // parameters -> parameter_list ',' default_parameter_list ',' array_parameter block_parameter_opt -#line 1868 "Parser.y" +#line 1869 "Parser.y" { yyval.Parameters = new Parameters(GetValue(6).LocalVariables, GetValue(4).SimpleAssignmentExpressions, GetValue(2).LocalVariable, GetValue(1).LocalVariable, yyloc); } @@ -5213,7 +5214,7 @@ private void _443() { // parameters -> parameter_list ',' default_parameter_list block_parameter_opt -#line 1872 "Parser.y" +#line 1873 "Parser.y" { yyval.Parameters = new Parameters(GetValue(4).LocalVariables, GetValue(2).SimpleAssignmentExpressions, null, GetValue(1).LocalVariable, yyloc); } @@ -5222,7 +5223,7 @@ private void _444() { // parameters -> parameter_list ',' array_parameter block_parameter_opt -#line 1876 "Parser.y" +#line 1877 "Parser.y" { yyval.Parameters = new Parameters(GetValue(4).LocalVariables, null, GetValue(2).LocalVariable, GetValue(1).LocalVariable, yyloc); } @@ -5231,7 +5232,7 @@ private void _445() { // parameters -> parameter_list block_parameter_opt -#line 1880 "Parser.y" +#line 1881 "Parser.y" { yyval.Parameters = new Parameters(GetValue(2).LocalVariables, null, null, GetValue(1).LocalVariable, yyloc); } @@ -5240,7 +5241,7 @@ private void _446() { // parameters -> default_parameter_list ',' array_parameter block_parameter_opt -#line 1884 "Parser.y" +#line 1885 "Parser.y" { yyval.Parameters = new Parameters(null, GetValue(4).SimpleAssignmentExpressions, GetValue(2).LocalVariable, GetValue(1).LocalVariable, yyloc); } @@ -5249,7 +5250,7 @@ private void _447() { // parameters -> default_parameter_list block_parameter_opt -#line 1888 "Parser.y" +#line 1889 "Parser.y" { yyval.Parameters = new Parameters(null, GetValue(2).SimpleAssignmentExpressions, null, GetValue(1).LocalVariable, yyloc); } @@ -5258,7 +5259,7 @@ private void _448() { // parameters -> array_parameter block_parameter_opt -#line 1892 "Parser.y" +#line 1893 "Parser.y" { yyval.Parameters = new Parameters(null, null, GetValue(2).LocalVariable, GetValue(1).LocalVariable, yyloc); } @@ -5267,7 +5268,7 @@ private void _449() { // parameters -> block_parameter -#line 1896 "Parser.y" +#line 1897 "Parser.y" { yyval.Parameters = new Parameters(null, null, null, GetValue(1).LocalVariable, yyloc); } @@ -5276,7 +5277,7 @@ private void _450() { // parameters -> -#line 1900 "Parser.y" +#line 1901 "Parser.y" { yyval.Parameters = new Parameters(null, null, null, null, yyloc); } @@ -5285,7 +5286,7 @@ private void _451() { // parameter -> ConstantIdentifier -#line 1906 "Parser.y" +#line 1907 "Parser.y" { _tokenizer.ReportError(Errors.FormalArgumentIsConstantVariable); yyval.LocalVariable = DefineParameter(GenerateErrorConstantName(), yyloc); @@ -5295,7 +5296,7 @@ private void _452() { // parameter -> InstanceVariable -#line 1911 "Parser.y" +#line 1912 "Parser.y" { _tokenizer.ReportError(Errors.FormalArgumentIsInstanceVariable); yyval.LocalVariable = DefineParameter(GenerateErrorConstantName(), yyloc); @@ -5305,7 +5306,7 @@ private void _453() { // parameter -> GlobalVariable -#line 1916 "Parser.y" +#line 1917 "Parser.y" { _tokenizer.ReportError(Errors.FormalArgumentIsGlobalVariable); yyval.LocalVariable = DefineParameter(GenerateErrorConstantName(), yyloc); @@ -5315,7 +5316,7 @@ private void _454() { // parameter -> ClassVariable -#line 1921 "Parser.y" +#line 1922 "Parser.y" { _tokenizer.ReportError(Errors.FormalArgumentIsClassVariable); yyval.LocalVariable = DefineParameter(GenerateErrorConstantName(), yyloc); @@ -5325,7 +5326,7 @@ private void _455() { // parameter -> Identifier -#line 1926 "Parser.y" +#line 1927 "Parser.y" { yyval.LocalVariable = DefineParameter(GetValue(1).SymbolId, yyloc); } @@ -5334,7 +5335,7 @@ private void _456() { // parameter_list -> parameter -#line 1932 "Parser.y" +#line 1933 "Parser.y" { yyval.LocalVariables = CollectionUtils.MakeList(GetValue(1).LocalVariable); } @@ -5343,7 +5344,7 @@ private void _457() { // parameter_list -> parameter_list ',' parameter -#line 1936 "Parser.y" +#line 1937 "Parser.y" { GetValue(3).LocalVariables.Add(GetValue(1).LocalVariable); yyval.LocalVariables = GetValue(3).LocalVariables; @@ -5353,7 +5354,7 @@ private void _458() { // default_parameter -> parameter '=' arg -#line 1943 "Parser.y" +#line 1944 "Parser.y" { yyval.SimpleAssignmentExpression = new SimpleAssignmentExpression(GetValue(3).LocalVariable, GetValue(1).Expression, SymbolId.Empty, yyloc); } @@ -5362,7 +5363,7 @@ private void _459() { // default_parameter_list -> default_parameter -#line 1949 "Parser.y" +#line 1950 "Parser.y" { yyval.SimpleAssignmentExpressions = CollectionUtils.MakeList(GetValue(1).SimpleAssignmentExpression); } @@ -5371,7 +5372,7 @@ private void _460() { // default_parameter_list -> default_parameter_list ',' default_parameter -#line 1953 "Parser.y" +#line 1954 "Parser.y" { GetValue(3).SimpleAssignmentExpressions.Add(GetValue(1).SimpleAssignmentExpression); yyval.SimpleAssignmentExpressions = GetValue(3).SimpleAssignmentExpressions; @@ -5381,7 +5382,7 @@ private void _463() { // array_parameter -> array_parameter_mark parameter -#line 1964 "Parser.y" +#line 1965 "Parser.y" { yyval.LocalVariable = GetValue(1).LocalVariable; } @@ -5390,7 +5391,7 @@ private void _464() { // array_parameter -> array_parameter_mark -#line 1968 "Parser.y" +#line 1969 "Parser.y" { yyval.LocalVariable = DefineParameter(Symbols.RestArgsLocal, GetLocation(1)); } @@ -5399,7 +5400,7 @@ private void _467() { // block_parameter -> block_parameter_mark parameter -#line 1978 "Parser.y" +#line 1979 "Parser.y" { yyval.LocalVariable = GetValue(1).LocalVariable; } @@ -5408,7 +5409,7 @@ private void _469() { // block_parameter_opt -> ',' block_parameter -#line 1985 "Parser.y" +#line 1986 "Parser.y" { yyval.LocalVariable = GetValue(1).LocalVariable; } @@ -5417,7 +5418,7 @@ private void _471() { // @34 -> -#line 1992 "Parser.y" +#line 1993 "Parser.y" { _tokenizer.SetState(LexicalState.EXPR_BEG); } @@ -5426,7 +5427,7 @@ private void _472() { // singleton -> '(' @34 expr opt_nl ')' -#line 1996 "Parser.y" +#line 1997 "Parser.y" { yyval.Expression = GetValue(3).Expression; } @@ -5435,7 +5436,7 @@ private void _473() { // maplets -> maplet -#line 2002 "Parser.y" +#line 2003 "Parser.y" { yyval.Maplets = CollectionUtils.MakeList(GetValue(1).Maplet); } @@ -5444,7 +5445,7 @@ private void _474() { // maplets -> maplets ',' maplet -#line 2006 "Parser.y" +#line 2007 "Parser.y" { GetValue(3).Maplets.Add(GetValue(1).Maplet); yyval.Maplets = GetValue(3).Maplets; @@ -5454,7 +5455,7 @@ private void _475() { // maplet -> arg Assoc arg -#line 2013 "Parser.y" +#line 2014 "Parser.y" { yyval.Maplet = new Maplet(GetValue(3).Expression, GetValue(1).Expression, yyloc); } @@ -5463,18 +5464,18 @@ private void _495() { // term -> ';' -#line 2051 "Parser.y" +#line 2052 "Parser.y" { StopErrorRecovery(); } } private void _498() { // terms -> terms ';' -#line 2056 "Parser.y" +#line 2057 "Parser.y" { StopErrorRecovery(); } } -#line 2059 "Parser.y" +#line 2060 "Parser.y" } } =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Parser/Parser.y;C392185 File: Parser.y =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Parser/Parser.y;C392185 (server) 5/2/2008 11:03 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Parser/Parser.y;bugfixes9 @@ -1065,11 +1065,12 @@ command_args: { + $$ = _tokenizer.CMDARG; _tokenizer.CMDARG_PUSH(1); } command_args_content { - _tokenizer.CMDARG_POP(); + _tokenizer.CMDARG = $1; $$ = $2; } ; =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Parser/Tokenizer.cs;C413883 File: Tokenizer.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Parser/Tokenizer.cs;C413883 (server) 5/2/2008 11:04 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Parser/Tokenizer.cs;bugfixes9 @@ -317,6 +317,12 @@ _lexicalState = state; } + internal int CMDARG + { + get { return _cmdArgStack; } + set { _cmdArgStack = value; } + } + internal void CMDARG_PUSH(int n) { BITSTACK_PUSH(ref _cmdArgStack, n); } =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyExecutionContext.cs;C420856 File: RubyExecutionContext.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyExecutionContext.cs;C420856 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyExecutionContext.cs;bugfixes9 @@ -301,7 +301,9 @@ MutableString version = new MutableString(RubyContext.MriVersion); MutableString platform = new MutableString("i386-mswin32"); // TODO: make this the correct string for MAC OS X in Silverlight MutableString releaseDate = new MutableString(RubyContext.MriReleaseDate); + MutableString rubyEngine = new MutableString("ironruby"); + _objectClass.SetConstant("RUBY_ENGINE", rubyEngine); _objectClass.SetConstant("RUBY_VERSION", version); _objectClass.SetConstant("RUBY_PLATFORM", platform); _objectClass.SetConstant("RUBY_RELEASE_DATE", releaseDate); =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/module/.spec/comparison_excludes.txt;C422137 File: comparison_excludes.txt =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/module/.spec/comparison_excludes.txt;C422137 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/module/.spec/comparison_excludes.txt;bugfixes9 @@ -1,5 +1,1 @@ -Module#<=> returns -1 if self is a subclass of or includes the given module -Module#<=> returns 0 if self is the same as the given module -Module#<=> returns +1 if self is a superclas of or included by the given module -Module#<=> returns nil if self and the given module are not related -Module#<=> returns nil if the argument is no class/module + =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/module/.spec/gt_excludes.txt;C422137 File: gt_excludes.txt =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/module/.spec/gt_excludes.txt;C422137 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/module/.spec/gt_excludes.txt;bugfixes9 @@ -1,4 +1,1 @@ -Module#> returns true if self is a superclass of or included by the given module -Module#> returns false if self is the same as the given module -Module#> returns nil if self is not related to the given module -Module#> raises a TypeError the argument is no class/module + =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/module/.spec/gte_excludes.txt;C422137 File: gte_excludes.txt =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/module/.spec/gte_excludes.txt;C422137 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/module/.spec/gte_excludes.txt;bugfixes9 @@ -1,4 +1,0 @@ -Module#>= returns true if self is a superclass of, the same as or included by given module -Module#>= returns nil if self is not related to the given module -Module#>= returns false if self is a subclass of or includes the given module -Module#>= raises a TypeError if the argument is no class/module =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/module/.spec/lt_excludes.txt;C422137 File: lt_excludes.txt =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/module/.spec/lt_excludes.txt;C422137 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/module/.spec/lt_excludes.txt;bugfixes9 @@ -1,4 +1,1 @@ -Module#< returns true if self is a subclass of or includes the given module -Module#< returns false if self is the same as the given module -Module#< returns nil if self is not related to the given module -Module#< raises a TypeError the argument is no class/module + =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/module/.spec/lte_excludes.txt;C422137 File: lte_excludes.txt =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/module/.spec/lte_excludes.txt;C422137 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/module/.spec/lte_excludes.txt;bugfixes9 @@ -1,4 +1,1 @@ -Module#<= returns true if self is a subclass of, the same as or includes the given module -Module#<= returns nil if self is not related to the given module -Module#<= returns false if self is a superclass of or is included by the given module -Module#<= raises a TypeError if the argument is no class/module + =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/string/.spec/ljust_excludes.txt;C417565 File: ljust_excludes.txt =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/string/.spec/ljust_excludes.txt;C417565 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/string/.spec/ljust_excludes.txt;bugfixes9 @@ -1,10 +1,0 @@ -String#ljust with length, padding returns a new string of specified length with self left justified and padded with padstr -String#ljust with length, padding pads with whitespace if no padstr is given -String#ljust with length, padding returns self if it's longer than or as long as the specified length -String#ljust with length, padding taints result when self or padstr is tainted -String#ljust with length, padding tries to convert length to an integer using to_int -String#ljust with length, padding raises a TypeError when length can't be converted to an integer -String#ljust with length, padding tries to convert padstr to a string using to_str -String#ljust with length, padding raises a TypeError when padstr can't be converted -String#ljust with length, padding raises an ArgumentError when padstr is empty -String#ljust with length, padding returns subclass instances when called on subclasses =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/string/.spec/rjust_excludes.txt;C417565 File: rjust_excludes.txt =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/string/.spec/rjust_excludes.txt;C417565 (server) 5/2/2008 9:53 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/Specs/core/string/.spec/rjust_excludes.txt;bugfixes9 @@ -1,10 +1,0 @@ -String#rjust with length, padding returns a new string of specified length with self right justified and padded with padstr -String#rjust with length, padding pads with whitespace if no padstr is given -String#rjust with length, padding returns self if it's longer than or as long as the specified length -String#rjust with length, padding taints result when self or padstr is tainted -String#rjust with length, padding tries to convert length to an integer using to_int -String#rjust with length, padding raises a TypeError when length can't be converted to an integer -String#rjust with length, padding tries to convert padstr to a string using to_str -String#rjust with length, padding raises a TypeError when padstr can't be converted -String#rjust with length, padding raises an ArgumentError when padstr is empty -String#rjust with length, padding returns subclass instances when called on subclasses ===================================================================