From 33c1325ec0dc9c22b393f429a8da50b876875dab Mon Sep 17 00:00:00 2001 From: Lamparter Date: Sun, 24 Nov 2024 14:03:22 +0000 Subject: [PATCH] Update namespaces --- Build.proj | 2 +- Directory.Build.props | 6 +- Dynamic.sln | 10 +- Dynamic/Actions/ActionBinder.cs | 28 +-- Dynamic/Actions/Argument.cs | 6 +- Dynamic/Actions/ArgumentType.cs | 10 +- Dynamic/Actions/BoundMemberTracker.cs | 4 +- Dynamic/Actions/CallSignature.cs | 24 +-- Dynamic/Actions/Calls/ActualArguments.cs | 8 +- Dynamic/Actions/Calls/ApplicableCandidate.cs | 4 +- Dynamic/Actions/Calls/ArgBuilder.cs | 6 +- Dynamic/Actions/Calls/ArgumentBinding.cs | 4 +- Dynamic/Actions/Calls/BindingResult.cs | 6 +- Dynamic/Actions/Calls/BindingTarget.cs | 10 +- Dynamic/Actions/Calls/ByRefReturnBuilder.cs | 4 +- Dynamic/Actions/Calls/CallFailure.cs | 10 +- Dynamic/Actions/Calls/CallFailureReason.cs | 4 +- Dynamic/Actions/Calls/Candidate.cs | 2 +- Dynamic/Actions/Calls/CandidateSet.cs | 2 +- Dynamic/Actions/Calls/ConversionResult.cs | 4 +- Dynamic/Actions/Calls/DefaultArgBuilder.cs | 10 +- .../Actions/Calls/DefaultOverloadResolver.cs | 14 +- Dynamic/Actions/Calls/InstanceBuilder.cs | 12 +- Dynamic/Actions/Calls/KeywordArgBuilder.cs | 18 +- .../Calls/KeywordConstructorReturnBuilder.cs | 10 +- Dynamic/Actions/Calls/MethodCandidate.cs | 18 +- Dynamic/Actions/Calls/NarrowingLevel.cs | 12 +- Dynamic/Actions/Calls/OutArgBuilder.cs | 8 +- Dynamic/Actions/Calls/OverloadInfo.cs | 18 +- Dynamic/Actions/Calls/OverloadResolver.cs | 66 +++--- .../Actions/Calls/OverloadResolverFactory.cs | 4 +- Dynamic/Actions/Calls/ParameterMapping.cs | 22 +- Dynamic/Actions/Calls/ParameterWrapper.cs | 16 +- Dynamic/Actions/Calls/ParamsArgBuilder.cs | 16 +- Dynamic/Actions/Calls/ParamsDictArgBuilder.cs | 10 +- Dynamic/Actions/Calls/ReferenceArgBuilder.cs | 8 +- Dynamic/Actions/Calls/RestrictedArguments.cs | 4 +- Dynamic/Actions/Calls/ReturnBuilder.cs | 2 +- .../Calls/ReturnReferenceArgBuilder.cs | 2 +- Dynamic/Actions/Calls/SimpleArgBuilder.cs | 8 +- Dynamic/Actions/Calls/TypeInferer.cs | 36 ++-- Dynamic/Actions/ComboActionRewriter.cs | 4 +- Dynamic/Actions/ComboBinder.cs | 6 +- Dynamic/Actions/ConditionalBuilder.cs | 6 +- Dynamic/Actions/ConstructorTracker.cs | 2 +- Dynamic/Actions/ConversionResultKind.cs | 8 +- Dynamic/Actions/CustomTracker.cs | 2 +- Dynamic/Actions/DefaultBinder.Conversions.cs | 28 +-- Dynamic/Actions/DefaultBinder.DeleteMember.cs | 12 +- Dynamic/Actions/DefaultBinder.GetMember.cs | 32 +-- Dynamic/Actions/DefaultBinder.Invoke.cs | 22 +- Dynamic/Actions/DefaultBinder.MethodCalls.cs | 16 +- Dynamic/Actions/DefaultBinder.Operations.cs | 28 +-- Dynamic/Actions/DefaultBinder.SetMember.cs | 38 ++-- Dynamic/Actions/DefaultBinder.cs | 20 +- Dynamic/Actions/DynamicSiteHelper.cs | 12 +- Dynamic/Actions/ErrorInfo.cs | 14 +- Dynamic/Actions/ErrorMetaObject.cs | 2 +- Dynamic/Actions/EventTracker.cs | 30 +-- .../Actions/ExtensionBinaryOperationBinder.cs | 4 +- Dynamic/Actions/ExtensionMethodTracker.cs | 4 +- Dynamic/Actions/ExtensionPropertyTracker.cs | 10 +- .../Actions/ExtensionUnaryOperationBinder.cs | 4 +- Dynamic/Actions/FieldTracker.cs | 12 +- Dynamic/Actions/ILightExceptionBinder.cs | 8 +- Dynamic/Actions/Interceptor.cs | 2 +- Dynamic/Actions/MemberGroup.cs | 8 +- Dynamic/Actions/MemberRequestKind.cs | 2 +- Dynamic/Actions/MemberTracker.cs | 42 ++-- Dynamic/Actions/MethodGroup.cs | 6 +- Dynamic/Actions/MethodTracker.cs | 8 +- Dynamic/Actions/NamespaceTracker.cs | 6 +- Dynamic/Actions/NestedTypeTracker.cs | 4 +- Dynamic/Actions/NoSideEffectsAttribute.cs | 2 +- Dynamic/Actions/OperationBinder.cs | 4 +- Dynamic/Actions/OperationMetaObject.cs | 4 +- Dynamic/Actions/OperatorInfo.cs | 8 +- Dynamic/Actions/PropertyTracker.cs | 14 +- Dynamic/Actions/ReflectedPropertyTracker.cs | 4 +- Dynamic/Actions/TopNamespaceTracker.cs | 12 +- Dynamic/Actions/TrackerTypes.cs | 6 +- Dynamic/Actions/TypeGroup.cs | 14 +- Dynamic/Actions/TypeTracker.cs | 6 +- Dynamic/Ast/BinaryExpression.cs | 4 +- Dynamic/Ast/Block.cs | 6 +- Dynamic/Ast/BlockBuilder.cs | 4 +- Dynamic/Ast/ConstantExpression.cs | 6 +- Dynamic/Ast/DebugStatement.cs | 8 +- Dynamic/Ast/EmptyStatements.cs | 2 +- Dynamic/Ast/ExpressionCollectionBuilder.cs | 18 +- Dynamic/Ast/FinallyFlowControlExpression.cs | 10 +- Dynamic/Ast/FlowControlRewriter.cs | 26 +-- Dynamic/Ast/GeneratorExpression.cs | 6 +- Dynamic/Ast/GeneratorRewriter.cs | 30 +-- Dynamic/Ast/ILightExceptionAwareExpression.cs | 6 +- Dynamic/Ast/IfStatementBuilder.cs | 4 +- Dynamic/Ast/IfStatementTest.cs | 4 +- Dynamic/Ast/LambdaBuilder.cs | 40 ++-- Dynamic/Ast/LambdaParameterRewriter.cs | 2 +- Dynamic/Ast/LightCheckAndThrowExpression.cs | 12 +- Dynamic/Ast/LightDynamicExpression.cs | 20 +- .../Ast/LightExceptionConvertingExpression.cs | 6 +- Dynamic/Ast/LightExceptionRewriter.cs | 40 ++-- Dynamic/Ast/LightLambdaExpression.cs | 4 +- Dynamic/Ast/LightThrowExpression.cs | 8 +- Dynamic/Ast/LoopStatement.cs | 4 +- Dynamic/Ast/MethodCallExpression.cs | 8 +- Dynamic/Ast/NewArrayExpression.cs | 4 +- Dynamic/Ast/NewExpression.cs | 4 +- Dynamic/Ast/SourceFileInformation.cs | 2 +- Dynamic/Ast/TryStatementBuilder.cs | 4 +- Dynamic/Ast/UnaryExpression.cs | 6 +- Dynamic/Ast/Utils.cs | 6 +- Dynamic/Ast/YieldExpression.cs | 4 +- Dynamic/ComInterop/ArgBuilder.cs | 6 +- Dynamic/ComInterop/BoolArgBuilder.cs | 4 +- Dynamic/ComInterop/BoundDispEvent.cs | 4 +- Dynamic/ComInterop/CollectionExtensions.cs | 6 +- Dynamic/ComInterop/ComBinder.cs | 10 +- Dynamic/ComInterop/ComBinderHelpers.cs | 2 +- Dynamic/ComInterop/ComClassMetaObject.cs | 4 +- Dynamic/ComInterop/ComDispIds.cs | 4 +- Dynamic/ComInterop/ComEventDesc.cs | 4 +- Dynamic/ComInterop/ComEventSink.netcoreapp.cs | 6 +- Dynamic/ComInterop/ComEventSink.netfx.cs | 22 +- Dynamic/ComInterop/ComEventSinkProxy.netfx.cs | 22 +- Dynamic/ComInterop/ComEventSinksContainer.cs | 4 +- .../ComInterop/ComEventsMethod.netcoreapp.cs | 2 +- Dynamic/ComInterop/ComFallbackMetaObject.cs | 4 +- Dynamic/ComInterop/ComHresults.cs | 4 +- Dynamic/ComInterop/ComInterop.cs | 2 +- Dynamic/ComInterop/ComInvokeAction.cs | 4 +- Dynamic/ComInterop/ComInvokeBinder.cs | 12 +- Dynamic/ComInterop/ComMetaObject.cs | 4 +- Dynamic/ComInterop/ComMethodDesc.cs | 4 +- Dynamic/ComInterop/ComObject.cs | 4 +- Dynamic/ComInterop/ComParamDesc.cs | 4 +- Dynamic/ComInterop/ComRuntimeHelpers.cs | 6 +- Dynamic/ComInterop/ComType.cs | 2 +- Dynamic/ComInterop/ComTypeClassDesc.cs | 4 +- Dynamic/ComInterop/ComTypeDesc.cs | 6 +- Dynamic/ComInterop/ComTypeEnumDesc.cs | 2 +- Dynamic/ComInterop/ComTypeLibDesc.cs | 6 +- Dynamic/ComInterop/ComTypeLibInfo.cs | 2 +- Dynamic/ComInterop/ComTypeLibMemberDesc.cs | 2 +- Dynamic/ComInterop/ConversionArgBuilder.cs | 4 +- Dynamic/ComInterop/ConvertArgBuilder.cs | 2 +- Dynamic/ComInterop/ConvertibleArgBuilder.cs | 4 +- Dynamic/ComInterop/CurrencyArgBuilder.cs | 2 +- Dynamic/ComInterop/DateTimeArgBuilder.cs | 2 +- Dynamic/ComInterop/DispCallable.cs | 2 +- Dynamic/ComInterop/DispCallableMetaObject.cs | 2 +- Dynamic/ComInterop/DispatchArgBuilder.cs | 2 +- Dynamic/ComInterop/ErrorArgBuilder.cs | 2 +- Dynamic/ComInterop/Errors.cs | 4 +- Dynamic/ComInterop/ExcepInfo.cs | 2 +- Dynamic/ComInterop/Helpers.cs | 2 +- Dynamic/ComInterop/IDispatchComObject.cs | 64 +++--- Dynamic/ComInterop/IDispatchMetaObject.cs | 4 +- Dynamic/ComInterop/IPseudoComObject.cs | 4 +- Dynamic/ComInterop/NullArgBuilder.cs | 4 +- Dynamic/ComInterop/SimpleArgBuilder.cs | 2 +- Dynamic/ComInterop/SplatCallSite.cs | 6 +- Dynamic/ComInterop/StringArgBuilder.cs | 2 +- Dynamic/ComInterop/TypeEnumMetaObject.cs | 6 +- Dynamic/ComInterop/TypeLibInfoMetaObject.cs | 6 +- Dynamic/ComInterop/TypeLibMetaObject.cs | 4 +- Dynamic/ComInterop/TypeUtils.cs | 2 +- Dynamic/ComInterop/UnknownArgBuilder.cs | 2 +- Dynamic/ComInterop/VarEnumSelector.cs | 24 +-- Dynamic/ComInterop/Variant.cs | 6 +- Dynamic/ComInterop/VariantArgBuilder.cs | 2 +- Dynamic/ComInterop/VariantArray.cs | 4 +- Dynamic/ComInterop/VariantBuilder.cs | 6 +- Dynamic/DebugOptions.cs | 8 +- Dynamic/Debugging/CollectionUtils.cs | 2 +- .../CompilerServices/DebugLambdaInfo.cs | 2 +- .../CompilerServices/IDebugCompilerSupport.cs | 2 +- .../DebugContext.GeneratorLoopProc.cs | 4 +- Dynamic/Debugging/DebugContext.cs | 6 +- Dynamic/Debugging/DebugFrame.cs | 8 +- Dynamic/Debugging/DebugGenerator.cs | 2 +- Dynamic/Debugging/DebugInfoRewriter.cs | 10 +- Dynamic/Debugging/DebugMode.cs | 2 +- Dynamic/Debugging/DebugSourceFile.cs | 2 +- Dynamic/Debugging/DebugSourceSpan.cs | 4 +- Dynamic/Debugging/DebugThread.cs | 10 +- Dynamic/Debugging/DebuggableLambdaBuilder.cs | 24 +-- .../DebugRuntimeVariables.cs | 2 +- .../DefaultDebugThread.cs | 4 +- .../DefaultDebugThreadFactory.cs | 6 +- Dynamic/Debugging/DelegateHelpers.cs | 10 +- .../ForceToGeneratorLoopException.cs | 2 +- Dynamic/Debugging/FunctionInfo.cs | 2 +- Dynamic/Debugging/IDebugCallback.cs | 10 +- Dynamic/Debugging/InvokeTargets.cs | 2 +- Dynamic/Debugging/LambdaWalker.cs | 2 +- ...iverside.Scripting.Debugging.Generated.cs} | 2 +- Dynamic/Debugging/RuntimeOps.cs | 4 +- .../IDebugRuntimeVariables.cs | 2 +- .../IDebugThreadFactory.cs | 4 +- Dynamic/Debugging/ScopedRuntimeVariables.cs | 2 +- Dynamic/Debugging/ThreadLocal.cs | 4 +- Dynamic/Debugging/TraceEventKind.cs | 6 +- .../Debugging/TracePipeline/ITraceCallback.cs | 6 +- .../Debugging/TracePipeline/ITracePipeline.cs | 2 +- .../Debugging/TracePipeline/TracePipeline.cs | 10 +- Dynamic/Debugging/VariableInfo.cs | 4 +- Dynamic/Generation/AssemblyGen.cs | 12 +- Dynamic/Generation/CompilerHelpers.cs | 28 +-- Dynamic/Generation/ConstantCheck.cs | 6 +- .../Generation/DelegateHelpers.Generated.cs | 4 +- Dynamic/Generation/DelegateHelpers.cs | 4 +- Dynamic/Generation/DynamicILGen.cs | 4 +- Dynamic/Generation/FieldBuilderExpression.cs | 4 +- Dynamic/Generation/IExpressionSerializable.cs | 2 +- Dynamic/Generation/ILGen.cs | 10 +- Dynamic/Generation/KeyedQueue.cs | 4 +- Dynamic/Generation/MethodSignatureInfo.cs | 4 +- Dynamic/Generation/Snippets.cs | 8 +- Dynamic/Generation/SymbolGuids.cs | 2 +- Dynamic/Generation/ToDiskRewriter.cs | 12 +- Dynamic/Generation/TypeGen.cs | 4 +- Dynamic/GlobalSuppressions.cs | 6 +- Dynamic/Hosting/Shell/BasicConsole.cs | 8 +- Dynamic/Hosting/Shell/CommandLine.cs | 26 +-- Dynamic/Hosting/Shell/ConsoleHost.cs | 18 +- Dynamic/Hosting/Shell/ConsoleHostOptions.cs | 4 +- .../Hosting/Shell/ConsoleHostOptionsParser.cs | 6 +- Dynamic/Hosting/Shell/ConsoleOptions.cs | 4 +- Dynamic/Hosting/Shell/ICommandDispatcher.cs | 4 +- Dynamic/Hosting/Shell/IConsole.cs | 6 +- Dynamic/Hosting/Shell/OptionsParser.cs | 8 +- .../Shell/Remote/ConsoleRestartManager.cs | 28 +-- .../Shell/Remote/RemoteCommandDispatcher.cs | 4 +- .../Shell/Remote/RemoteConsoleCommandLine.cs | 4 +- .../Hosting/Shell/Remote/RemoteConsoleHost.cs | 12 +- .../Shell/Remote/RemoteRuntimeServer.cs | 14 +- Dynamic/Hosting/Shell/Style.cs | 4 +- Dynamic/Hosting/Shell/SuperConsole.cs | 6 +- Dynamic/Interpreter/BranchLabel.cs | 6 +- Dynamic/Interpreter/ILightCallSiteBinder.cs | 2 +- .../Instructions/AddInstruction.cs | 6 +- .../Instructions/ArrayOperations.cs | 2 +- .../Instructions/CallInstruction.Generated.cs | 14 +- .../Instructions/CallInstruction.cs | 32 +-- .../Instructions/ControlFlowInstructions.cs | 50 ++--- .../Instructions/DivInstruction.cs | 6 +- .../Instructions/DynamicInstructionN.cs | 4 +- .../DynamicInstructions.Generated.cs | 8 +- .../Instructions/DynamicSplatInstruction.cs | 4 +- .../Instructions/EqualInstruction.cs | 4 +- .../Instructions/FieldOperations.cs | 6 +- .../Instructions/GreaterThanInstruction.cs | 4 +- .../Interpreter/Instructions/Instruction.cs | 4 +- .../Instructions/InstructionFactory.cs | 4 +- .../Instructions/InstructionList.cs | 30 +-- Dynamic/Interpreter/Instructions/LabelInfo.cs | 10 +- .../Instructions/LessThanInstruction.cs | 6 +- .../Interpreter/Instructions/LocalAccess.cs | 10 +- .../Instructions/NotEqualInstruction.cs | 4 +- .../Instructions/NumericConvertInstruction.cs | 6 +- .../Instructions/StackOperations.cs | 4 +- .../Instructions/TypeOperations.cs | 6 +- Dynamic/Interpreter/InterpretedFrame.cs | 8 +- Dynamic/Interpreter/Interpreter.cs | 18 +- Dynamic/Interpreter/LightCompiler.cs | 44 ++-- Dynamic/Interpreter/LightDelegateCreator.cs | 10 +- Dynamic/Interpreter/LightLambda.Generated.cs | 4 +- Dynamic/Interpreter/LightLambda.cs | 18 +- .../Interpreter/LightLambdaClosureVisitor.cs | 8 +- Dynamic/Interpreter/LocalVariables.cs | 8 +- Dynamic/Interpreter/LoopCompiler.cs | 32 +-- Dynamic/Interpreter/RuntimeVariables.cs | 2 +- Dynamic/KeyboardInterruptException.cs | 2 +- Dynamic/MultiRuntimeAwareAttribute.cs | 8 +- Dynamic/MutableTuple.cs | 24 +-- Dynamic/PerfTrack.cs | 16 +- Dynamic/Properties/AssemblyInfo.cs | 8 +- ...ynamic.csproj => Riverside.Dynamic.csproj} | 6 +- ....Scripting.txt => Riverside.Scripting.txt} | 0 Dynamic/Runtime/AmbiguousFileNameException.cs | 4 +- Dynamic/Runtime/ArgumentArray.cs | 8 +- Dynamic/Runtime/AssemblyTypeNames.cs | 4 +- Dynamic/Runtime/BinderOps.cs | 8 +- Dynamic/Runtime/BinderType.cs | 4 +- Dynamic/Runtime/BindingRestrictionsHelpers.cs | 4 +- Dynamic/Runtime/CallTargets.cs | 2 +- Dynamic/Runtime/CallTypes.cs | 2 +- Dynamic/Runtime/Cast.Generated.cs | 4 +- Dynamic/Runtime/Cast.cs | 12 +- Dynamic/Runtime/CodeDomCodeGen.cs | 4 +- Dynamic/Runtime/CompilerContext.cs | 4 +- Dynamic/Runtime/CustomStringDictionary.cs | 18 +- Dynamic/Runtime/DelegateInfo.cs | 40 ++-- Dynamic/Runtime/DelegateSignatureInfo.cs | 4 +- Dynamic/Runtime/DlrCachedCodeAttribute.cs | 6 +- Dynamic/Runtime/DocumentationAttribute.cs | 6 +- Dynamic/Runtime/DynamicDelegateCreator.cs | 20 +- Dynamic/Runtime/DynamicNull.cs | 2 +- Dynamic/Runtime/ExceptionHelpers.cs | 4 +- .../ExplicitConversionMethodAttribute.cs | 2 +- Dynamic/Runtime/Extensible.cs | 2 +- Dynamic/Runtime/ExtensionTypeAttribute.cs | 2 +- Dynamic/Runtime/ExtraKeyEnumerator.cs | 4 +- Dynamic/Runtime/Generator.cs | 10 +- Dynamic/Runtime/IConvertibleMetaObject.cs | 2 +- Dynamic/Runtime/ICustomScriptCodeData.cs | 2 +- Dynamic/Runtime/IMembersList.cs | 4 +- Dynamic/Runtime/IRestrictedMetaObject.cs | 2 +- Dynamic/Runtime/ISlice.cs | 4 +- Dynamic/Runtime/IdDispenser.cs | 10 +- .../ImplicitConversionMethodAttribute.cs | 2 +- .../LanguageBoundTextContentProvider.cs | 4 +- Dynamic/Runtime/LegacyScriptCode.cs | 10 +- Dynamic/Runtime/LightExceptions.cs | 36 ++-- Dynamic/Runtime/LightThrowingAttribute.cs | 2 +- Dynamic/Runtime/LocalsDictionary.cs | 4 +- Dynamic/Runtime/MetaObjectExtensions.cs | 14 +- Dynamic/Runtime/ModuleChangeEventArgs.cs | 4 +- Dynamic/Runtime/ModuleChangeEventType.cs | 2 +- Dynamic/Runtime/NullTextContentProvider.cs | 2 +- Dynamic/Runtime/OperationFailed.cs | 2 +- Dynamic/Runtime/OperatorSlotAttribute.cs | 4 +- Dynamic/Runtime/PositionTrackingWriter.cs | 4 +- Dynamic/Runtime/PropertyMethodAttribute.cs | 2 +- Dynamic/Runtime/ReflectionCache.cs | 10 +- Dynamic/Runtime/RestrictedMetaObject.cs | 4 +- Dynamic/Runtime/ReturnFixer.cs | 4 +- Dynamic/Runtime/SavableScriptCode.cs | 38 ++-- Dynamic/Runtime/ScriptingRuntimeHelpers.cs | 8 +- .../Runtime/SourceStringContentProvider.cs | 4 +- .../Runtime/StaticExtensionMethodAttribute.cs | 2 +- Dynamic/Runtime/TokenizerBuffer.cs | 32 +-- Dynamic/Runtime/Uninitialized.cs | 2 +- Dynamic/SerializationStubs.cs | 2 +- Dynamic/SourceFileContentProvider.cs | 4 +- Dynamic/StringExtensions.cs | 2 +- Dynamic/Utils/ArrayUtils.cs | 12 +- Dynamic/Utils/Assert.cs | 2 +- Dynamic/Utils/CacheDict.cs | 6 +- Dynamic/Utils/CheckedDictionaryEnumerator.cs | 4 +- Dynamic/Utils/CollectionExtensions.cs | 4 +- Dynamic/Utils/CollectionUtils.cs | 4 +- Dynamic/Utils/ContractUtils.cs | 18 +- Dynamic/Utils/CopyOnWriteList.cs | 8 +- Dynamic/Utils/DictionaryUnionEnumerator.cs | 2 +- Dynamic/Utils/DynamicUtils.cs | 10 +- Dynamic/Utils/EnumUtils.cs | 4 +- Dynamic/Utils/ExceptionFactory.Generated.cs | 4 +- Dynamic/Utils/ExceptionUtils.cs | 4 +- Dynamic/Utils/HybridReferenceDictionary.cs | 2 +- Dynamic/Utils/IOUtils.cs | 6 +- Dynamic/Utils/ListEqualityComparer.cs | 2 +- Dynamic/Utils/MathUtils.cs | 16 +- Dynamic/Utils/MonitorUtils.cs | 2 +- Dynamic/Utils/Publisher.cs | 4 +- Dynamic/Utils/ReferenceEqualityComparer.cs | 2 +- Dynamic/Utils/ReflectionUtils.cs | 46 ++--- Dynamic/Utils/StringUtils.cs | 2 +- Dynamic/Utils/SynchronizedDictionary.cs | 4 +- Dynamic/Utils/ThreadLocal.cs | 10 +- Dynamic/Utils/ThreadingUtils.cs | 4 +- Dynamic/Utils/TypeMemberCache.cs | 6 +- Dynamic/Utils/TypeUtils.cs | 18 +- Dynamic/Utils/ValueArray.cs | 2 +- Dynamic/Utils/WeakCollection.cs | 2 +- Dynamic/Utils/WeakDictionary.cs | 12 +- Dynamic/Utils/WeakHandle.cs | 2 +- Dynamic/Xaml/DynamicXamlReader.cs | 10 +- Metadata/ClrStubs.cs | 4 +- Metadata/MemoryBlock.cs | 8 +- Metadata/MemoryMapping.V4.cs | 2 +- Metadata/MemoryReader.cs | 2 +- Metadata/MetadataExtensions.cs | 2 +- Metadata/MetadataImport.cs | 14 +- Metadata/MetadataName.cs | 4 +- Metadata/MetadataServices.cs | 6 +- Metadata/MetadataTableEnumerator.CCI.cs | 8 +- Metadata/MetadataTableImplementations.cs | 26 +-- Metadata/MetadataTables.CCI.cs | 54 ++--- Metadata/MetadataTables.cs | 16 +- Metadata/PEFileStructures.cs | 24 +-- Metadata/Properties/AssemblyInfo.cs | 8 +- ...oj => Riverside.Scripting.Metadata.csproj} | 2 +- .../Scenarios/Hosting Scenarios.csproj | 10 +- .../Samples/Hosting/Scenarios/Program.cs | 12 +- Microsoft/Samples/sympl/csharp/DlrHosting.cs | 12 +- Microsoft/Samples/sympl/csharp/Program.cs | 10 +- Microsoft/Samples/sympl/csharp/Runtime.cs | 58 +++--- Microsoft/Samples/sympl/csharp/Sympl.cs | 24 +-- Microsoft/Samples/sympl/csharp/sympl.csproj | 10 +- Microsoft/Samples/sympl/python/etgen.py | 32 +-- Microsoft/Samples/sympl/python/parser.py | 28 +-- Microsoft/Samples/sympl/python/runtime.py | 88 ++++---- Microsoft/Samples/sympl/python/sympl.py | 36 ++-- Scripting/ArgumentTypeException.cs | 2 +- Scripting/AssemblyLoadedEventArgs.cs | 2 +- Scripting/CompilerOptions.cs | 2 +- Scripting/ErrorSink.cs | 8 +- Scripting/GlobalSuppressions.cs | 20 +- Scripting/Hosting/CompiledCode.cs | 22 +- .../Hosting/Configuration/LanguageElement.cs | 4 +- .../LanguageElementCollection.cs | 2 +- .../Hosting/Configuration/OptionElement.cs | 4 +- .../Configuration/OptionElementCollection.cs | 2 +- Scripting/Hosting/Configuration/Section.cs | 22 +- Scripting/Hosting/DocumentationOperations.cs | 6 +- Scripting/Hosting/ErrorListener.cs | 2 +- Scripting/Hosting/ErrorListenerProxy.cs | 10 +- Scripting/Hosting/ErrorSinkProxyListener.cs | 4 +- Scripting/Hosting/ExceptionOperations.cs | 6 +- Scripting/Hosting/LanguageSetup.cs | 10 +- Scripting/Hosting/MemberDoc.cs | 4 +- Scripting/Hosting/MemberKind.cs | 2 +- Scripting/Hosting/ObjectOperations.cs | 86 ++++---- Scripting/Hosting/OverloadDoc.cs | 4 +- Scripting/Hosting/ParameterDoc.cs | 4 +- Scripting/Hosting/ParameterFlags.cs | 2 +- Scripting/Hosting/Providers/HostingHelpers.cs | 14 +- Scripting/Hosting/ScriptEngine.cs | 192 +++++++++--------- Scripting/Hosting/ScriptHost.cs | 18 +- Scripting/Hosting/ScriptHostProxy.cs | 8 +- Scripting/Hosting/ScriptIO.cs | 6 +- Scripting/Hosting/ScriptRuntime.cs | 38 ++-- Scripting/Hosting/ScriptRuntimeSetup.cs | 18 +- Scripting/Hosting/ScriptScope.cs | 18 +- Scripting/Hosting/ScriptSource.cs | 58 +++--- Scripting/Hosting/TokenCategorizer.cs | 6 +- Scripting/IndexSpan.cs | 10 +- Scripting/InvalidImplementationException.cs | 2 +- Scripting/LanguageOptions.cs | 12 +- Scripting/PlatformAdaptationLayer.cs | 8 +- Scripting/Properties/AssemblyInfo.cs | 10 +- ...ting.csproj => Riverside.Scripting.csproj} | 0 Scripting/Runtime/ContextId.cs | 4 +- Scripting/Runtime/DlrConfiguration.cs | 16 +- Scripting/Runtime/DocumentationProvider.cs | 4 +- .../Runtime/DynamicOperations.Generated.cs | 6 +- Scripting/Runtime/DynamicOperations.cs | 50 ++--- .../Runtime/DynamicRuntimeHostingProvider.cs | 2 +- Scripting/Runtime/DynamicStackFrame.cs | 2 +- Scripting/Runtime/InvariantContext.cs | 2 +- .../LanguageBoundTextContentProvider.cs | 4 +- Scripting/Runtime/LanguageContext.cs | 76 +++---- Scripting/Runtime/NotNullAttribute.cs | 6 +- Scripting/Runtime/ObjectDictionaryExpando.cs | 2 +- Scripting/Runtime/ParamDictionaryAttribute.cs | 14 +- Scripting/Runtime/ParserSink.cs | 4 +- Scripting/Runtime/Scope.cs | 20 +- Scripting/Runtime/ScopeExtension.cs | 4 +- Scripting/Runtime/ScopeStorage.cs | 4 +- Scripting/Runtime/ScriptCode.cs | 6 +- Scripting/Runtime/ScriptDomainManager.cs | 6 +- Scripting/Runtime/SharedIO.cs | 4 +- .../Runtime/SourceStringContentProvider.cs | 4 +- Scripting/Runtime/StreamContentProvider.cs | 14 +- Scripting/Runtime/StringDictionaryExpando.cs | 4 +- Scripting/Runtime/TokenInfo.cs | 2 +- Scripting/Runtime/TokenTriggers.cs | 2 +- Scripting/Runtime/TokenizerService.cs | 2 +- Scripting/ScriptCodeParseResult.cs | 4 +- Scripting/Severity.cs | 2 +- Scripting/SourceCodeKind.cs | 4 +- Scripting/SourceCodeReader.cs | 6 +- Scripting/SourceFileContentProvider.cs | 4 +- Scripting/SourceLocation.cs | 4 +- Scripting/SourceSpan.cs | 2 +- Scripting/SourceUnit.cs | 12 +- Scripting/SyntaxErrorException.cs | 6 +- Scripting/TextContentProvider.cs | 10 +- Scripting/TokenCategory.cs | 30 +-- Scripting/Utils/ArrayUtils.cs | 6 +- Scripting/Utils/AssemblyQualifiedTypeName.cs | 4 +- Scripting/Utils/Assert.cs | 2 +- Scripting/Utils/CollectionExtensions.cs | 6 +- Scripting/Utils/ConsoleInputStream.cs | 4 +- Scripting/Utils/ConsoleStreamType.cs | 2 +- Scripting/Utils/ContractUtils.cs | 2 +- Scripting/Utils/DelegateUtils.cs | 10 +- Scripting/Utils/ExceptionFactory.Generated.cs | 4 +- Scripting/Utils/ExceptionUtils.cs | 2 +- Scripting/Utils/ExpressionUtils.cs | 2 +- Scripting/Utils/NativeMethods.cs | 2 +- Scripting/Utils/ReflectionUtils.cs | 2 +- Scripting/Utils/TextStream.cs | 2 +- Tests/ClrAssembly/ClrAssembly.csproj | 2 +- Tests/ClrAssembly/Src/dynamicobjmodel.cs | 2 +- Tests/ClrAssembly/Src/methodargs.cs | 2 +- Tests/HostingTest/CompiledCodeTest.cs | 12 +- Tests/HostingTest/HAPITestBase.cs | 12 +- Tests/HostingTest/HostingTest.csproj | 10 +- Tests/HostingTest/ObjectOperationsTest.cs | 102 +++++----- .../HostingTest/ObjectOperationsTestHelper.cs | 6 +- Tests/HostingTest/Properties/AssemblyInfo.cs | 12 +- Tests/HostingTest/ScriptEngineTest.cs | 78 +++---- Tests/HostingTest/ScriptEngineTestHelper.cs | 22 +- Tests/HostingTest/ScriptHostBasicSubTest.cs | 8 +- Tests/HostingTest/ScriptHostTest.cs | 122 +++++------ Tests/HostingTest/ScriptHostTestHelper.cs | 16 +- Tests/HostingTest/ScriptIOTest.cs | 24 +-- Tests/HostingTest/ScriptRuntimeSetupTest.cs | 12 +- .../ScriptRuntimeSetupTestHelper.cs | 16 +- Tests/HostingTest/ScriptRuntimeTest.cs | 46 ++--- Tests/HostingTest/ScriptRuntimeTestHelper.cs | 6 +- Tests/HostingTest/ScriptScopeDictionary.cs | 4 +- Tests/HostingTest/ScriptScopeTest.cs | 78 +++---- Tests/HostingTest/ScriptScopeTestHelper.cs | 10 +- Tests/HostingTest/ScriptSourceTest.cs | 128 ++++++------ Tests/HostingTest/ScriptSourceTestHelper.cs | 20 +- Tests/HostingTest/TestHelpers.cs | 14 +- Tests/HostingTest/TestHost.cs | 2 +- Tests/Metadata/Metadata.csproj | 4 +- Tests/Metadata/MetadataTablesExtensions.cs | 6 +- Tests/Metadata/NamespaceTree.cs | 14 +- Tests/Metadata/NamespaceTree_Reflection.cs | 10 +- Tests/Metadata/Program.cs | 36 ++-- Tests/Metadata/RubyModules.cs | 4 +- Tests/Metadata/Scripts/coverage.cmd | 10 +- Tests/Metadata/Sequence.cs | 2 +- Tests/Metadata/TypeNestings.cs | 4 +- Tests/Metadata/UnitTests.cs | 6 +- .../InterpreterTest.cs | 2 +- .../LightExceptionTests.cs | 20 +- .../Riverside.Dynamic.Test.csproj} | 2 +- .../TestReflectionServices.cs | 4 +- .../TestTuple.cs | 10 +- .../Utils/MathUtilsTest.cs | 2 +- .../Riverside.Scripting.Test.csproj} | 2 +- .../Utils/ArrayUtilsTest.cs | 2 +- make.ps1 | 16 +- 531 files changed, 2795 insertions(+), 2807 deletions(-) rename Dynamic/Debugging/{Microsoft.Scripting.Debugging.Generated.cs => Riverside.Scripting.Debugging.Generated.cs} (97%) rename Dynamic/{Microsoft.Dynamic.csproj => Riverside.Dynamic.csproj} (85%) rename Dynamic/{Microsoft.Scripting.txt => Riverside.Scripting.txt} (100%) rename Metadata/{Microsoft.Scripting.Metadata.csproj => Riverside.Scripting.Metadata.csproj} (91%) rename Scripting/{Microsoft.Scripting.csproj => Riverside.Scripting.csproj} (100%) rename Tests/{Microsoft.Dynamic.Test => Riverside.Dynamic.Test}/InterpreterTest.cs (97%) rename Tests/{Microsoft.Dynamic.Test => Riverside.Dynamic.Test}/LightExceptionTests.cs (97%) rename Tests/{Microsoft.Dynamic.Test/Microsoft.Dynamic.Test.csproj => Riverside.Dynamic.Test/Riverside.Dynamic.Test.csproj} (86%) rename Tests/{Microsoft.Dynamic.Test => Riverside.Dynamic.Test}/TestReflectionServices.cs (99%) rename Tests/{Microsoft.Dynamic.Test => Riverside.Dynamic.Test}/TestTuple.cs (95%) rename Tests/{Microsoft.Dynamic.Test => Riverside.Dynamic.Test}/Utils/MathUtilsTest.cs (99%) rename Tests/{Microsoft.Scripting.Test/Microsoft.Scripting.Test.csproj => Riverside.Scripting.Test/Riverside.Scripting.Test.csproj} (86%) rename Tests/{Microsoft.Scripting.Test => Riverside.Scripting.Test}/Utils/ArrayUtilsTest.cs (97%) diff --git a/Build.proj b/Build.proj index 697fbf0d..68812e8c 100644 --- a/Build.proj +++ b/Build.proj @@ -75,7 +75,7 @@ - + diff --git a/Directory.Build.props b/Directory.Build.props index a9c79692..d0f08a20 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,7 +4,7 @@ $(MSBuildThisFileDirectory) - $(DlrRootDir)\Build + $(DlrRootDir)\Packaging\Targets true @@ -16,8 +16,8 @@ 1000 Dynamic Language Runtime - DLR Open Source Team - © DLR Contributors + Riverside Valley Corporation + © .NET Foundation and Contributors $(MajorVersion).$(MinorVersion).$(MicroVersion).$(AssemblyRevision) $(MajorVersion).$(MinorVersion).$(MicroVersion).$(AssemblyFileRevision) $(MSBuildProjectName) $(MajorVersion).$(MinorVersion).$(MicroVersion) $(ReleaseLevel) $(ReleaseSerial) diff --git a/Dynamic.sln b/Dynamic.sln index 729b5815..95c811e2 100644 --- a/Dynamic.sln +++ b/Dynamic.sln @@ -10,11 +10,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClrAssembly", "Tests\ClrAss {EB66B766-6354-4208-A3D4-AACBDCB5C3B3} = {EB66B766-6354-4208-A3D4-AACBDCB5C3B3} EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Dynamic", "Dynamic\Microsoft.Dynamic.csproj", "{EB66B766-6354-4208-A3D4-AACBDCB5C3B3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Riverside.Dynamic", "Dynamic\Riverside.Dynamic.csproj", "{EB66B766-6354-4208-A3D4-AACBDCB5C3B3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Scripting", "Scripting\Microsoft.Scripting.csproj", "{02FF0909-F5AD-48CF-A86A-345E721B7E40}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Riverside.Scripting", "Scripting\Riverside.Scripting.csproj", "{02FF0909-F5AD-48CF-A86A-345E721B7E40}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Scripting.Metadata", "Metadata\Microsoft.Scripting.Metadata.csproj", "{ACDD9B9E-8FE6-439C-9521-1CCBA47F6143}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Riverside.Scripting.Metadata", "Metadata\Riverside.Scripting.Metadata.csproj", "{ACDD9B9E-8FE6-439C-9521-1CCBA47F6143}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Metadata", "Tests\Metadata\Metadata.csproj", "{848BBEB0-63E6-4736-B60C-23A9D733593D}" EndProject @@ -49,9 +49,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nuget", "nuget", "{88E65B67 Package\nuget\DynamicLanguageRuntime.nuspec = Package\nuget\DynamicLanguageRuntime.nuspec EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Dynamic.Test", "Tests\Microsoft.Dynamic.Test\Microsoft.Dynamic.Test.csproj", "{CBDDAD40-D44E-458A-AA53-9A6DB62EC4A1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Riverside.Dynamic.Test", "Tests\Riverside.Dynamic.Test\Riverside.Dynamic.Test.csproj", "{CBDDAD40-D44E-458A-AA53-9A6DB62EC4A1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Scripting.Test", "Tests\Microsoft.Scripting.Test\Microsoft.Scripting.Test.csproj", "{56B4AA3A-42BC-4CA6-A022-703A777332AF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Riverside.Scripting.Test", "Tests\Riverside.Scripting.Test\Riverside.Scripting.Test.csproj", "{56B4AA3A-42BC-4CA6-A022-703A777332AF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Dynamic/Actions/ActionBinder.cs b/Dynamic/Actions/ActionBinder.cs index 0b3004db..37286187 100644 --- a/Dynamic/Actions/ActionBinder.cs +++ b/Dynamic/Actions/ActionBinder.cs @@ -9,16 +9,16 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Actions.Calls; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Actions.Calls; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// Provides binding semantics for a language. This include conversions as well as support - /// for producing rules for actions. These optimized rules are used for calling methods, + /// for producing rules for actions. These optimized rules are used for calling methods, /// performing operators, and getting members using the ActionBinder's conversion semantics. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] @@ -27,7 +27,7 @@ public abstract class ActionBinder { /// /// Determines if the binder should allow access to non-public members. - /// + /// /// By default the binder does not allow access to non-public members. Base classes /// can inherit and override this value to customize whether or not private binding /// is available. @@ -105,7 +105,7 @@ public virtual Expression ConvertExpression(Expression expr, Type toType, Conver /// /// Gets the members that are visible from the provided type of the specified name. - /// + /// /// The default implemetnation first searches the type, then the flattened heirachy of the type, and then /// registered extension methods. /// @@ -186,7 +186,7 @@ public ErrorInfo MakeStaticPropertyInstanceAccessError(PropertyTracker tracker, /// /// Called when a set is attempting to assign to a field or property from a derived class through the base class. - /// + /// /// The default behavior is to allow the assignment. /// public virtual ErrorInfo MakeStaticAssignFromDerivedTypeError(Type accessingType, DynamicMetaObject self, MemberTracker assigning, DynamicMetaObject assignedValue, OverloadResolverFactory context) { @@ -220,7 +220,7 @@ public virtual ErrorInfo MakeStaticAssignFromDerivedTypeError(Type accessingType /// /// Creates an ErrorInfo object when a static property is accessed from an instance member. The default behavior is throw - /// an exception indicating that static members properties be accessed via an instance. Languages can override this to + /// an exception indicating that static members properties be accessed via an instance. Languages can override this to /// customize the exception, message, or to produce an ErrorInfo object which reads or writes to the property being accessed. /// /// The static property being accessed through an instance @@ -270,7 +270,7 @@ public virtual ErrorInfo MakeConversionError(Type toType, Expression value) { /// /// Provides a way for the binder to provide a custom error message when lookup fails. Just /// doing this for the time being until we get a more robust error return mechanism. - /// + /// /// Deprecated, use the non-generic version instead /// public virtual ErrorInfo MakeMissingMemberError(Type type, DynamicMetaObject self, string name) { @@ -295,7 +295,7 @@ public virtual ErrorInfo MakeMissingMemberErrorForDelete(Type type, DynamicMetaO } #endregion - + public virtual string GetTypeName(Type t) { return t.Name; } @@ -376,7 +376,7 @@ public virtual IList GetExtensionTypes(Type t) { /// /// Provides an opportunity for languages to replace all MemberTracker's with their own type. - /// + /// /// Alternatlely a language can expose MemberTracker's directly. /// /// The member which is being returned to the user. diff --git a/Dynamic/Actions/Argument.cs b/Dynamic/Actions/Argument.cs index a6feeb9b..5d658ad2 100644 --- a/Dynamic/Actions/Argument.cs +++ b/Dynamic/Actions/Argument.cs @@ -5,10 +5,10 @@ using System; using System.Linq.Expressions; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// TODO: Alternatively, it should be sufficient to remember indices for this, list, dict and block. /// diff --git a/Dynamic/Actions/ArgumentType.cs b/Dynamic/Actions/ArgumentType.cs index 02011289..a574e6a6 100644 --- a/Dynamic/Actions/ArgumentType.cs +++ b/Dynamic/Actions/ArgumentType.cs @@ -2,12 +2,12 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// Convention for an individual argument at a callsite. - /// - /// Multiple different callsites can match against a single declaration. - /// Some argument kinds can be "unrolled" into multiple arguments, such as list and dictionary. + /// + /// Multiple different callsites can match against a single declaration. + /// Some argument kinds can be "unrolled" into multiple arguments, such as list and dictionary. /// public enum ArgumentType { /// @@ -23,7 +23,7 @@ public enum ArgumentType { Named, /// - /// Argument containing a list of arguments. + /// Argument containing a list of arguments. /// In Python: foo(*(1,2*2,3)) would match 'def foo(a,b,c)' with 3 declared arguments such that (a,b,c)=(1,4,3). /// it could also match 'def foo(*l)' with 1 declared argument such that l=(1,4,3) /// diff --git a/Dynamic/Actions/BoundMemberTracker.cs b/Dynamic/Actions/BoundMemberTracker.cs index 7ad7bc95..bc07e5ac 100644 --- a/Dynamic/Actions/BoundMemberTracker.cs +++ b/Dynamic/Actions/BoundMemberTracker.cs @@ -5,9 +5,9 @@ using System; using System.Dynamic; -using Microsoft.Scripting.Actions.Calls; +using Riverside.Scripting.Actions.Calls; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public class BoundMemberTracker : MemberTracker { public BoundMemberTracker(MemberTracker tracker, DynamicMetaObject instance) { BoundTo = tracker; diff --git a/Dynamic/Actions/CallSignature.cs b/Dynamic/Actions/CallSignature.cs index 32c368bc..30668eff 100644 --- a/Dynamic/Actions/CallSignature.cs +++ b/Dynamic/Actions/CallSignature.cs @@ -8,17 +8,17 @@ using System.Linq.Expressions; using System.Text; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// Richly represents the signature of a callsite. /// public struct CallSignature : IEquatable { // TODO: invariant _infos != null ==> _argumentCount == _infos.Length - + /// /// Array of additional meta information about the arguments, such as named arguments. /// Null for a simple signature that's just an expression list. eg: foo(a*b,c,d) @@ -31,14 +31,14 @@ public struct CallSignature : IEquatable { private readonly int _argumentCount; /// - /// All arguments are unnamed and matched by position. + /// All arguments are unnamed and matched by position. /// public bool IsSimple => _infos == null; public int ArgumentCount { get { Debug.Assert(_infos == null || _infos.Length == _argumentCount); - return _argumentCount; + return _argumentCount; } } @@ -48,7 +48,7 @@ public CallSignature(CallSignature signature) { _infos = signature.GetArgumentInfos(); _argumentCount = signature._argumentCount; } - + public CallSignature(int argumentCount) { ContractUtils.Requires(argumentCount >= 0, nameof(argumentCount)); _argumentCount = argumentCount; @@ -135,7 +135,7 @@ public override string ToString() { if (_infos == null) { return "Simple"; } - + StringBuilder sb = new StringBuilder("("); for (int i = 0; i < _infos.Length; i++) { if (i > 0) { @@ -174,7 +174,7 @@ public CallSignature InsertArgumentAt(int index, Argument info) { if (info.IsSimple) { return new CallSignature(_argumentCount + 1); } - + return new CallSignature(ArrayUtils.InsertAt(GetArgumentInfos(), index, info)); } @@ -239,7 +239,7 @@ public bool HasKeywordArgument() { } return false; } - + public ArgumentType GetArgumentKind(int index) { // TODO: Contract.Requires(index >= 0 && index < _argumentCount, "index"); return _infos?[index].Kind ?? ArgumentType.Simple; @@ -298,7 +298,7 @@ public Expression CreateExpression() { args[i] = _infos[i].CreateExpression(); } return Expression.New( - typeof(CallSignature).GetConstructor(new Type[] { typeof(Argument[]) }), + typeof(CallSignature).GetConstructor(new Type[] { typeof(Argument[]) }), Expression.NewArrayInit(typeof(Argument), args) ); } diff --git a/Dynamic/Actions/Calls/ActualArguments.cs b/Dynamic/Actions/Calls/ActualArguments.cs index 3806ad7a..5df0bb6a 100644 --- a/Dynamic/Actions/Calls/ActualArguments.cs +++ b/Dynamic/Actions/Calls/ActualArguments.cs @@ -8,9 +8,9 @@ using System.Dynamic; using System.Linq; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { public sealed class ActualArguments { public ActualArguments(IList args, IList namedArgs, IList argNames, int hiddenCount, int collapsedCount, int firstSplattedArg, int splatIndex) { @@ -74,9 +74,9 @@ internal int ToSplattedItemIndex(int collapsedArgIndex) { index < Arguments.Count ? Arguments[index] : NamedArguments[index - Arguments.Count]; /// - /// Binds named arguments to the parameters. Returns a permutation of indices that captures the relationship between + /// Binds named arguments to the parameters. Returns a permutation of indices that captures the relationship between /// named arguments and their corresponding parameters. Checks for duplicate and unbound named arguments. - /// Ensures that for all i: namedArgs[i] binds to parameters[args.Length + bindingPermutation[i]] + /// Ensures that for all i: namedArgs[i] binds to parameters[args.Length + bindingPermutation[i]] /// internal bool TryBindNamedArguments(MethodCandidate method, out ArgumentBinding binding, out CallFailure failure) { if (NamedArguments.Count == 0) { diff --git a/Dynamic/Actions/Calls/ApplicableCandidate.cs b/Dynamic/Actions/Calls/ApplicableCandidate.cs index 4cf3b5a0..5cdf78a1 100644 --- a/Dynamic/Actions/Calls/ApplicableCandidate.cs +++ b/Dynamic/Actions/Calls/ApplicableCandidate.cs @@ -2,9 +2,9 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { public sealed class ApplicableCandidate { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public readonly MethodCandidate Method; diff --git a/Dynamic/Actions/Calls/ArgBuilder.cs b/Dynamic/Actions/Calls/ArgBuilder.cs index a4056a21..c4344cc0 100644 --- a/Dynamic/Actions/Calls/ArgBuilder.cs +++ b/Dynamic/Actions/Calls/ArgBuilder.cs @@ -6,11 +6,11 @@ using System.Linq.Expressions; using System.Reflection; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// /// ArgBuilder provides an argument value used by the MethodBinder. One ArgBuilder exists for each - /// physical parameter defined on a method. - /// + /// physical parameter defined on a method. + /// /// Contrast this with ParameterWrapper which represents the logical argument passed to the method. /// public abstract class ArgBuilder { diff --git a/Dynamic/Actions/Calls/ArgumentBinding.cs b/Dynamic/Actions/Calls/ArgumentBinding.cs index edea0c67..a6c4313d 100644 --- a/Dynamic/Actions/Calls/ArgumentBinding.cs +++ b/Dynamic/Actions/Calls/ArgumentBinding.cs @@ -2,9 +2,9 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes")] // TODO public struct ArgumentBinding { private static readonly int[] _EmptyBinding = System.Array.Empty(); diff --git a/Dynamic/Actions/Calls/BindingResult.cs b/Dynamic/Actions/Calls/BindingResult.cs index 4dd2bc1d..fa89f3da 100644 --- a/Dynamic/Actions/Calls/BindingResult.cs +++ b/Dynamic/Actions/Calls/BindingResult.cs @@ -2,13 +2,13 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// /// Indicates the specific type of failure, if any, from binding to a method. /// public enum BindingResult { /// - /// The binding succeeded. Only one method was applicable or had the best conversion. + /// The binding succeeded. Only one method was applicable or had the best conversion. /// Success, @@ -26,7 +26,7 @@ public enum BindingResult { /// None of the target method(s) can successfully be called. The failure can be due to: /// 1. Arguments could not be successfully converted for the call /// 2. Keyword arguments could not be assigned to positional arguments - /// 3. Keyword arguments could be assigned but would result in an argument being assigned + /// 3. Keyword arguments could be assigned but would result in an argument being assigned /// multiple times (keyword and positional arguments conflit or dupliate keyword arguments). /// CallFailure, diff --git a/Dynamic/Actions/Calls/BindingTarget.cs b/Dynamic/Actions/Calls/BindingTarget.cs index 51f52ba2..3f5a6e80 100644 --- a/Dynamic/Actions/Calls/BindingTarget.cs +++ b/Dynamic/Actions/Calls/BindingTarget.cs @@ -7,10 +7,10 @@ using System.Linq.Expressions; using System.Reflection; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// /// Encapsulates the result of an attempt to bind to one or methods using the OverloadResolver. - /// + /// /// Users should first check the Result property to see if the binding was successful or /// to determine the specific type of failure that occured. If the binding was successful /// MakeExpression can then be called to create an expression which calls the method. @@ -44,7 +44,7 @@ internal BindingTarget(string name, int actualArgumentCount, int[] expectedArgCo } /// - /// Creates a new BindingTarget when the method binding has failued due to + /// Creates a new BindingTarget when the method binding has failued due to /// one or more arguments which could not be converted or assigned to corresponding parameters. /// internal BindingTarget(string name, int actualArgumentCount, CallFailure[] failures) { @@ -79,7 +79,7 @@ internal BindingTarget(string name, BindingResult result) { /// /// Gets an Expression which calls the binding target if the method binding succeeded. - /// + /// /// Throws InvalidOperationException if the binding failed. /// public Expression MakeExpression() { @@ -138,7 +138,7 @@ public Expression MakeExpression() { /// /// Gets the MetaObjects which we originally did binding against in their restricted form. - /// + /// /// The members of the array correspond to each of the arguments. All members of the array /// have a value. /// diff --git a/Dynamic/Actions/Calls/ByRefReturnBuilder.cs b/Dynamic/Actions/Calls/ByRefReturnBuilder.cs index e70d3c1e..1392dba9 100644 --- a/Dynamic/Actions/Calls/ByRefReturnBuilder.cs +++ b/Dynamic/Actions/Calls/ByRefReturnBuilder.cs @@ -5,9 +5,9 @@ using System.Collections.Generic; using System.Linq.Expressions; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { using Ast = Expression; internal sealed class ByRefReturnBuilder : ReturnBuilder { diff --git a/Dynamic/Actions/Calls/CallFailure.cs b/Dynamic/Actions/Calls/CallFailure.cs index f2225142..87d9e6fb 100644 --- a/Dynamic/Actions/Calls/CallFailure.cs +++ b/Dynamic/Actions/Calls/CallFailure.cs @@ -5,16 +5,16 @@ using System.Collections.Generic; using System.Diagnostics; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// /// Represents the reason why a call to a specific method could not be performed by the OverloadResolver. - /// + /// /// The reason for the failure is specified by the CallFailureReason property. Once this property /// has been consulted the other properties can be consulted for more detailed information regarding /// the failure. - /// + /// /// If reason is ConversionFailure the ConversionResults property will be non-null. /// If reason is UnassignableKeyword the KeywordArguments property will be non-null and include /// the keywords which could not be assigned. @@ -65,7 +65,7 @@ internal CallFailure(MethodCandidate candidate, CallFailureReason reason) { public MethodCandidate Candidate { get; } /// - /// Gets the reason for the call failure which determines the other + /// Gets the reason for the call failure which determines the other /// properties of the CallFailure which should be consulted. /// public CallFailureReason Reason { get; } diff --git a/Dynamic/Actions/Calls/CallFailureReason.cs b/Dynamic/Actions/Calls/CallFailureReason.cs index 2bba5570..8b11414c 100644 --- a/Dynamic/Actions/Calls/CallFailureReason.cs +++ b/Dynamic/Actions/Calls/CallFailureReason.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { public enum CallFailureReason { /// /// Default value, their was no CallFailure. @@ -20,7 +20,7 @@ public enum CallFailureReason { UnassignableKeyword, /// - /// One or more keyword arguments were duplicated or would have taken the spot of a + /// One or more keyword arguments were duplicated or would have taken the spot of a /// provided positional argument. /// DuplicateKeyword, diff --git a/Dynamic/Actions/Calls/Candidate.cs b/Dynamic/Actions/Calls/Candidate.cs index 29b59a11..0ffae0d2 100644 --- a/Dynamic/Actions/Calls/Candidate.cs +++ b/Dynamic/Actions/Calls/Candidate.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { public enum Candidate { Equivalent = 0, One = +1, diff --git a/Dynamic/Actions/Calls/CandidateSet.cs b/Dynamic/Actions/Calls/CandidateSet.cs index d759f6ab..d9bb659b 100644 --- a/Dynamic/Actions/Calls/CandidateSet.cs +++ b/Dynamic/Actions/Calls/CandidateSet.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Diagnostics; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// /// Represents a collection of MethodCandidate's which all accept the /// same number of logical parameters. For example a params method diff --git a/Dynamic/Actions/Calls/ConversionResult.cs b/Dynamic/Actions/Calls/ConversionResult.cs index de3fab29..33e2e1f6 100644 --- a/Dynamic/Actions/Calls/ConversionResult.cs +++ b/Dynamic/Actions/Calls/ConversionResult.cs @@ -5,9 +5,9 @@ using System; using System.Collections.Generic; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// /// Represents information about a failure to convert an argument from one /// type to another. diff --git a/Dynamic/Actions/Calls/DefaultArgBuilder.cs b/Dynamic/Actions/Calls/DefaultArgBuilder.cs index 1e740aa7..aa057fa4 100644 --- a/Dynamic/Actions/Calls/DefaultArgBuilder.cs +++ b/Dynamic/Actions/Calls/DefaultArgBuilder.cs @@ -6,17 +6,17 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// /// ArgBuilder which provides a default parameter value for a method call. /// internal sealed class DefaultArgBuilder : ArgBuilder { - public DefaultArgBuilder(ParameterInfo info) + public DefaultArgBuilder(ParameterInfo info) : base(info) { Assert.NotNull(info); } diff --git a/Dynamic/Actions/Calls/DefaultOverloadResolver.cs b/Dynamic/Actions/Calls/DefaultOverloadResolver.cs index 21160e2f..41136f18 100644 --- a/Dynamic/Actions/Calls/DefaultOverloadResolver.cs +++ b/Dynamic/Actions/Calls/DefaultOverloadResolver.cs @@ -9,12 +9,12 @@ using System.Dynamic; using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Actions.Calls; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Actions.Calls; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { using Ast = Expression; internal sealed class DefaultOverloadResolverFactory : OverloadResolverFactory { @@ -133,7 +133,7 @@ protected override void GetNamedArguments(out IList namedArgs objects.TrimExcess(); argNames = names; namedArgs = objects; - } else { + } else { argNames = ArrayUtils.EmptyStrings; namedArgs = DynamicMetaObject.EmptyMetaObjects; } @@ -249,7 +249,7 @@ public override ErrorInfo MakeInvalidParametersError(BindingTarget target) { private ErrorInfo MakeInvalidSplatteeError(BindingTarget target) { return ErrorInfo.FromException( - Ast.Call(typeof(BinderOps).GetMethod(nameof(BinderOps.InvalidSplatteeError)), + Ast.Call(typeof(BinderOps).GetMethod(nameof(BinderOps.InvalidSplatteeError)), AstUtils.Constant(target.Name), AstUtils.Constant(Binder.GetTypeName(_invalidSplattee.GetLimitType())) ) diff --git a/Dynamic/Actions/Calls/InstanceBuilder.cs b/Dynamic/Actions/Calls/InstanceBuilder.cs index d6d07a4b..92ca83c4 100644 --- a/Dynamic/Actions/Calls/InstanceBuilder.cs +++ b/Dynamic/Actions/Calls/InstanceBuilder.cs @@ -6,12 +6,12 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Generation; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Generation; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { using Ast = Expression; - + public class InstanceBuilder { // Index of actual argument expression or -1 if the instance is null. private readonly int _index; @@ -48,8 +48,8 @@ private void GetCallableMethod(RestrictedArguments args, ref MethodInfo method) // will call the same thing but is visible. If this fails we still bind anyway - it's // the callers responsibility to filter out non-visible methods. // - // We use limit type of the meta instance so that we can access methods inherited to that type - // as accessible via an interface implemented by the type. The type might be internal and the methods + // We use limit type of the meta instance so that we can access methods inherited to that type + // as accessible via an interface implemented by the type. The type might be internal and the methods // might not be accessible otherwise. method = CompilerHelpers.TryGetCallableMethod(args.GetObject(_index).LimitType, method); } diff --git a/Dynamic/Actions/Calls/KeywordArgBuilder.cs b/Dynamic/Actions/Calls/KeywordArgBuilder.cs index b95e2690..0d950680 100644 --- a/Dynamic/Actions/Calls/KeywordArgBuilder.cs +++ b/Dynamic/Actions/Calls/KeywordArgBuilder.cs @@ -7,16 +7,16 @@ using System.Linq.Expressions; using System.Reflection; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// - /// ArgBuilder which provides a value for a keyword argument. - /// - /// The KeywordArgBuilder calculates its position at emit time using it's initial - /// offset within the keyword arguments, the number of keyword arguments, and the - /// total number of arguments provided by the user. It then delegates to an + /// ArgBuilder which provides a value for a keyword argument. + /// + /// The KeywordArgBuilder calculates its position at emit time using it's initial + /// offset within the keyword arguments, the number of keyword arguments, and the + /// total number of arguments provided by the user. It then delegates to an /// underlying ArgBuilder which only receives the single correct argument. - /// - /// Delaying the calculation of the position to emit time allows the method binding to be + /// + /// Delaying the calculation of the position to emit time allows the method binding to be /// done without knowing the exact the number of arguments provided by the user. Hence, /// the method binder can be dependent only on the set of method overloads and keyword names, /// but not the user arguments. While the number of user arguments could be determined @@ -26,7 +26,7 @@ internal sealed class KeywordArgBuilder : ArgBuilder { private readonly int _kwArgCount, _kwArgIndex; private readonly ArgBuilder _builder; - public KeywordArgBuilder(ArgBuilder builder, int kwArgCount, int kwArgIndex) + public KeywordArgBuilder(ArgBuilder builder, int kwArgCount, int kwArgIndex) : base(builder.ParameterInfo) { Debug.Assert(BuilderExpectsSingleParameter(builder)); diff --git a/Dynamic/Actions/Calls/KeywordConstructorReturnBuilder.cs b/Dynamic/Actions/Calls/KeywordConstructorReturnBuilder.cs index 749a8127..3a460d67 100644 --- a/Dynamic/Actions/Calls/KeywordConstructorReturnBuilder.cs +++ b/Dynamic/Actions/Calls/KeywordConstructorReturnBuilder.cs @@ -7,10 +7,10 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Runtime; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Runtime; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// /// Updates fields/properties of the returned value with unused keyword parameters. @@ -42,7 +42,7 @@ internal override Expression ToExpression(OverloadResolver resolver, IList /// MethodCandidate represents the different possible ways of calling a method or a set of method overloads. @@ -128,15 +128,15 @@ public IList GetParameters() { /// /// Builds a new MethodCandidate which takes count arguments and the provided list of keyword arguments. - /// + /// /// The basic idea here is to figure out which parameters map to params or a dictionary params and - /// fill in those spots w/ extra ParameterWrapper's. + /// fill in those spots w/ extra ParameterWrapper's. /// internal MethodCandidate MakeParamsExtended(int count, IList names) { Debug.Assert(Overload.IsVariadic); List newParameters = new List(count); - + // keep track of which named args map to a real argument, and which ones // map to the params dictionary. List unusedNames = new List(names); @@ -235,7 +235,7 @@ private MethodCandidate MakeParamsExtended(string[] names, int[] nameIndices, Li newArgBuilders.Add(ab); curArg++; } else { - // CodeContext, null, default, etc... we don't consume an + // CodeContext, null, default, etc... we don't consume an // actual incoming argument. newArgBuilders.Add(ab); } diff --git a/Dynamic/Actions/Calls/NarrowingLevel.cs b/Dynamic/Actions/Calls/NarrowingLevel.cs index d1ba87f8..dd7f7d88 100644 --- a/Dynamic/Actions/Calls/NarrowingLevel.cs +++ b/Dynamic/Actions/Calls/NarrowingLevel.cs @@ -2,14 +2,14 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// - /// Narrowing conversions are conversions that cannot be proved to always succeed, conversions that are - /// known to possibly lose information, and conversions across domains of types sufficiently different - /// to merit narrowing notation like casts. - /// + /// Narrowing conversions are conversions that cannot be proved to always succeed, conversions that are + /// known to possibly lose information, and conversions across domains of types sufficiently different + /// to merit narrowing notation like casts. + /// /// Its upto every language to define the levels for conversions. The narrowling levels can be used by - /// for method overload resolution, where the overload is based on the parameter types (and not the number + /// for method overload resolution, where the overload is based on the parameter types (and not the number /// of parameters). /// public enum NarrowingLevel { diff --git a/Dynamic/Actions/Calls/OutArgBuilder.cs b/Dynamic/Actions/Calls/OutArgBuilder.cs index bd640aeb..d54339cb 100644 --- a/Dynamic/Actions/Calls/OutArgBuilder.cs +++ b/Dynamic/Actions/Calls/OutArgBuilder.cs @@ -6,10 +6,10 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// /// Builds the argument for an out argument when not passed a StrongBox. The out parameter /// is returned as an additional return value. @@ -19,7 +19,7 @@ internal sealed class OutArgBuilder : ArgBuilder { private readonly bool _isRef; private ParameterExpression _tmp; - public OutArgBuilder(ParameterInfo info) + public OutArgBuilder(ParameterInfo info) : base(info) { _parameterType = info.ParameterType.IsByRef ? info.ParameterType.GetElementType() : info.ParameterType; diff --git a/Dynamic/Actions/Calls/OverloadInfo.cs b/Dynamic/Actions/Calls/OverloadInfo.cs index 3b564ff5..ac2b59c2 100644 --- a/Dynamic/Actions/Calls/OverloadInfo.cs +++ b/Dynamic/Actions/Calls/OverloadInfo.cs @@ -8,12 +8,12 @@ using System.Diagnostics; using System.Reflection; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// - /// Defines a method overload abstraction for the purpose of overload resolution. + /// Defines a method overload abstraction for the purpose of overload resolution. /// It provides the overload resolver the metadata it needs to perform the resolution. /// /// @@ -57,7 +57,7 @@ public virtual bool IsParamDictionary(int parameterIndex) { /// The method arity can vary, i.e. the method has params array or params dict parameters. /// public abstract bool IsVariadic { get; } - + public abstract bool IsGenericMethodDefinition { get; } public abstract bool IsGenericMethod { get; } public abstract bool ContainsGenericParameters { get; } @@ -101,7 +101,7 @@ public virtual bool IsParamDictionary(int parameterIndex) { /// /// /// Not thread safe. - /// WARNING: This is a temporary API that will undergo breaking changes in future versions. + /// WARNING: This is a temporary API that will undergo breaking changes in future versions. /// public class ReflectionOverloadInfo : OverloadInfo { [Flags] @@ -136,7 +136,7 @@ public override ParameterInfo ReturnParameter { return method != null ? method.ReturnParameter : null; } } - + public override IList GenericArguments => _genericArguments ?? (_genericArguments = new ReadOnlyCollection(_method.GetGenericArguments())); public override Type DeclaringType => _method.DeclaringType; @@ -161,7 +161,7 @@ public override bool IsExtension { } public override bool IsVariadic { - get { + get { if ((_flags & _Flags.KnownVariadic) == 0) { _flags |= _Flags.KnownVariadic | (IsVariadicInternal() ? _Flags.IsVariadic : 0); } @@ -184,7 +184,7 @@ private bool IsVariadicInternal() { public override bool IsGenericMethodDefinition => _method.IsGenericMethodDefinition; public override bool ContainsGenericParameters { - get { + get { if ((_flags & _Flags.KnownContainsGenericParameters) == 0) { _flags |= _Flags.KnownContainsGenericParameters | (_method.ContainsGenericParameters ? _Flags.ContainsGenericParameters : 0); } diff --git a/Dynamic/Actions/Calls/OverloadResolver.cs b/Dynamic/Actions/Calls/OverloadResolver.cs index b2b512e6..5ee2aae2 100644 --- a/Dynamic/Actions/Calls/OverloadResolver.cs +++ b/Dynamic/Actions/Calls/OverloadResolver.cs @@ -11,47 +11,47 @@ using System.Reflection; using System.Text; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// /// Provides binding and overload resolution to .NET methods. - /// + /// /// MethodBinder's can be used for: - /// generating new AST code for calling a method + /// generating new AST code for calling a method /// calling a method via reflection at runtime /// (not implemented) performing an abstract call - /// + /// /// MethodBinder's support default arguments, optional arguments, by-ref (in and out), and keyword arguments. - /// + /// /// Implementation Details: - /// + /// /// The MethodBinder works by building up a CandidateSet for each number of effective arguments that can be /// passed to a set of overloads. For example a set of overloads such as: /// foo(object a, object b, object c) /// foo(int a, int b) - /// + /// /// would have 2 target sets - one for 3 parameters and one for 2 parameters. For parameter arrays /// we fallback and create the appropriately sized CandidateSet on demand. - /// + /// /// Each CandidateSet consists of a set of MethodCandidate's. Each MethodCandidate knows the flattened /// parameters that could be received. For example for a function such as: /// foo(params int[] args) - /// + /// /// When this method is in a CandidateSet of size 3 the MethodCandidate takes 3 parameters - all of them - /// ints; if it's in a CandidateSet of size 4 it takes 4 parameters. Effectively a MethodCandidate is + /// ints; if it's in a CandidateSet of size 4 it takes 4 parameters. Effectively a MethodCandidate is /// a simplified view that allows all arguments to be treated as required positional arguments. - /// + /// /// Each MethodCandidate in turn refers to a MethodTarget. The MethodTarget is composed of a set /// of ArgBuilder's and a ReturnBuilder which know how to consume the positional arguments and pass /// them to the appropriate argument of the destination method. This includes routing keyword /// arguments to the correct position, providing the default values for optional arguments, etc... - /// - /// After binding is finished the MethodCandidates are thrown away and a BindingTarget is returned. + /// + /// After binding is finished the MethodCandidates are thrown away and a BindingTarget is returned. /// The BindingTarget indicates whether the binding was successful and if not any additional information /// that should be reported to the user about the failed binding. It also exposes the MethodTarget which /// allows consumers to get the flattened list of required parameters for the call. MethodCandidates @@ -65,7 +65,7 @@ public abstract partial class OverloadResolver { private IList _argNames; private Dictionary _candidateSets; // the methods as they map from # of arguments -> the possible CandidateSet's. private List _paramsCandidates; // the methods which are params methods which need special treatment because they don't have fixed # of args - + // built as arguments are processed: private ActualArguments _actualArguments; private int _maxAccessedCollapsedArg; @@ -98,7 +98,7 @@ internal ParameterExpression GetTemporary(Type type, string name) { /// /// Resolves a method overload and returns back a BindingTarget. - /// + /// /// The BindingTarget can then be tested for the success or particular type of /// failure that prevents the method from being called. If successfully bound the BindingTarget /// contains a list of argument meta-objects with additional restrictions that ensure the selection @@ -124,10 +124,10 @@ public BindingTarget ResolveOverload(string methodName, IList meth _methodName = methodName; _minLevel = minLevel; _maxLevel = maxLevel; - + // step 1: GetNamedArguments(out IList namedArgs, out _argNames); - + // uses arg names: BuildCandidateSets(methods); @@ -231,9 +231,9 @@ private void BuildCandidateSets(IEnumerable methods) { AddBasicMethodTargets(method); } - + if (_paramsCandidates != null) { - // For all the methods that take a params array, create MethodCandidates that clash with the + // For all the methods that take a params array, create MethodCandidates that clash with the // other overloads of the method foreach (MethodCandidate candidate in _paramsCandidates) { foreach (int count in _candidateSets.Keys) { @@ -293,7 +293,7 @@ private void AddSimpleTarget(MethodCandidate target) { if (BindToUnexpandedParams(target)) { AddTarget(target); } - + if (_paramsCandidates == null) { _paramsCandidates = new List(); } @@ -336,7 +336,7 @@ public ActualArguments GetActualArguments() { if (_actualArguments == null) { throw new InvalidOperationException("Actual arguments have not been built yet."); } - return _actualArguments; + return _actualArguments; } protected virtual void GetNamedArguments(out IList namedArgs, out IList argNames) { @@ -365,7 +365,7 @@ internal BindingTarget MakeBindingTarget(CandidateSet targetSet) { return MakeFailedBindingTarget(nameBindingFailures.ToArray()); } - // go through all available narrowing levels selecting candidates. + // go through all available narrowing levels selecting candidates. for (NarrowingLevel level = _minLevel; level <= _maxLevel; level++) { failures?.Clear(); @@ -394,7 +394,7 @@ internal BindingTarget MakeBindingTarget(CandidateSet targetSet) { var bestCandidate = SelectBestCandidate(applicable, level); if (bestCandidate != null) { return MakeSuccessfulBindingTarget(bestCandidate, potential, level, targetSet); - } + } return MakeAmbiguousBindingTarget(applicable); } @@ -414,7 +414,7 @@ private List EnsureMatchingNamedArgs(List var result = new List(); foreach (MethodCandidate candidate in candidates) { // skip params dictionaries - we want to only pick up the methods normalized - // to have argument names (which we created because the MethodBinder gets + // to have argument names (which we created because the MethodBinder gets // created w/ keyword arguments). if (!candidate.HasParamsDictionary) { if (_actualArguments.TryBindNamedArguments(candidate, out ArgumentBinding namesBinding, out CallFailure callFailure)) { @@ -427,7 +427,7 @@ private List EnsureMatchingNamedArgs(List return result; } - private List SelectCandidatesWithConvertibleArgs(List candidates, NarrowingLevel level, + private List SelectCandidatesWithConvertibleArgs(List candidates, NarrowingLevel level, ref List failures) { bool hasGenericCandidates = false; @@ -604,7 +604,7 @@ private static bool IsOverloadedOnParameter(int argIndex, int argCount, IList levelTwo) { return Candidate.Two; } - + return Candidate.Ambiguous; } @@ -937,7 +937,7 @@ public virtual Expression GetDynamicConversion(Expression value, Type type) { #endregion #region Step 5: Results, Errors - + private int[] GetExpectedArgCounts() { if (_candidateSets.Count == 0 && _paramsCandidates == null) { return EmptyArray.Instance; @@ -1132,7 +1132,7 @@ private void GetSplatLimits(out int preSplatLimit, out int postSplatLimit) { int preCount = -1; int postCount = -1; - // For all the methods that take a params array, create MethodCandidates that clash with the + // For all the methods that take a params array, create MethodCandidates that clash with the // other overloads of the method foreach (MethodCandidate candidate in _paramsCandidates) { preCount = System.Math.Max(preCount, candidate.ParamsArrayIndex); diff --git a/Dynamic/Actions/Calls/OverloadResolverFactory.cs b/Dynamic/Actions/Calls/OverloadResolverFactory.cs index 94fbfa3b..705ab5dc 100644 --- a/Dynamic/Actions/Calls/OverloadResolverFactory.cs +++ b/Dynamic/Actions/Calls/OverloadResolverFactory.cs @@ -4,9 +4,9 @@ using System.Collections.Generic; using System.Dynamic; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { public abstract class OverloadResolverFactory { public abstract DefaultOverloadResolver CreateOverloadResolver(IList args, CallSignature signature, CallTypes callType); } diff --git a/Dynamic/Actions/Calls/ParameterMapping.cs b/Dynamic/Actions/Calls/ParameterMapping.cs index 595a532f..a803369a 100644 --- a/Dynamic/Actions/Calls/ParameterMapping.cs +++ b/Dynamic/Actions/Calls/ParameterMapping.cs @@ -10,9 +10,9 @@ using System.Reflection; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { public sealed class ParameterMapping { private readonly OverloadResolver _resolver; private readonly IList _argNames; @@ -109,20 +109,20 @@ public void MapParameter(ParameterInfo pi) { indexForArgBuilder = ArgIndex++; } else { // keyword argument, we just tell the simple arg builder to consume arg 0. - // KeywordArgBuilder will then pass in the correct single argument based + // KeywordArgBuilder will then pass in the correct single argument based // upon the actual argument number provided by the user. indexForArgBuilder = 0; } // if the parameter is default we need to build a default arg builder and then - // build a reduced method at the end. + // build a reduced method at the end. if (!pi.IsMandatory()) { // We need to build the default builder even if we have a parameter for it already to - // get good consistency of our error messages. But consider a method like + // get good consistency of our error messages. But consider a method like // def foo(a=1, b=2) and the user calls it as foo(b=3). Then adding the default // value breaks an otherwise valid call. This is because we only generate MethodCandidates // filling in the defaults from right to left (so the method - 1 arg requires a, - // and the method minus 2 args requires b). So we only add the default if it's + // and the method minus 2 args requires b). So we only add the default if it's // a positional arg or we don't already have a default value. if (nameIndex == -1 || !_hasDefaults) { _defaultArguments.Add(new DefaultArgBuilder(pi)); @@ -164,10 +164,10 @@ private void MapParameterReduceByRef(ParameterInfo pi) { Debug.Assert(_returnArgs != null); // TODO: - // Is this reduction necessary? What if - // 1) we had an implicit conversion StrongBox -> T& and + // Is this reduction necessary? What if + // 1) we had an implicit conversion StrongBox -> T& and // 2) all out parameters were treated as optional StrongBox parameters? (if not present we return the result in a return value) - + int indexForArgBuilder = 0; int nameIndex = -1; @@ -295,7 +295,7 @@ private ReturnBuilder MakeReturnBuilder(BitArray specialParameters) { ReturnBuilder returnBuilder = (_returnArgs != null) ? new ByRefReturnBuilder(_returnArgs) : new ReturnBuilder(Overload.ReturnType); - + if (_argNames.Count > 0 && _resolver.AllowMemberInitialization(Overload)) { List unusedNames = GetUnusedArgNames(specialParameters); List bindableMembers = GetBindableMembers(returnBuilder.ReturnType, unusedNames); @@ -305,7 +305,7 @@ private ReturnBuilder MakeReturnBuilder(BitArray specialParameters) { foreach (MemberInfo mi in bindableMembers) { PropertyInfo pi = mi as PropertyInfo; var type = (pi != null) ? pi.PropertyType : ((FieldInfo)mi).FieldType; - + _parameters.Add(new ParameterWrapper(null, type, mi.Name, ParameterBindingFlags.None)); nameIndices.Add(_argNames.IndexOf(mi.Name)); } diff --git a/Dynamic/Actions/Calls/ParameterWrapper.cs b/Dynamic/Actions/Calls/ParameterWrapper.cs index 7a0f1bc2..b7fcf462 100644 --- a/Dynamic/Actions/Calls/ParameterWrapper.cs +++ b/Dynamic/Actions/Calls/ParameterWrapper.cs @@ -7,9 +7,9 @@ using System.Diagnostics; using System.Reflection; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { [Flags] public enum ParameterBindingFlags { None = 0, @@ -25,7 +25,7 @@ public enum ParameterBindingFlags { /// of a method with byref parameters will be represented using a ParameterWrapper of the underlying /// element type, since the logical view of the byref-reduced signature is that the argument will be /// passed by value (and the updated value is included in the return value). - /// + /// /// Contrast this with ArgBuilder which represents the real physical argument passed to the method. /// public sealed class ParameterWrapper { @@ -42,8 +42,8 @@ public ParameterWrapper(Type type, string name, bool prohibitNull) } [Obsolete("Use ParameterBindingAttributes overload")] - public ParameterWrapper(ParameterInfo info, Type type, string name, bool prohibitNull, bool isParams, bool isParamsDict, bool isHidden) - : this(info, type, name, + public ParameterWrapper(ParameterInfo info, Type type, string name, bool prohibitNull, bool isParams, bool isParamsDict, bool isHidden) + : this(info, type, name, (prohibitNull ? ParameterBindingFlags.ProhibitNull : 0) | (isParams ? ParameterBindingFlags.IsParamArray : 0) | (isParamsDict ? ParameterBindingFlags.IsParamDictionary : 0) | @@ -52,7 +52,7 @@ public ParameterWrapper(ParameterInfo info, Type type, string name, bool prohibi public ParameterWrapper(ParameterInfo info, Type type, string name, ParameterBindingFlags flags) { ContractUtils.RequiresNotNull(type, nameof(type)); - + Type = type; ParameterInfo = info; _flags = flags; @@ -108,8 +108,8 @@ internal static int IndexOfParamsArray(IList parameters) { /// internal ParameterWrapper Expand() { Debug.Assert(IsParamsArray); - return new ParameterWrapper(ParameterInfo, Type.GetElementType(), null, - (ProhibitNullItems ? ParameterBindingFlags.ProhibitNull : 0) | + return new ParameterWrapper(ParameterInfo, Type.GetElementType(), null, + (ProhibitNullItems ? ParameterBindingFlags.ProhibitNull : 0) | (IsHidden ? ParameterBindingFlags.IsHidden : 0) ); } diff --git a/Dynamic/Actions/Calls/ParamsArgBuilder.cs b/Dynamic/Actions/Calls/ParamsArgBuilder.cs index f06e09b1..de140253 100644 --- a/Dynamic/Actions/Calls/ParamsArgBuilder.cs +++ b/Dynamic/Actions/Calls/ParamsArgBuilder.cs @@ -8,17 +8,17 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { internal sealed class ParamsArgBuilder : ArgBuilder { private readonly int _start; private readonly int _expandedCount; private readonly Type _elementType; - internal ParamsArgBuilder(ParameterInfo info, Type elementType, int start, int expandedCount) + internal ParamsArgBuilder(ParameterInfo info, Type elementType, int start, int expandedCount) : base(info) { Assert.NotNull(elementType); @@ -30,7 +30,7 @@ internal ParamsArgBuilder(ParameterInfo info, Type elementType, int start, int e _elementType = elementType; } - // Consumes all expanded arguments. + // Consumes all expanded arguments. // Collapsed arguments are fetched from resolver provided storage, not from actual argument expressions. public override int ConsumedArgumentCount => _expandedCount; @@ -67,11 +67,11 @@ protected internal override Expression ToExpression(OverloadResolver resolver, R Expression.ArrayAccess(arrayVariable, Expression.Add(AstUtils.Constant(itemIndex), indexVariable)), resolver.Convert( new DynamicMetaObject( - resolver.GetSplattedItemExpression(Expression.Add(AstUtils.Constant(splatIndex - firstSplatted), indexVariable)), + resolver.GetSplattedItemExpression(Expression.Add(AstUtils.Constant(splatIndex - firstSplatted), indexVariable)), BindingRestrictions.Empty ), null, - ParameterInfo, + ParameterInfo, _elementType ) ), @@ -86,7 +86,7 @@ protected internal override Expression ToExpression(OverloadResolver resolver, R } Debug.Assert(!hasBeenUsed[i]); - hasBeenUsed[i] = true; + hasBeenUsed[i] = true; result[e++] = Expression.Assign( Expression.ArrayAccess(arrayVariable, AstUtils.Constant(itemIndex++)), diff --git a/Dynamic/Actions/Calls/ParamsDictArgBuilder.cs b/Dynamic/Actions/Calls/ParamsDictArgBuilder.cs index dbab56b0..1b25ee5e 100644 --- a/Dynamic/Actions/Calls/ParamsDictArgBuilder.cs +++ b/Dynamic/Actions/Calls/ParamsDictArgBuilder.cs @@ -9,11 +9,11 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// /// Builds the parameter for a params dictionary argument - this collects all the extra name/value @@ -24,7 +24,7 @@ internal sealed class ParamsDictArgBuilder : ArgBuilder { private readonly int[] _nameIndexes; private readonly int _argIndex; - public ParamsDictArgBuilder(ParameterInfo info, int argIndex, string[] names, int[] nameIndexes) + public ParamsDictArgBuilder(ParameterInfo info, int argIndex, string[] names, int[] nameIndexes) : base(info) { Assert.NotNull(info, names, nameIndexes); diff --git a/Dynamic/Actions/Calls/ReferenceArgBuilder.cs b/Dynamic/Actions/Calls/ReferenceArgBuilder.cs index bc887c84..8f101951 100644 --- a/Dynamic/Actions/Calls/ReferenceArgBuilder.cs +++ b/Dynamic/Actions/Calls/ReferenceArgBuilder.cs @@ -8,11 +8,11 @@ using System.Reflection; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; -using RuntimeHelpers = Microsoft.Scripting.Runtime.ScriptingRuntimeHelpers; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; +using RuntimeHelpers = Riverside.Scripting.Runtime.ScriptingRuntimeHelpers; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// /// An argument that the user wants to explicitly pass by-reference (with copy-in copy-out semantics). diff --git a/Dynamic/Actions/Calls/RestrictedArguments.cs b/Dynamic/Actions/Calls/RestrictedArguments.cs index 14930465..f89c0f0c 100644 --- a/Dynamic/Actions/Calls/RestrictedArguments.cs +++ b/Dynamic/Actions/Calls/RestrictedArguments.cs @@ -8,9 +8,9 @@ using System.Diagnostics; using System.Dynamic; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { public sealed class RestrictedArguments { private readonly DynamicMetaObject[] _objects; private readonly Type[] _types; diff --git a/Dynamic/Actions/Calls/ReturnBuilder.cs b/Dynamic/Actions/Calls/ReturnBuilder.cs index ac97a85e..cbaf4ec7 100644 --- a/Dynamic/Actions/Calls/ReturnBuilder.cs +++ b/Dynamic/Actions/Calls/ReturnBuilder.cs @@ -7,7 +7,7 @@ using System.Diagnostics; using System.Linq.Expressions; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { internal class ReturnBuilder { /// diff --git a/Dynamic/Actions/Calls/ReturnReferenceArgBuilder.cs b/Dynamic/Actions/Calls/ReturnReferenceArgBuilder.cs index ba7f657b..32bfd6f7 100644 --- a/Dynamic/Actions/Calls/ReturnReferenceArgBuilder.cs +++ b/Dynamic/Actions/Calls/ReturnReferenceArgBuilder.cs @@ -5,7 +5,7 @@ using System.Linq.Expressions; using System.Reflection; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// /// Builds a parameter for a reference argument when a StrongBox has not been provided. The diff --git a/Dynamic/Actions/Calls/SimpleArgBuilder.cs b/Dynamic/Actions/Calls/SimpleArgBuilder.cs index f547bd3a..d0d81e9a 100644 --- a/Dynamic/Actions/Calls/SimpleArgBuilder.cs +++ b/Dynamic/Actions/Calls/SimpleArgBuilder.cs @@ -7,9 +7,9 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { /// /// SimpleArgBuilder produces the value produced by the user as the argument value. It /// also tracks information about the original parameter and is used to create extended @@ -32,7 +32,7 @@ public SimpleArgBuilder(Type parameterType, int index, bool isParams, bool isPar public SimpleArgBuilder(ParameterInfo info, int index) : this(info, info.ParameterType, index, info.IsParamArray(), info.IsParamDictionary()) { } - + public SimpleArgBuilder(ParameterInfo info, Type parameterType, int index, bool isParams, bool isParamsDict) : base(info) { ContractUtils.Requires(index >= 0); @@ -67,7 +67,7 @@ protected internal override Expression ToExpression(OverloadResolver resolver, R Debug.Assert(hasBeenUsed.Length == args.Length); Debug.Assert(Index < args.Length); Debug.Assert(!hasBeenUsed[Index]); - + hasBeenUsed[Index] = true; return resolver.Convert(args.GetObject(Index), args.GetType(Index), ParameterInfo, _parameterType); } diff --git a/Dynamic/Actions/Calls/TypeInferer.cs b/Dynamic/Actions/Calls/TypeInferer.cs index 2e5f9ec7..e1c59eca 100644 --- a/Dynamic/Actions/Calls/TypeInferer.cs +++ b/Dynamic/Actions/Calls/TypeInferer.cs @@ -9,11 +9,11 @@ using System.Reflection; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions.Calls { +namespace Riverside.Scripting.Actions.Calls { public static class TypeInferer { private static ArgumentInputs EnsureInputs(Dictionary dict, Type type) { if (!dict.TryGetValue(type, out ArgumentInputs res)) { @@ -61,7 +61,7 @@ internal static MethodCandidate InferGenericMethod(ApplicableCandidate/*!*/ cand // not all types we're inferred return null; } - + OverloadInfo newMethod = target.MakeGenericMethod(genArgs); List newWrappers = CreateNewWrappers(candidate.Method, newMethod, target); @@ -228,9 +228,9 @@ private static bool IsDependentConstraint(Dictionary> dependenc /// Builds a mapping based upon generic parameter constraints between related generic /// parameters. This is then used to sort the generic parameters so that we can process /// the least dependent parameters first. For example given the method: - /// - /// void Foo{T0, T1}(T0 x, T1 y) where T0 : T1 - /// + /// + /// void Foo{T0, T1}(T0 x, T1 y) where T0 : T1 + /// /// We need to first infer the type information for T1 before we infer the type information /// for T0 so that we can ensure the constraints are correct. /// @@ -309,12 +309,12 @@ private static void AddOneInput(Dictionary inputs, Dynamic /// Walks the nested generic hierarchy to construct all of the generic parameters referred /// to by this type. For example if getting the generic parameters for the x parameter on /// the method: - /// + /// /// void Foo{T0, T1}(Dictionary{T0, T1} x); - /// + /// /// We would add both typeof(T0) and typeof(T1) to the list of generic arguments. /// - private static void CollectGenericParameters(Type type, List containedGenArgs) { + private static void CollectGenericParameters(Type type, List containedGenArgs) { if (type.IsGenericParameter) { if (!containedGenArgs.Contains(type)) { containedGenArgs.Add(type); @@ -335,9 +335,9 @@ private static void CollectGenericParameters(Type type, List containedGenA /// /// Maps a single type parameter to the possible parameters and DynamicMetaObjects /// we can get inference from. For example for the signature: - /// + /// /// void Foo{T0, T1}(T0 x, T1 y, IList{T1} z); - /// + /// /// We would have one ArgumentInput for T0 which holds onto the DMO providing the argument /// value for x. We would also have one ArgumentInput for T1 which holds onto the 2 DMOs /// for y and z. Associated with y would be a GenericParameterInferer and associated with @@ -388,7 +388,7 @@ public Type GetBestType(OverloadResolver/*!*/ resolver, Dictionary/* /// Provides generic type inference for a single parameter. /// /// - /// For example: + /// For example: /// M{T}(T x) /// M{T}(IList{T} x) /// M{T}(ref T x) @@ -425,7 +425,7 @@ internal static Type GetInferedType(OverloadResolver/*!*/ resolver, Type/*!*/ ge /// Provides generic type inference for a single parameter. /// /// - /// For example: + /// For example: /// M{T}(T x) /// M{T}(IList{T} x) /// M{T}(ref T x) @@ -470,7 +470,7 @@ public static Type GetInferedType(Type/*!*/ genericParameter, Type/*!*/ paramete } argType = argType.BaseType; } - + return null; } @@ -500,7 +500,7 @@ private static Type GetInferedTypeForInterface(Type/*!*/ genericParameter, Type/ /// /// Checks if the constraints are violated by the given input for the specified generic method parameter. - /// + /// /// This method must be supplied with a mapping for any dependent generic method type parameters which /// this one can be constrained to. For example for the signature "void Foo{T0, T1}(T0 x, T1 y) where T0 : T1". /// we cannot know if the constraints are violated unless we know what we have calculated T1 to be. @@ -516,7 +516,7 @@ private static Type MatchGenericParameter(Type genericParameter, Type closedType /// /// Finds all occurences of genericParameter in openType and the corresponding concrete types in closedType. - /// Returns true iff all occurences of the generic parameter in the open type correspond to the same concrete type in the closed type + /// Returns true iff all occurences of the generic parameter in the open type correspond to the same concrete type in the closed type /// and this type satisfies given constraints. Returns the concrete type in match if so. /// private static bool MatchGenericParameter(Type genericParameter, Type closedType, Type openType, Dictionary binding, ref Type match) { diff --git a/Dynamic/Actions/ComboActionRewriter.cs b/Dynamic/Actions/ComboActionRewriter.cs index adc916cd..3667df9b 100644 --- a/Dynamic/Actions/ComboActionRewriter.cs +++ b/Dynamic/Actions/ComboActionRewriter.cs @@ -9,7 +9,7 @@ using System.Linq.Expressions; using System.Reflection; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// A tree rewriter which will find dynamic sites which consume dynamic sites and /// turn them into a single combo dynamic site. The combo dynamic site will then run the @@ -118,7 +118,7 @@ protected override Expression VisitDynamic(DynamicExpression node) { inputs.Add(rewritten); } else { // this argument is doing something we don't understand - we have to leave - // it as is (an input we consume) and all the remaining arguments need to be + // it as is (an input we consume) and all the remaining arguments need to be // evaluated normally as this could have side effects on them. foundSideEffectingArgs = true; myInfo.Add(ParameterMappingInfo.Parameter(inputs.Count)); diff --git a/Dynamic/Actions/ComboBinder.cs b/Dynamic/Actions/ComboBinder.cs index 2af1a56d..58f7b37f 100644 --- a/Dynamic/Actions/ComboBinder.cs +++ b/Dynamic/Actions/ComboBinder.cs @@ -9,9 +9,9 @@ using System.Runtime.CompilerServices; using System.Text; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// A binder which can combine multiple binders into a single dynamic site. The creator /// of this needs to perform the mapping of parameters, constants, and sub-site expressions @@ -52,7 +52,7 @@ public override DynamicMetaObject Bind(DynamicMetaObject target, params DynamicM restrictions = restrictions.Merge(next.Restrictions); if (next.Expression.NodeType == ExpressionType.Throw) { - // end of the line... the expression is throwing, none of the other + // end of the line... the expression is throwing, none of the other // binders will have an opportunity to run. steps.Add(next.Expression); break; diff --git a/Dynamic/Actions/ConditionalBuilder.cs b/Dynamic/Actions/ConditionalBuilder.cs index 9cfefcec..5665a1ac 100644 --- a/Dynamic/Actions/ConditionalBuilder.cs +++ b/Dynamic/Actions/ConditionalBuilder.cs @@ -7,10 +7,10 @@ using System.Dynamic; using System.Linq.Expressions; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// Builds up a series of conditionals when the False clause isn't yet known. We can diff --git a/Dynamic/Actions/ConstructorTracker.cs b/Dynamic/Actions/ConstructorTracker.cs index 83db6bb2..c9315b89 100644 --- a/Dynamic/Actions/ConstructorTracker.cs +++ b/Dynamic/Actions/ConstructorTracker.cs @@ -5,7 +5,7 @@ using System; using System.Reflection; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public class ConstructorTracker : MemberTracker { private readonly ConstructorInfo _ctor; diff --git a/Dynamic/Actions/ConversionResultKind.cs b/Dynamic/Actions/ConversionResultKind.cs index fc383580..376182d4 100644 --- a/Dynamic/Actions/ConversionResultKind.cs +++ b/Dynamic/Actions/ConversionResultKind.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// Determines the result of a conversion action. The result can either result in an exception, a value that /// has been successfully converted or default(T), or a true/false result indicating if the value can be converted. @@ -18,7 +18,7 @@ public enum ConversionResultKind { ExplicitCast, /// /// Attempts to perform available implicit conversions and returns default(ReturnType) if no conversions can be performed. - /// + /// /// If the return type of the rule is a value type then the return value will be zero-initialized. If the return type /// of the rule is object or another class then the return type will be null (even if the conversion is to a value type). /// This enables ImplicitTry to be used to do TryConvertTo even if the type is value type (and the difference between @@ -26,9 +26,9 @@ public enum ConversionResultKind { /// ImplicitTry, /// - /// Attempts to perform available implicit and explicit conversions and returns default(ReturnType) if no conversions + /// Attempts to perform available implicit and explicit conversions and returns default(ReturnType) if no conversions /// can be performed. - /// + /// /// If the return type of the rule is a value type then the return value will be zero-initialized. If the return type /// of the rule is object or another class then the return type will be null (even if the conversion is to a value type). /// This enables ExplicitTry to be used to do TryConvertTo even if the type is value type (and the difference between diff --git a/Dynamic/Actions/CustomTracker.cs b/Dynamic/Actions/CustomTracker.cs index 8e4d5eb4..0a659c3a 100644 --- a/Dynamic/Actions/CustomTracker.cs +++ b/Dynamic/Actions/CustomTracker.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// A custom member tracker which enables languages to plug in arbitrary /// members into the lookup process. diff --git a/Dynamic/Actions/DefaultBinder.Conversions.cs b/Dynamic/Actions/DefaultBinder.Conversions.cs index 418f3a67..d1ff5f30 100644 --- a/Dynamic/Actions/DefaultBinder.Conversions.cs +++ b/Dynamic/Actions/DefaultBinder.Conversions.cs @@ -8,13 +8,13 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Actions.Calls; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Actions.Calls; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public partial class DefaultBinder : ActionBinder { public DynamicMetaObject ConvertTo(Type toType, ConversionResultKind kind, DynamicMetaObject arg) { @@ -30,11 +30,11 @@ public DynamicMetaObject ConvertTo(Type toType, ConversionResultKind kind, Dynam ContractUtils.RequiresNotNull(arg, nameof(arg)); // try all the conversions - first look for conversions against the expression type, - // these can be done w/o any additional tests. Then look for conversions against the + // these can be done w/o any additional tests. Then look for conversions against the // restricted type. BindingRestrictions typeRestrictions = arg.Restrictions.Merge(BindingRestrictionsHelpers.GetRuntimeTypeRestriction(arg.Expression, arg.GetLimitType())); - DynamicMetaObject res = + DynamicMetaObject res = TryConvertToObject(toType, arg.Expression.Type, arg, typeRestrictions) ?? TryAllConversions(resolverFactory, toType, kind, arg.Expression.Type, typeRestrictions, arg) ?? TryAllConversions(resolverFactory, toType, kind, arg.GetLimitType(), typeRestrictions, arg) ?? @@ -133,7 +133,7 @@ private DynamicMetaObject TryOneConversion(ConversionResultKind kind, Type toTyp } /// - /// Checks if any of the members of the MemberGroup provide the applicable conversion and + /// Checks if any of the members of the MemberGroup provide the applicable conversion and /// if so uses it to build a conversion rule. /// private static DynamicMetaObject TryUserDefinedConversion(ConversionResultKind kind, Type toType, Type type, MemberGroup conversions, bool isImplicit, BindingRestrictions restrictions, DynamicMetaObject arg) { @@ -345,15 +345,15 @@ private static DynamicMetaObject MakeSimpleConversionTarget(Type toType, Binding /* if (toType.IsValueType && _rule.ReturnType == typeof(object) && Expression.Type == typeof(object)) { - // boxed value type is being converted back to object. We've done - // the type check, there's no need to unbox & rebox the value. infact + // boxed value type is being converted back to object. We've done + // the type check, there's no need to unbox & rebox the value. infact // it breaks calls on instance methods so we need to avoid it. _rule.Target = _rule.MakeReturn( Binder, Expression ); - } + } * */ } @@ -477,9 +477,9 @@ private static Expression GetExtensibleValue(Type extType, DynamicMetaObject arg } /// - /// Helper that checks if fromType is an Extensible of T or a subtype of + /// Helper that checks if fromType is an Extensible of T or a subtype of /// Extensible of T and if so returns the T. Otherwise it returns fromType. - /// + /// /// This is used to treat extensible types the same as their underlying types. /// private static Type GetUnderlyingType(Type fromType) { diff --git a/Dynamic/Actions/DefaultBinder.DeleteMember.cs b/Dynamic/Actions/DefaultBinder.DeleteMember.cs index 5139f30b..f6c8e5e9 100644 --- a/Dynamic/Actions/DefaultBinder.DeleteMember.cs +++ b/Dynamic/Actions/DefaultBinder.DeleteMember.cs @@ -6,13 +6,13 @@ using System.Dynamic; using System.Reflection; -using Microsoft.Scripting.Actions.Calls; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Actions.Calls; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public partial class DefaultBinder : ActionBinder { public DynamicMetaObject DeleteMember(string name, DynamicMetaObject target) { @@ -85,7 +85,7 @@ private static Type GetDeclaringMemberType(MemberGroup group) { private void MakePropertyDeleteStatement(SetOrDeleteMemberInfo delInfo, DynamicMetaObject instance, MethodInfo delete) { delInfo.Body.FinishCondition( - instance == null ? + instance == null ? MakeCallExpression(delInfo.ResolutionFactory, delete) : MakeCallExpression(delInfo.ResolutionFactory, delete, instance) ); diff --git a/Dynamic/Actions/DefaultBinder.GetMember.cs b/Dynamic/Actions/DefaultBinder.GetMember.cs index 0a5d3ace..a066ad42 100644 --- a/Dynamic/Actions/DefaultBinder.GetMember.cs +++ b/Dynamic/Actions/DefaultBinder.GetMember.cs @@ -9,16 +9,16 @@ using System.Reflection; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Actions.Calls; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Actions.Calls; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public partial class DefaultBinder : ActionBinder { /// - /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod + /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod /// GetBoundMember, and StrongBox instances. /// /// @@ -30,7 +30,7 @@ public partial class DefaultBinder : ActionBinder { /// /// /// Returns a DynamicMetaObject which represents the value that will be returned when the member is accessed. - /// + /// /// The returned DynamicMetaObject may be strongly typed to a value type which needs boxing before being /// returned from a standard DLR GetMemberBinder. The language is responsible for performing any boxing /// so that it has an opportunity to perform custom boxing. @@ -46,7 +46,7 @@ public DynamicMetaObject GetMember(string name, DynamicMetaObject target) { } /// - /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod + /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod /// GetBoundMember, and StrongBox instances. /// /// @@ -61,7 +61,7 @@ public DynamicMetaObject GetMember(string name, DynamicMetaObject target) { /// /// /// Returns a DynamicMetaObject which represents the value that will be returned when the member is accessed. - /// + /// /// The returned DynamicMetaObject may be strongly typed to a value type which needs boxing before being /// returned from a standard DLR GetMemberBinder. The language is responsible for performing any boxing /// so that it has an opportunity to perform custom boxing. @@ -77,7 +77,7 @@ public DynamicMetaObject GetMember(string name, DynamicMetaObject target, Overlo } /// - /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod + /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod /// GetBoundMember, and StrongBox instances. /// /// @@ -99,7 +99,7 @@ public DynamicMetaObject GetMember(string name, DynamicMetaObject target, Overlo /// /// /// Returns a DynamicMetaObject which represents the value that will be returned when the member is accessed. - /// + /// /// The returned DynamicMetaObject may be strongly typed to a value type which needs boxing before being /// returned from a standard DLR GetMemberBinder. The language is responsible for performing any boxing /// so that it has an opportunity to perform custom boxing. @@ -121,7 +121,7 @@ public DynamicMetaObject GetMember(string name, DynamicMetaObject target, Overlo } /// - /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod + /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod /// GetBoundMember, and StrongBox instances. /// /// @@ -140,7 +140,7 @@ public DynamicMetaObject GetMember(string name, DynamicMetaObject target, Overlo /// /// /// Returns a DynamicMetaObject which represents the value that will be returned when the member is accessed. - /// + /// /// The returned DynamicMetaObject may be strongly typed to a value type which needs boxing before being /// returned from a standard DLR GetMemberBinder. The language is responsible for performing any boxing /// so that it has an opportunity to perform custom boxing. @@ -166,7 +166,7 @@ private DynamicMetaObject MakeGetMemberTarget(GetMemberInfo getMemInfo, DynamicM DynamicMetaObject self = target; target = target.Restrict(target.GetLimitType()); - // Specially recognized types: TypeTracker, NamespaceTracker, and StrongBox. + // Specially recognized types: TypeTracker, NamespaceTracker, and StrongBox. // TODO: TypeTracker and NamespaceTracker should technically be IDO's. MemberGroup members = MemberGroup.EmptyGroup; if (typeof(TypeTracker).IsAssignableFrom(targetType)) { @@ -253,7 +253,7 @@ private void MakeSuccessfulMemberAccess(GetMemberInfo getMemInfo, DynamicMetaObj MakeTypeBody(getMemInfo, selfType, members); break; case TrackerTypes.Method: - // turn into a MethodGroup + // turn into a MethodGroup MakeGenericBodyWorker(getMemInfo, selfType, ReflectionCache.GetMethodGroup(getMemInfo.Name, members), self); break; case TrackerTypes.Event: @@ -279,7 +279,7 @@ private void MakeSuccessfulMemberAccess(GetMemberInfo getMemInfo, DynamicMetaObj private void MakeGenericBody(GetMemberInfo getMemInfo, Type instanceType, MemberGroup members, DynamicMetaObject instance) { MemberTracker bestMember = members[0]; if (members.Count > 1) { - // if we were given multiple members pick the member closest to the type... + // if we were given multiple members pick the member closest to the type... Type bestMemberDeclaringType = members[0].DeclaringType; for (int i = 1; i < members.Count; i++) { diff --git a/Dynamic/Actions/DefaultBinder.Invoke.cs b/Dynamic/Actions/DefaultBinder.Invoke.cs index e8966fc4..7dad711e 100644 --- a/Dynamic/Actions/DefaultBinder.Invoke.cs +++ b/Dynamic/Actions/DefaultBinder.Invoke.cs @@ -9,13 +9,13 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Actions.Calls; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Actions.Calls; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public partial class DefaultBinder : ActionBinder { // TODO: Rename Call to Invoke, obsolete Call @@ -33,7 +33,7 @@ public partial class DefaultBinder : ActionBinder { public DynamicMetaObject Call(CallSignature signature, DynamicMetaObject target, params DynamicMetaObject[] args) { return Call(signature, new DefaultOverloadResolverFactory(this), target, args); } - + /// /// Provides default binding for performing a call on the specified meta objects. /// @@ -108,8 +108,8 @@ private DynamicMetaObject MakeMetaMethodCall(CallSignature signature, OverloadRe #region Target acquisition /// - /// Gets a TargetInfo object for performing a call on this object. - /// + /// Gets a TargetInfo object for performing a call on this object. + /// /// If this object is a delegate we bind to the Invoke method. /// If this object is a MemberGroup or MethodGroup we bind to the methods in the member group. /// If this object is a BoundMemberTracker we bind to the methods with the bound instance. @@ -143,8 +143,8 @@ private static TargetInfo TryGetMethodGroupTargets(DynamicMetaObject target, Dyn } /// - /// Binds to the methods in a member group. - /// + /// Binds to the methods in a member group. + /// /// TODO: We should really only have either MemberGroup or MethodGroup, not both. /// private static TargetInfo TryGetMemberGroupTargets(DynamicMetaObject target, DynamicMetaObject[] args, MemberGroup mg) { diff --git a/Dynamic/Actions/DefaultBinder.MethodCalls.cs b/Dynamic/Actions/DefaultBinder.MethodCalls.cs index 2edd09fb..9a270214 100644 --- a/Dynamic/Actions/DefaultBinder.MethodCalls.cs +++ b/Dynamic/Actions/DefaultBinder.MethodCalls.cs @@ -10,13 +10,13 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Actions.Calls; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Actions.Calls; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public partial class DefaultBinder : ActionBinder { @@ -95,7 +95,7 @@ out BindingTarget _ /// The resulting binding target which can be used for producing error information. /// The name of the method or null to use the name from targets. /// A meta object which results from the call. - public DynamicMetaObject CallMethod(DefaultOverloadResolver resolver, IList targets, BindingRestrictions restrictions, string name, + public DynamicMetaObject CallMethod(DefaultOverloadResolver resolver, IList targets, BindingRestrictions restrictions, string name, NarrowingLevel minLevel, NarrowingLevel maxLevel, out BindingTarget target) { ContractUtils.RequiresNotNull(resolver, nameof(resolver)); ContractUtils.RequiresNotNullItems(targets, nameof(targets)); @@ -126,7 +126,7 @@ internal static string GetTargetName(IList targets) { // TODO: revisit private DynamicMetaObject MakeInvalidParametersRule(DefaultOverloadResolver binder, BindingRestrictions restrictions, BindingTarget bt) { var args = binder.Arguments; - + BindingRestrictions restriction = MakeSplatTests(binder.CallType, binder.Signature, true, args); // restrict to the exact type of all parameters for errors diff --git a/Dynamic/Actions/DefaultBinder.Operations.cs b/Dynamic/Actions/DefaultBinder.Operations.cs index e401d329..2320035b 100644 --- a/Dynamic/Actions/DefaultBinder.Operations.cs +++ b/Dynamic/Actions/DefaultBinder.Operations.cs @@ -11,17 +11,17 @@ using System.Reflection; using System.Text; -using Microsoft.Scripting.Actions.Calls; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Actions.Calls; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public partial class DefaultBinder : ActionBinder { [Obsolete("You should use the overload which takes ExpressionType instead")] - public DynamicMetaObject DoOperation(string operation, params DynamicMetaObject[] args) { + public DynamicMetaObject DoOperation(string operation, params DynamicMetaObject[] args) { return DoOperation(operation, new DefaultOverloadResolverFactory(this), args); } @@ -112,10 +112,10 @@ public DynamicMetaObject GetCallSignatures(DynamicMetaObject target) { public DynamicMetaObject GetIsCallable(DynamicMetaObject target) { // IsCallable() is tightly tied to Call actions. So in general, we need the call-action providers to also - // provide IsCallable() status. + // provide IsCallable() status. // This is just a rough fallback. We could also attempt to simulate the default CallBinder logic to see - // if there are any applicable calls targets, but that would be complex (the callbinder wants the argument list, - // which we don't have here), and still not correct. + // if there are any applicable calls targets, but that would be complex (the callbinder wants the argument list, + // which we don't have here), and still not correct. BindingRestrictions restrictions = BindingRestrictions.GetTypeRestriction(target.Expression, target.LimitType); bool callable = false; @@ -173,7 +173,7 @@ private DynamicMetaObject MakeComparisonRule(OperatorInfo info, OverloadResolver TryInvertedComparison(info, resolverFactory, args[0], args) ?? // inverted binding on the 2nd type TryNullComparisonRule(args) ?? // see if we're comparing to null w/ an object ref or a Nullable TryPrimitiveCompare(info, args) ?? // see if this is a primitive type where we're comparing the two values. - MakeOperatorError(info, args); // no comparisons are possible + MakeOperatorError(info, args); // no comparisons are possible } private DynamicMetaObject TryComparisonMethod(OperatorInfo info, OverloadResolverFactory resolverFactory, DynamicMetaObject target, DynamicMetaObject[] args) { @@ -236,7 +236,7 @@ private DynamicMetaObject TryInvertedComparison(OperatorInfo info, OverloadResol OperatorInfo revInfo = OperatorInfo.GetOperatorInfo(revOp); Debug.Assert(revInfo != null); - // try the 1st type's opposite function result negated + // try the 1st type's opposite function result negated MethodBase[] targets = GetApplicableMembers(target.GetLimitType(), revInfo); if (targets.Length > 0) { return TryMakeInvertedBindingTarget(resolverFactory, targets, args); @@ -529,7 +529,7 @@ private MethodInfo[] GetMethodsFromDefaults(IEnumerable defaults, In if (pi != null) { if (op == IndexType.Get) { - MethodInfo method = pi.GetGetMethod(PrivateBinding); + MethodInfo method = pi.GetGetMethod(PrivateBinding); if (method != null) methods.Add(method); } else if (op == IndexType.Set) { MethodInfo method = pi.GetSetMethod(PrivateBinding); @@ -618,7 +618,7 @@ private MethodInfo[] GetApplicableMembers(Type t, OperatorInfo info) { // filter down to just methods return FilterNonMethods(t, members); } - + private static MethodInfo[] FilterNonMethods(Type t, MemberGroup members) { Assert.NotNull(t, members); diff --git a/Dynamic/Actions/DefaultBinder.SetMember.cs b/Dynamic/Actions/DefaultBinder.SetMember.cs index 018ec904..356bcaeb 100644 --- a/Dynamic/Actions/DefaultBinder.SetMember.cs +++ b/Dynamic/Actions/DefaultBinder.SetMember.cs @@ -10,17 +10,17 @@ using System.Reflection; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Actions.Calls; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Actions.Calls; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public partial class DefaultBinder : ActionBinder { /// - /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod + /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod /// GetBoundMember, and StrongBox instances. /// /// @@ -36,9 +36,9 @@ public partial class DefaultBinder : ActionBinder { public DynamicMetaObject SetMember(string name, DynamicMetaObject target, DynamicMetaObject value) { return SetMember(name, target, value, new DefaultOverloadResolverFactory(this)); } - + /// - /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod + /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod /// GetBoundMember, and StrongBox instances. /// /// @@ -69,7 +69,7 @@ public DynamicMetaObject SetMember(string name, DynamicMetaObject target, Dynami } /// - /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod + /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod /// GetBoundMember, and StrongBox instances. /// /// @@ -89,9 +89,9 @@ public DynamicMetaObject SetMember(string name, DynamicMetaObject target, Dynami public DynamicMetaObject SetMember(string name, DynamicMetaObject target, DynamicMetaObject value, DynamicMetaObject errorSuggestion) { return SetMember(name, target, value, errorSuggestion, new DefaultOverloadResolverFactory(this)); } - + /// - /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod + /// Builds a MetaObject for performing a member get. Supports all built-in .NET members, the OperatorMethod /// GetBoundMember, and StrongBox instances. /// /// @@ -128,7 +128,7 @@ public DynamicMetaObject SetMember(string name, DynamicMetaObject target, Dynami private DynamicMetaObject MakeSetMemberTarget(SetOrDeleteMemberInfo memInfo, DynamicMetaObject target, DynamicMetaObject value, DynamicMetaObject errorSuggestion) { Type type = target.GetLimitType(); DynamicMetaObject self = target; - + target = target.Restrict(target.GetLimitType()); memInfo.Body.Restrictions = target.Restrictions; @@ -252,14 +252,14 @@ private void MakePropertyRule(SetOrDeleteMemberInfo memInfo, DynamicMetaObject i true, instance, target - ), + ), typeof(object) ) ); } else if (info.IsStatic && info.DeclaringType != targetType) { memInfo.Body.FinishError( errorSuggestion ?? MakeError( - MakeStaticAssignFromDerivedTypeError(targetType, instance, info, target, memInfo.ResolutionFactory), + MakeStaticAssignFromDerivedTypeError(targetType, instance, info, target, memInfo.ResolutionFactory), typeof(object) ) ); @@ -345,14 +345,14 @@ private void MakeFieldRule(SetOrDeleteMemberInfo memInfo, DynamicMetaObject inst } else if (field.IsInitOnly || field.IsLiteral) { memInfo.Body.FinishError( errorSuggestion ?? MakeError( - MakeReadOnlyMemberError(targetType, memInfo.Name), + MakeReadOnlyMemberError(targetType, memInfo.Name), typeof(object) ) ); } else if (field.IsStatic && targetType != field.DeclaringType) { memInfo.Body.FinishError( errorSuggestion ?? MakeError( - MakeStaticAssignFromDerivedTypeError(targetType, instance, field, target, memInfo.ResolutionFactory), + MakeStaticAssignFromDerivedTypeError(targetType, instance, field, target, memInfo.ResolutionFactory), typeof(object) ) ); @@ -436,8 +436,8 @@ private bool MakeOperatorSetMemberBody(SetOrDeleteMemberInfo memInfo, DynamicMet memInfo.Body.AddVariable(tmp); var callMo = MakeCallExpression( - memInfo.ResolutionFactory, - setMem, + memInfo.ResolutionFactory, + setMem, self.Clone(AstUtils.Convert(self.Expression, type)), new DynamicMetaObject(AstUtils.Constant(memInfo.Name), BindingRestrictions.Empty, memInfo.Name), target.Clone(tmp) diff --git a/Dynamic/Actions/DefaultBinder.cs b/Dynamic/Actions/DefaultBinder.cs index a1fc9e90..ab57d41a 100644 --- a/Dynamic/Actions/DefaultBinder.cs +++ b/Dynamic/Actions/DefaultBinder.cs @@ -9,16 +9,16 @@ using System.Reflection; using System.Text; -using Microsoft.Scripting.Actions.Calls; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Actions.Calls; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// Provides binding semantics for a language. This include conversions as well as support - /// for producing rules for actions. These optimized rules are used for calling methods, + /// for producing rules for actions. These optimized rules are used for calling methods, /// performing operators, and getting members using the ActionBinder's conversion semantics. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] @@ -43,7 +43,7 @@ public virtual ErrorInfo MakeUndeletableMemberError(Type type, string name) { /// /// Called when the user is accessing a protected or private member on a get. - /// + /// /// The default implementation allows access to the fields or properties using reflection. /// public virtual ErrorInfo MakeNonPublicMemberGetError(OverloadResolverFactory resolverFactory, MemberTracker member, Type type, DynamicMetaObject instance) { @@ -177,10 +177,10 @@ public MethodInfo GetMethod(Type type, string name) { return null; } - + private static MethodInfo GetSpecialNameMethod(Type type, string name) { MethodInfo res = null; - + foreach (MethodInfo candidate in type.GetInheritedMethods(name).WithBindingFlags(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static)) { if (candidate.IsSpecialName) { if (object.ReferenceEquals(res, null)) { @@ -193,7 +193,7 @@ private static MethodInfo GetSpecialNameMethod(Type type, string name) { return res; } - + private static Exception AmbiguousMatch(Type type, string name) { throw new AmbiguousMatchException( $"Found multiple SpecialName methods for {name} on type {type}" diff --git a/Dynamic/Actions/DynamicSiteHelper.cs b/Dynamic/Actions/DynamicSiteHelper.cs index cfcd96b9..09ce2d9a 100644 --- a/Dynamic/Actions/DynamicSiteHelper.cs +++ b/Dynamic/Actions/DynamicSiteHelper.cs @@ -9,10 +9,10 @@ using System.Runtime.CompilerServices; using System.Threading; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { // TODO: replace this class with calls to Expression.GetDelegateType public static class DynamicSiteHelpers { @@ -202,10 +202,10 @@ public static bool IsInvisibleDlrStackFrame(MethodBase mb) { return true; } - //Filters out methods in Microsoft.Scripting namespaces. - if (mb.DeclaringType != null && + //Filters out methods in Riverside.Scripting namespaces. + if (mb.DeclaringType != null && mb.DeclaringType.Namespace != null && - mb.DeclaringType.Namespace.StartsWith("Microsoft.Scripting", StringComparison.Ordinal)) { + mb.DeclaringType.Namespace.StartsWith("Riverside.Scripting", StringComparison.Ordinal)) { return true; } diff --git a/Dynamic/Actions/ErrorInfo.cs b/Dynamic/Actions/ErrorInfo.cs index 0e1671b5..d7ef1f9c 100644 --- a/Dynamic/Actions/ErrorInfo.cs +++ b/Dynamic/Actions/ErrorInfo.cs @@ -6,21 +6,21 @@ using System.Diagnostics; using System.Linq.Expressions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// - /// Encapsulates information about the result that should be produced when + /// Encapsulates information about the result that should be produced when /// a OldDynamicAction cannot be performed. The ErrorInfo can hold one of: - /// an expression which creates an Exception to be thrown - /// an expression which produces a value which should be returned + /// an expression which creates an Exception to be thrown + /// an expression which produces a value which should be returned /// directly to the user and represents an error has occured (for /// example undefined in JavaScript) /// an expression which produces a value which should be returned /// directly to the user but does not actually represent an error. - /// + /// /// ErrorInfo's are produced by an ActionBinder in response to a failed - /// binding. + /// binding. /// public sealed class ErrorInfo { /// diff --git a/Dynamic/Actions/ErrorMetaObject.cs b/Dynamic/Actions/ErrorMetaObject.cs index a7b7d492..b14a147d 100644 --- a/Dynamic/Actions/ErrorMetaObject.cs +++ b/Dynamic/Actions/ErrorMetaObject.cs @@ -5,7 +5,7 @@ using System.Dynamic; using System.Linq.Expressions; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// A MetaObject which was produced as the result of a failed binding. /// diff --git a/Dynamic/Actions/EventTracker.cs b/Dynamic/Actions/EventTracker.cs index f8b02a75..9e24cccb 100644 --- a/Dynamic/Actions/EventTracker.cs +++ b/Dynamic/Actions/EventTracker.cs @@ -10,18 +10,18 @@ using System.Runtime.InteropServices; using System.Threading; -using Microsoft.Scripting.Actions.Calls; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Actions.Calls; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public class EventTracker : MemberTracker { - // For each instance of the class that declares the event there is a list of pairs in a table - // (like if we added an instance field for each instance event into its declaring class). + // For each instance of the class that declares the event there is a list of pairs in a table + // (like if we added an instance field for each instance event into its declaring class). // We use _staticTarget for a static event (it is bound to its declaring type). - // Each pair in the list holds on the stub handler that was added to the event delegate chain and the callable - // object that is passed to +=/-= operators. + // Each pair in the list holds on the stub handler that was added to the event delegate chain and the callable + // object that is passed to +=/-= operators. private WeakDictionary _handlerLists; private static readonly object _staticTarget = new object(); @@ -59,8 +59,8 @@ public MethodInfo GetCallableRemoveMethod() { } /// - /// Doesn't need to check PrivateBinding setting: no method that is part of the event is public the entire event is private. - /// If the code has already a reference to the event tracker instance for a private event its "static-ness" is not influenced + /// Doesn't need to check PrivateBinding setting: no method that is part of the event is public the entire event is private. + /// If the code has already a reference to the event tracker instance for a private event its "static-ness" is not influenced /// by private-binding setting. /// public bool IsStatic { @@ -79,7 +79,7 @@ public bool IsStatic { ((m = Event.GetRaiseMethod(true)) == null || m.IsStatic == mi.IsStatic), "Methods are either all static or all instance." ); - + return mi.IsStatic; } } @@ -209,8 +209,8 @@ private HandlerList GetComHandlerList(object instance) { #endif /// - /// Holds on a list of delegates hooked to the event. - /// We need the list because we cannot enumerate the delegates hooked to CLR event and we need to do so in + /// Holds on a list of delegates hooked to the event. + /// We need the list because we cannot enumerate the delegates hooked to CLR event and we need to do so in /// handler removal (we need to do custom delegate comparison there). If BCL enables the enumeration we could remove this. /// private abstract class HandlerList { @@ -249,7 +249,7 @@ public override Delegate RemoveHandler(object callableObject, IEqualityComparer< private sealed class NormalHandlerList : HandlerList { /// /// Storage for the handlers - a key value pair of the callable object and the delegate handler. - /// + /// /// The delegate handler is closed over the callable object. Therefore as long as the object is alive the /// delegate will stay alive and so will the callable object. That means it's fine to have a weak reference /// to both of these objects. diff --git a/Dynamic/Actions/ExtensionBinaryOperationBinder.cs b/Dynamic/Actions/ExtensionBinaryOperationBinder.cs index 0d33742d..81f9abc0 100644 --- a/Dynamic/Actions/ExtensionBinaryOperationBinder.cs +++ b/Dynamic/Actions/ExtensionBinaryOperationBinder.cs @@ -5,9 +5,9 @@ using System.Dynamic; using System.Linq.Expressions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public abstract class ExtensionBinaryOperationBinder : BinaryOperationBinder { private readonly string _operation; diff --git a/Dynamic/Actions/ExtensionMethodTracker.cs b/Dynamic/Actions/ExtensionMethodTracker.cs index d1f8b85d..a82f1bcf 100644 --- a/Dynamic/Actions/ExtensionMethodTracker.cs +++ b/Dynamic/Actions/ExtensionMethodTracker.cs @@ -5,9 +5,9 @@ using System; using System.Reflection; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// Represents extension method. /// diff --git a/Dynamic/Actions/ExtensionPropertyTracker.cs b/Dynamic/Actions/ExtensionPropertyTracker.cs index d2017ae8..145350eb 100644 --- a/Dynamic/Actions/ExtensionPropertyTracker.cs +++ b/Dynamic/Actions/ExtensionPropertyTracker.cs @@ -5,16 +5,16 @@ using System; using System.Reflection; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public class ExtensionPropertyTracker : PropertyTracker { private MethodInfo _getter, _setter, _deleter; public ExtensionPropertyTracker(string name, MethodInfo getter, MethodInfo setter, MethodInfo deleter, Type declaringType) { - Name = name; - _getter = getter; + Name = name; + _getter = getter; _setter = setter; _deleter = deleter; DeclaringType = declaringType; diff --git a/Dynamic/Actions/ExtensionUnaryOperationBinder.cs b/Dynamic/Actions/ExtensionUnaryOperationBinder.cs index 654bb51d..5499db6f 100644 --- a/Dynamic/Actions/ExtensionUnaryOperationBinder.cs +++ b/Dynamic/Actions/ExtensionUnaryOperationBinder.cs @@ -5,9 +5,9 @@ using System.Dynamic; using System.Linq.Expressions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public abstract class ExtensionUnaryOperationBinder : UnaryOperationBinder { private readonly string _operation; diff --git a/Dynamic/Actions/FieldTracker.cs b/Dynamic/Actions/FieldTracker.cs index 2238c5e9..b009b9ea 100644 --- a/Dynamic/Actions/FieldTracker.cs +++ b/Dynamic/Actions/FieldTracker.cs @@ -8,11 +8,11 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Actions.Calls; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Actions.Calls; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public class FieldTracker : MemberTracker { private readonly FieldInfo _field; @@ -80,7 +80,7 @@ public override DynamicMetaObject GetValue(OverloadResolverFactory resolverFacto } public override ErrorInfo GetError(ActionBinder binder, Type instanceType) { - // FieldTracker only has one error - accessing a static field from + // FieldTracker only has one error - accessing a static field from // a generic type. Debug.Assert(Field.DeclaringType.ContainsGenericParameters); @@ -99,7 +99,7 @@ protected internal override DynamicMetaObject GetBoundValue(OverloadResolverFact AstUtils.Convert(instance.Expression, Field.DeclaringType), Field ), - typeof(object) + typeof(object) ), BindingRestrictions.Empty ); diff --git a/Dynamic/Actions/ILightExceptionBinder.cs b/Dynamic/Actions/ILightExceptionBinder.cs index 6d164a51..1e71783d 100644 --- a/Dynamic/Actions/ILightExceptionBinder.cs +++ b/Dynamic/Actions/ILightExceptionBinder.cs @@ -4,16 +4,16 @@ using System.Runtime.CompilerServices; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// Implemented by binders which support light exceptions. Dynamic objects - /// binding against a binder which implements this interface can check - /// SupportsLightThrow to see if the binder currently supports safely + /// binding against a binder which implements this interface can check + /// SupportsLightThrow to see if the binder currently supports safely /// returning a light exception. Light exceptions can be created with /// LightException.Throw. /// /// Binders also need to implement GetlightBinder. This method - /// returns a new call site binder which may return light exceptions if + /// returns a new call site binder which may return light exceptions if /// the binder supports them. /// public interface ILightExceptionBinder { diff --git a/Dynamic/Actions/Interceptor.cs b/Dynamic/Actions/Interceptor.cs index 2d0449d1..75ca426e 100644 --- a/Dynamic/Actions/Interceptor.cs +++ b/Dynamic/Actions/Interceptor.cs @@ -6,7 +6,7 @@ using System.Linq.Expressions; using System.Runtime.CompilerServices; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// Interceptor prototype. The interceptor is a call site binder that wraps /// a real call site binder and can perform arbitrary operations on the expression diff --git a/Dynamic/Actions/MemberGroup.cs b/Dynamic/Actions/MemberGroup.cs index fd941d8a..2711ef34 100644 --- a/Dynamic/Actions/MemberGroup.cs +++ b/Dynamic/Actions/MemberGroup.cs @@ -5,19 +5,19 @@ using System.Collections.Generic; using System.Reflection; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// MemberGroups are a collection of MemberTrackers which are commonly produced /// on-demand to talk about the available members. They can consist of a mix of /// different member types or multiple membes of the same type. - /// + /// /// The most common source of MemberGroups is from ActionBinder.GetMember. From here /// the DLR will perform binding to the MemberTrackers frequently producing the value /// resulted from the user. If the result of the action produces a member it's self /// the ActionBinder can provide the value exposed to the user via ReturnMemberTracker. - /// + /// /// ActionBinder provides default functionality for both getting members from a type /// as well as exposing the members to the user. Getting members from the type maps /// closely to reflection and exposing them to the user exposes the MemberTrackers diff --git a/Dynamic/Actions/MemberRequestKind.cs b/Dynamic/Actions/MemberRequestKind.cs index 12782263..b20467c4 100644 --- a/Dynamic/Actions/MemberRequestKind.cs +++ b/Dynamic/Actions/MemberRequestKind.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// Specifies the action for which the default binder is requesting a member. /// diff --git a/Dynamic/Actions/MemberTracker.cs b/Dynamic/Actions/MemberTracker.cs index a9e6ec7b..cab6d841 100644 --- a/Dynamic/Actions/MemberTracker.cs +++ b/Dynamic/Actions/MemberTracker.cs @@ -7,19 +7,19 @@ using System.Dynamic; using System.Reflection; -using Microsoft.Scripting.Actions.Calls; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Actions.Calls; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// Represents a logical member of a type. The member could either be real concrete member on a type or /// an extension member. - /// + /// /// This seperates the "physical" members that .NET knows exist on types from the members that /// logically exist on a type. It also provides other abstractions above the level of .NET reflection /// such as MemberGroups and NamespaceTracker's. - /// + /// /// It also provides a wrapper around the reflection APIs which cannot be extended from partial trust. /// public abstract class MemberTracker { @@ -29,10 +29,10 @@ public abstract class MemberTracker { private static readonly Dictionary _trackers = new Dictionary(); /// - /// We ensure we only produce one MemberTracker for each member which logically lives on the declaring type. So - /// for example if you get a member from a derived class which is declared on the base class it should be the same - /// as getting the member from the base class. That’s easy enough until you get into extension members – here there - /// might be one extension member which is being applied to multiple types. Therefore we need to take into account the + /// We ensure we only produce one MemberTracker for each member which logically lives on the declaring type. So + /// for example if you get a member from a derived class which is declared on the base class it should be the same + /// as getting the member from the base class. That�s easy enough until you get into extension members � here there + /// might be one extension member which is being applied to multiple types. Therefore we need to take into account the /// extension type when ensuring that we only have 1 MemberTracker ever created. /// class MemberKey { @@ -133,9 +133,9 @@ public static MemberTracker FromMemberInfo(MemberInfo member, Type extending) { #region Public expression builders /// - /// Gets the expression that creates the value. - /// - /// Returns null if it's an error to get the value. The caller can then call GetErrorForGet to get + /// Gets the expression that creates the value. + /// + /// Returns null if it's an error to get the value. The caller can then call GetErrorForGet to get /// the correct error Expression (or null if they should provide a default). /// public virtual DynamicMetaObject GetValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type instanceType) { @@ -144,7 +144,7 @@ public virtual DynamicMetaObject GetValue(OverloadResolverFactory resolverFactor /// /// Gets an expression that assigns a value to the left hand side. - /// + /// /// Returns null if it's an error to assign to. The caller can then call GetErrorForSet to /// get the correct error Expression (or null if a default error should be provided). /// @@ -154,7 +154,7 @@ public virtual DynamicMetaObject SetValue(OverloadResolverFactory resolverFactor /// /// Gets an expression that assigns a value to the left hand side. - /// + /// /// Returns null if it's an error to assign to. The caller can then call GetErrorForSet to /// get the correct error Expression (or null if a default error should be provided). /// @@ -164,8 +164,8 @@ public virtual DynamicMetaObject SetValue(OverloadResolverFactory resolverFactor /// /// Gets an expression that performs a call on the object using the specified arguments. - /// - /// Returns null if it's an error to perform the specific operation. The caller can then call + /// + /// Returns null if it's an error to perform the specific operation. The caller can then call /// GetErrorsForDoCall to get the correct error Expression (or null if a default error should be provided). /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Call")] // TODO: fix @@ -178,8 +178,8 @@ internal virtual DynamicMetaObject Call(OverloadResolverFactory resolverFactory, #region Public error expression builders /// - /// Returns the error associated with getting the value. - /// + /// Returns the error associated with getting the value. + /// /// A null return value indicates that the default error message should be provided by the caller. /// public virtual ErrorInfo GetError(ActionBinder binder, Type instanceType) { @@ -188,7 +188,7 @@ public virtual ErrorInfo GetError(ActionBinder binder, Type instanceType) { /// /// Returns the error associated with accessing this member via a bound instance. - /// + /// /// A null return value indicates that the default error message should be provided by the caller. /// public virtual ErrorInfo GetBoundError(ActionBinder binder, DynamicMetaObject instance, Type instanceType) { @@ -221,7 +221,7 @@ protected internal virtual DynamicMetaObject SetBoundValue(OverloadResolverFacto /// - /// Binds the member tracker to the specified instance rturning a new member tracker if binding + /// Binds the member tracker to the specified instance rturning a new member tracker if binding /// is possible. If binding is not possible the existing member tracker will be returned. For example /// binding to a static field results in returning the original MemberTracker. Binding to an instance /// field results in a new BoundMemberTracker which will get GetBoundValue/SetBoundValue to pass the diff --git a/Dynamic/Actions/MethodGroup.cs b/Dynamic/Actions/MethodGroup.cs index d9e0a963..f97f27d4 100644 --- a/Dynamic/Actions/MethodGroup.cs +++ b/Dynamic/Actions/MethodGroup.cs @@ -9,15 +9,15 @@ using System.Reflection; using System.Threading; -using Microsoft.Scripting.Actions.Calls; +using Riverside.Scripting.Actions.Calls; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// MethodGroup's represent a unique collection of method's. Typically this /// unique set is all the methods which are overloaded by the same name including /// methods with different arity. These methods represent a single logically /// overloaded element of a .NET type. - /// + /// /// The base DLR binders will produce MethodGroup's when provided with a MemberGroup /// which contains only methods. The MethodGroup's will be unique instances per /// each unique group of methods. diff --git a/Dynamic/Actions/MethodTracker.cs b/Dynamic/Actions/MethodTracker.cs index 7c289904..08031626 100644 --- a/Dynamic/Actions/MethodTracker.cs +++ b/Dynamic/Actions/MethodTracker.cs @@ -7,11 +7,11 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Actions.Calls; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Actions.Calls; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public class MethodTracker : MemberTracker { private readonly MethodInfo _method; diff --git a/Dynamic/Actions/NamespaceTracker.cs b/Dynamic/Actions/NamespaceTracker.cs index 5c76c1c0..39eb2e63 100644 --- a/Dynamic/Actions/NamespaceTracker.cs +++ b/Dynamic/Actions/NamespaceTracker.cs @@ -9,10 +9,10 @@ using System.Reflection; using System.Threading; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// NamespaceTracker represent a CLS namespace. diff --git a/Dynamic/Actions/NestedTypeTracker.cs b/Dynamic/Actions/NestedTypeTracker.cs index 9d233fe9..c53b3fb3 100644 --- a/Dynamic/Actions/NestedTypeTracker.cs +++ b/Dynamic/Actions/NestedTypeTracker.cs @@ -4,9 +4,9 @@ using System; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public class NestedTypeTracker : TypeTracker { private readonly Type _type; diff --git a/Dynamic/Actions/NoSideEffectsAttribute.cs b/Dynamic/Actions/NoSideEffectsAttribute.cs index bf592393..338ce450 100644 --- a/Dynamic/Actions/NoSideEffectsAttribute.cs +++ b/Dynamic/Actions/NoSideEffectsAttribute.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// Marks a method as not having side effects. used by the combo binder /// to allow calls to methods. diff --git a/Dynamic/Actions/OperationBinder.cs b/Dynamic/Actions/OperationBinder.cs index bd14baca..83d38ebf 100644 --- a/Dynamic/Actions/OperationBinder.cs +++ b/Dynamic/Actions/OperationBinder.cs @@ -5,9 +5,9 @@ using System; using System.Dynamic; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { [Obsolete("Use ExtensionBinaryOperationBinder or ExtensionUnaryOperationBinder")] public abstract class OperationBinder : DynamicMetaObjectBinder { diff --git a/Dynamic/Actions/OperationMetaObject.cs b/Dynamic/Actions/OperationMetaObject.cs index 9121f0f6..e376c8eb 100644 --- a/Dynamic/Actions/OperationMetaObject.cs +++ b/Dynamic/Actions/OperationMetaObject.cs @@ -6,9 +6,9 @@ using System.Dynamic; using System.Linq.Expressions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public class OperationMetaObject : DynamicMetaObject { public OperationMetaObject(Expression expression, BindingRestrictions restrictions) : base(expression, restrictions) { diff --git a/Dynamic/Actions/OperatorInfo.cs b/Dynamic/Actions/OperatorInfo.cs index f98d0178..a3f8c869 100644 --- a/Dynamic/Actions/OperatorInfo.cs +++ b/Dynamic/Actions/OperatorInfo.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq.Expressions; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// OperatorInfo provides a mapping from DLR ExpressionType to their associated .NET methods. /// @@ -85,10 +85,10 @@ private static Dictionary MakeOperatorTable() { res[ExpressionType.Or] = new OperatorInfo(ExpressionType.Or, "op_LogicalOr", "Or"); // || res[ExpressionType.LeftShift] = new OperatorInfo(ExpressionType.LeftShift, "op_LeftShift", "LeftShift"); // << res[ExpressionType.RightShift] = new OperatorInfo(ExpressionType.RightShift, "op_RightShift", "RightShift"); // >> - res[ExpressionType.Equal] = new OperatorInfo(ExpressionType.Equal, "op_Equality", "Equals"); // == + res[ExpressionType.Equal] = new OperatorInfo(ExpressionType.Equal, "op_Equality", "Equals"); // == res[ExpressionType.GreaterThan] = new OperatorInfo(ExpressionType.GreaterThan, "op_GreaterThan", "GreaterThan"); // > res[ExpressionType.LessThan] = new OperatorInfo(ExpressionType.LessThan, "op_LessThan", "LessThan"); // < - res[ExpressionType.NotEqual] = new OperatorInfo(ExpressionType.NotEqual, "op_Inequality", "NotEquals"); // != + res[ExpressionType.NotEqual] = new OperatorInfo(ExpressionType.NotEqual, "op_Inequality", "NotEquals"); // != res[ExpressionType.GreaterThanOrEqual] = new OperatorInfo(ExpressionType.GreaterThanOrEqual, "op_GreaterThanOrEqual", "GreaterThanOrEqual"); // >= res[ExpressionType.LessThanOrEqual] = new OperatorInfo(ExpressionType.LessThanOrEqual, "op_LessThanOrEqual", "LessThanOrEqual"); // <= res[ExpressionType.MultiplyAssign] = new OperatorInfo(ExpressionType.MultiplyAssign, "op_MultiplicationAssignment", "InPlaceMultiply"); // *= @@ -97,7 +97,7 @@ private static Dictionary MakeOperatorTable() { res[ExpressionType.LeftShiftAssign] = new OperatorInfo(ExpressionType.LeftShiftAssign, "op_LeftShiftAssignment", "InPlaceLeftShift"); // <<= res[ExpressionType.RightShiftAssign] = new OperatorInfo(ExpressionType.RightShiftAssign, "op_RightShiftAssignment", "InPlaceRightShift"); // >>= res[ExpressionType.ModuloAssign] = new OperatorInfo(ExpressionType.ModuloAssign, "op_ModulusAssignment", "InPlaceMod"); // %= - res[ExpressionType.AddAssign] = new OperatorInfo(ExpressionType.AddAssign, "op_AdditionAssignment", "InPlaceAdd"); // += + res[ExpressionType.AddAssign] = new OperatorInfo(ExpressionType.AddAssign, "op_AdditionAssignment", "InPlaceAdd"); // += res[ExpressionType.AndAssign] = new OperatorInfo(ExpressionType.AndAssign, "op_BitwiseAndAssignment", "InPlaceBitwiseAnd"); // &= res[ExpressionType.OrAssign] = new OperatorInfo(ExpressionType.OrAssign, "op_BitwiseOrAssignment", "InPlaceBitwiseOr"); // |= res[ExpressionType.DivideAssign] = new OperatorInfo(ExpressionType.DivideAssign, "op_DivisionAssignment", "InPlaceDivide"); // /= diff --git a/Dynamic/Actions/PropertyTracker.cs b/Dynamic/Actions/PropertyTracker.cs index 7c019462..e3b38dc1 100644 --- a/Dynamic/Actions/PropertyTracker.cs +++ b/Dynamic/Actions/PropertyTracker.cs @@ -6,15 +6,15 @@ using System.Dynamic; using System.Reflection; -using Microsoft.Scripting.Actions.Calls; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Actions.Calls; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// - /// Represents a logical Property as a member of a Type. This Property can either be a real + /// Represents a logical Property as a member of a Type. This Property can either be a real /// concrete Property on a type (implemented with a ReflectedPropertyTracker) or an extension /// property (implemented with an ExtensionPropertyTracker). /// @@ -100,7 +100,7 @@ protected internal override DynamicMetaObject GetBoundValue(OverloadResolverFact return null; } - // TODO (tomat): this used to use getter.ReflectedType, is it still correct? + // TODO (tomat): this used to use getter.ReflectedType, is it still correct? getter = CompilerHelpers.TryGetCallableMethod(instance.GetLimitType(), getter); var defaultBinder = (DefaultBinder)binder; diff --git a/Dynamic/Actions/ReflectedPropertyTracker.cs b/Dynamic/Actions/ReflectedPropertyTracker.cs index 2bb57aa5..978f8963 100644 --- a/Dynamic/Actions/ReflectedPropertyTracker.cs +++ b/Dynamic/Actions/ReflectedPropertyTracker.cs @@ -5,9 +5,9 @@ using System; using System.Reflection; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public class ReflectedPropertyTracker : PropertyTracker { private readonly PropertyInfo _propInfo; diff --git a/Dynamic/Actions/TopNamespaceTracker.cs b/Dynamic/Actions/TopNamespaceTracker.cs index 8b2e6009..363dce50 100644 --- a/Dynamic/Actions/TopNamespaceTracker.cs +++ b/Dynamic/Actions/TopNamespaceTracker.cs @@ -7,10 +7,10 @@ using System.Reflection; using System.Runtime.InteropServices; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// Represents the top reflected package which contains extra information such as /// all the assemblies loaded and the built-in modules. @@ -66,7 +66,7 @@ public MemberTracker TryGetPackageLazy(string name) { /// Ensures that the assembly is loaded /// /// - /// true if the assembly was loaded for the first time. + /// true if the assembly was loaded for the first time. /// false if the assembly had already been loaded before public bool LoadAssembly(Assembly assem) { ContractUtils.RequiresNotNull(assem, nameof(assem)); @@ -90,7 +90,7 @@ public bool LoadAssembly(Assembly assem) { /// /// When an (interop) assembly is loaded, we scan it to discover the GUIDs of COM interfaces so that we can /// associate the type definition with COM objects with that GUID. - /// Since scanning all loaded assemblies can be expensive, in the future, we might consider a more explicit + /// Since scanning all loaded assemblies can be expensive, in the future, we might consider a more explicit /// user binder to trigger scanning of COM types. /// public static void PublishComTypes(Assembly interopAssembly) { @@ -102,7 +102,7 @@ public static void PublishComTypes(Assembly interopAssembly) { if (_comTypeCache.TryGetValue(type.GUID, out Type existing)) { if (!existing.IsDefined(typeof(CoClassAttribute), false)) { // prefer the type w/ CoClassAttribute on it. Example: - // MS.Office.Interop.Excel.Worksheet + // MS.Office.Interop.Excel.Worksheet // vs // MS.Office.Interop.Excel._Worksheet // Worksheet defines all the interfaces that the type supports and has CoClassAttribute. diff --git a/Dynamic/Actions/TrackerTypes.cs b/Dynamic/Actions/TrackerTypes.cs index d65e322d..38eab415 100644 --- a/Dynamic/Actions/TrackerTypes.cs +++ b/Dynamic/Actions/TrackerTypes.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { [Flags] public enum TrackerTypes { None = 0x00, @@ -19,7 +19,7 @@ public enum TrackerTypes { /// Specifies that the member is a property, representing a PropertyTracker Property = 0x10, /// Specifies that the member is a property, representing a TypeTracker - Type = 0x20, + Type = 0x20, /// Specifies that the member is a namespace, representing a NamespaceTracker Namespace = 0x40, /// Specifies that the member is a group of method overloads, representing a MethodGroup @@ -28,7 +28,7 @@ public enum TrackerTypes { TypeGroup = 0x100, /// Specifies that the member is a custom meber, represetning a CustomTracker Custom = 0x200, - /// Specifies that the member is a bound to an instance, representing a BoundMemberTracker + /// Specifies that the member is a bound to an instance, representing a BoundMemberTracker Bound = 0x400, // // Summary: diff --git a/Dynamic/Actions/TypeGroup.cs b/Dynamic/Actions/TypeGroup.cs index 2ddf23f9..e980ac99 100644 --- a/Dynamic/Actions/TypeGroup.cs +++ b/Dynamic/Actions/TypeGroup.cs @@ -9,9 +9,9 @@ using System.Linq; using System.Text; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { /// /// A TypeCollision is used when we have a collision between /// two types with the same name. Currently this is only possible w/ generic @@ -19,10 +19,10 @@ namespace Microsoft.Scripting.Actions { /// System.EventHandler and System.EventHandler[T] /// System.Nullable and System.Nullable[T] /// System.IComparable and System.IComparable[T] - /// + /// /// The TypeCollision provides an indexer but also is a real type. When used /// as a real type it is the non-generic form of the type. - /// + /// /// The indexer allows the user to disambiguate between the generic and /// non-generic versions. Therefore users must always provide additional /// information to get the generic version. @@ -48,7 +48,7 @@ private TypeGroup(Type t1, TypeGroup existingTypes) { // TODO: types of different arities might be inherited, but we don't support that yet: Debug.Assert(t1.DeclaringType == existingTypes.DeclaringType); Debug.Assert(ReflectionUtils.GetNormalizedTypeName(t1) == existingTypes.Name); - + _typesByArity = new Dictionary(existingTypes._typesByArity); _typesByArity[GetGenericArity(t1)] = t1; _name = existingTypes.Name; @@ -167,7 +167,7 @@ private Type SampleType { public override string Name => _name; /// - /// This will return the result only for the non-generic type if one exists, and will throw + /// This will return the result only for the non-generic type if one exists, and will throw /// an exception if all types in the TypeGroup are generic /// public override Type Type => GetNonGenericType(); @@ -175,7 +175,7 @@ private Type SampleType { public override bool IsGenericType => _typesByArity.Count > 0; /// - /// This will return the result only for the non-generic type if one exists, and will throw + /// This will return the result only for the non-generic type if one exists, and will throw /// an exception if all types in the TypeGroup are generic /// public override bool IsPublic => GetNonGenericType().IsPublic; diff --git a/Dynamic/Actions/TypeTracker.cs b/Dynamic/Actions/TypeTracker.cs index 02ffc73f..7928cc63 100644 --- a/Dynamic/Actions/TypeTracker.cs +++ b/Dynamic/Actions/TypeTracker.cs @@ -7,10 +7,10 @@ using System.Linq; using System.Reflection; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Actions { +namespace Riverside.Scripting.Actions { public abstract class TypeTracker : MemberTracker, IMembersList { internal TypeTracker() { } diff --git a/Dynamic/Ast/BinaryExpression.cs b/Dynamic/Ast/BinaryExpression.cs index 59dc7f1f..2443eca8 100644 --- a/Dynamic/Ast/BinaryExpression.cs +++ b/Dynamic/Ast/BinaryExpression.cs @@ -6,9 +6,9 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { public static partial class Utils { /// diff --git a/Dynamic/Ast/Block.cs b/Dynamic/Ast/Block.cs index adfa87fd..cc8f45b1 100644 --- a/Dynamic/Ast/Block.cs +++ b/Dynamic/Ast/Block.cs @@ -8,9 +8,9 @@ using System.Collections.Generic; using System.Dynamic; using System.Collections.ObjectModel; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { public static partial class Utils { // Helper to add a variable to a block @@ -20,7 +20,7 @@ internal static Expression AddScopedVariable(Expression body, ParameterExpressio var exprs = new ReadOnlyCollection(new [] { body }); var parent = body; - //Merge blocks if the current block has only one child that is another block, + //Merge blocks if the current block has only one child that is another block, //the blocks to merge must have the same type. while (exprs.Count == 1 && exprs[0].NodeType == ExpressionType.Block && parent.Type == exprs[0].Type) { BlockExpression scope = (BlockExpression)(exprs[0]); diff --git a/Dynamic/Ast/BlockBuilder.cs b/Dynamic/Ast/BlockBuilder.cs index af67742b..6eedf015 100644 --- a/Dynamic/Ast/BlockBuilder.cs +++ b/Dynamic/Ast/BlockBuilder.cs @@ -8,9 +8,9 @@ using System.Collections.Generic; using System.Dynamic; using System.Collections.ObjectModel; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { public sealed class BlockBuilder : ExpressionCollectionBuilder { public BlockBuilder() { } diff --git a/Dynamic/Ast/ConstantExpression.cs b/Dynamic/Ast/ConstantExpression.cs index 0def402c..f419d8fb 100644 --- a/Dynamic/Ast/ConstantExpression.cs +++ b/Dynamic/Ast/ConstantExpression.cs @@ -7,10 +7,10 @@ using System.Numerics; using System.Reflection; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1724:TypeNamesShouldNotMatchNamespaces")] public static partial class Utils { diff --git a/Dynamic/Ast/DebugStatement.cs b/Dynamic/Ast/DebugStatement.cs index 021018a0..871f633c 100644 --- a/Dynamic/Ast/DebugStatement.cs +++ b/Dynamic/Ast/DebugStatement.cs @@ -5,10 +5,10 @@ using System.Linq.Expressions; using System.Diagnostics; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { public partial class Utils { public static Expression DebugMarker(string marker) { ContractUtils.RequiresNotNull(marker, nameof(marker)); @@ -68,7 +68,7 @@ public static Expression AddDebugInfo(Expression expression, SymbolDocumentInfo clearance ); } - + //save the expression to a variable var p = Expression.Parameter(expression.Type, null); return Expression.Block( diff --git a/Dynamic/Ast/EmptyStatements.cs b/Dynamic/Ast/EmptyStatements.cs index b3e37bae..b242b8fe 100644 --- a/Dynamic/Ast/EmptyStatements.cs +++ b/Dynamic/Ast/EmptyStatements.cs @@ -7,7 +7,7 @@ using System; using System.Dynamic; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { public static partial class Utils { private static readonly DefaultExpression VoidInstance = Expression.Empty(); diff --git a/Dynamic/Ast/ExpressionCollectionBuilder.cs b/Dynamic/Ast/ExpressionCollectionBuilder.cs index 99975e27..0391df7f 100644 --- a/Dynamic/Ast/ExpressionCollectionBuilder.cs +++ b/Dynamic/Ast/ExpressionCollectionBuilder.cs @@ -11,9 +11,9 @@ using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { using AstExpressions = ReadOnlyCollectionBuilder; public class ExpressionCollectionBuilder : IEnumerable, ICollection { @@ -133,19 +133,19 @@ public bool Remove(TExpression item) { public class ExpressionCollectionBuilder : ExpressionCollectionBuilder { public Expression/*!*/ ToMethodCall(Expression instance, MethodInfo/*!*/ method) { switch (Count) { - case 0: + case 0: return Expression.Call(instance, method); case 1: // we have no specialized subclass for instance method call expression with 1 arg: - return instance != null ? - Expression.Call(instance, method, new AstExpressions { Expression0 }) : + return instance != null ? + Expression.Call(instance, method, new AstExpressions { Expression0 }) : Expression.Call(method, Expression0); - case 2: + case 2: return Expression.Call(instance, method, Expression0, Expression1); - case 3: + case 3: return Expression.Call(instance, method, Expression0, Expression1, Expression2); case 4: @@ -154,9 +154,9 @@ public class ExpressionCollectionBuilder : ExpressionCollectionBuilder /// Wrapping a tree in this node enables jumps from finally blocks /// It does this by generating control-flow logic in the tree - /// + /// /// Reducing this node requires a full tree walk of its body /// (but not nested lambdas) - /// + /// /// WARNING: this node cannot contain jumps across blocks, because it /// assumes any unknown jumps are jumps to an outer scope. /// diff --git a/Dynamic/Ast/FlowControlRewriter.cs b/Dynamic/Ast/FlowControlRewriter.cs index 4ea44122..ed8e6445 100644 --- a/Dynamic/Ast/FlowControlRewriter.cs +++ b/Dynamic/Ast/FlowControlRewriter.cs @@ -8,31 +8,31 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { /// /// The purpose of this rewriter is simple: ETs do not allow jumps (break, continue, return, goto) /// that would go through a finally/fault. So we replace them with code that instead stores a flag, /// and then jumps to the end of the finally/fault. At the end of the try-finally, we emit a switch /// that then jumps to the correct label. - /// + /// /// A few things that make this more complicated: - /// + /// /// 1. If a finally contains a jump out, then jumps in the try/catch need to be replaced as well. /// It's to support cases like this: /// # returns 234 /// def foo(): /// try: return 123 - /// finally: return 234 - /// + /// finally: return 234 + /// /// We need to replace the "return 123" because after it jumps, we'll go to the finally, which /// might decide to jump again, but once the IL finally exits, it ignores the finally jump and /// keeps going with the original jump. The moral of the story is: if any jumps in finally are /// rewritten, try/catch jumps must be also. - /// + /// /// 2. To generate better code, we only have one state variable, so if we have to jump out of /// multiple finallys we just keep jumping. It looks sort of like this: /// foo: @@ -41,7 +41,7 @@ namespace Microsoft.Scripting.Ast { /// ... /// if (...) { /// // was: goto foo; - /// $flow = 1; goto endInnerFinally; + /// $flow = 1; goto endInnerFinally; /// } /// ... /// endInnerFinally: @@ -56,7 +56,7 @@ namespace Microsoft.Scripting.Ast { /// case 1: $flow = 0; goto foo; /// } /// ... - /// + /// /// internal sealed class FlowControlRewriter : ExpressionVisitor { @@ -202,7 +202,7 @@ protected override Expression VisitTry(TryExpression node) { // throw saved; // } // } - // + // // If we have a fault handler we turn this into the better: // try { // // try block body and all catch handling @@ -321,8 +321,8 @@ protected override Expression VisitBlock(BlockExpression node) { VisitLabelTarget(label.Target); // TODO: Support this. - // The check for BlockExpression is a hack to support the exact kind of - // cross-block jump that the light exception rewriter produces. Really we + // The check for BlockExpression is a hack to support the exact kind of + // cross-block jump that the light exception rewriter produces. Really we // should be aware of cross-block jumps and not produce a jump out of the finally // and then back in, currently this fails: // diff --git a/Dynamic/Ast/GeneratorExpression.cs b/Dynamic/Ast/GeneratorExpression.cs index bb51beca..39847ada 100644 --- a/Dynamic/Ast/GeneratorExpression.cs +++ b/Dynamic/Ast/GeneratorExpression.cs @@ -8,9 +8,9 @@ using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { /// /// A parameterless generator, that is of type IEnumerable, IEnumerable{T}, /// IEnumerator, or IEnumerator{T}. Its body can contain a series of @@ -228,7 +228,7 @@ private static Expression TransformEnumerable(Expression body, ReadOnlyCollectio } block[count] = new LambdaParameterRewriter(map).Visit(body); return Expression.Block( - new ReadOnlyCollection(vars), + new ReadOnlyCollection(vars), new ReadOnlyCollection(block) ); } diff --git a/Dynamic/Ast/GeneratorRewriter.cs b/Dynamic/Ast/GeneratorRewriter.cs index fd83f2fa..92a647dc 100644 --- a/Dynamic/Ast/GeneratorRewriter.cs +++ b/Dynamic/Ast/GeneratorRewriter.cs @@ -10,11 +10,11 @@ using System.Collections.ObjectModel; using System.Diagnostics; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { /// /// When finding a yield return or yield break, this rewriter flattens out /// containing blocks, scopes, and expressions with stack state. All @@ -261,7 +261,7 @@ private Expression MakeAssignBlock(ParameterExpression variable, Expression valu } else { newBlock[newBlock.Count - 1] = MakeAssign(variable, newBlock[newBlock.Count - 1]); } - + return Expression.Block(node.Variables, newBlock); } @@ -361,7 +361,7 @@ protected override Expression VisitTry(TryExpression node) { handlers[i] = Expression.Catch( exceptionVar, Expression.Block( - Expression.Assign(deferredVar, exceptionVar), + Expression.Assign(deferredVar, exceptionVar), Expression.Default(node.Body.Type) ), filter @@ -475,7 +475,7 @@ protected override Expression VisitUnary(UnaryExpression node) { } protected override Expression VisitLambda(Expression node) { - return node; // don't recurse into lambdas + return node; // don't recurse into lambdas } protected override Expression VisitTry(TryExpression node) { @@ -496,7 +496,7 @@ private Expression MakeSkipFinallyBlock(LabelTarget target) { ); } - // This is copied from the base implementation. + // This is copied from the base implementation. // Just want to make sure we disallow yield in filters protected override CatchBlock VisitCatchBlock(CatchBlock node) { ParameterExpression v = VisitAndConvert(node.Variable, "VisitCatchBlock"); @@ -601,8 +601,8 @@ protected override Expression VisitLambda(Expression node) { // // The rewriter assigns expressions into temporaries. If the expression is a label with a value the resulting tree would be illegal - // since we cannot jump into RHS of an assignment. Hence we need to eliminate labels and gotos with value. We just need to rewrite - // those that are used in MakeAssign but it is easier to rewrite all. + // since we cannot jump into RHS of an assignment. Hence we need to eliminate labels and gotos with value. We just need to rewrite + // those that are used in MakeAssign but it is easier to rewrite all. // // var = label[L](value1) // ... @@ -683,7 +683,7 @@ private ReadOnlyCollection ToTemp(ReadOnlyCollectionBuilder arguments, + private Expression Rewrite(Expression node, ReadOnlyCollection arguments, Func, Expression> factory) { return Rewrite(node, null, arguments, (e, args) => factory(args)); } @@ -717,7 +717,7 @@ private Expression Rewrite(Expression node, Expression expr, ReadOnlyCollection< return Expression.Block(block); } - // We need to rewrite unary expressions as well since ETs don't support jumping into unary expressions. + // We need to rewrite unary expressions as well since ETs don't support jumping into unary expressions. private Expression Rewrite(Expression node, Expression expr, Func factory) { int yields = _yields.Count; Expression newExpr = Visit(expr); @@ -756,7 +756,7 @@ private Expression Rewrite(Expression node, Expression expr1, Expression expr2, // f({expr|yield}, {yield}) -> { t1 = {expr|yeild}, t2 = {yield}; f(t1, t2) } newExpr1 = ToTemp(block, newExpr1); - + if (yields1 != _yields.Count) { newExpr2 = ToTemp(block, newExpr2); } @@ -781,9 +781,9 @@ private Expression VisitAssign(BinaryExpression node) { if (_generator.RewriteAssignments) { // We need to make sure that LHS is evaluated before RHS. For example, // - // {expr0}[{expr1},..,{exprN}] = {rhs} + // {expr0}[{expr1},..,{exprN}] = {rhs} // -> - // { l0 = {expr0}; l1 = {expr1}; ..; lN = {exprN}; r = {rhs}; l0[l1,..,lN] = r } + // { l0 = {expr0}; l1 = {expr1}; ..; lN = {exprN}; r = {rhs}; l0[l1,..,lN] = r } // if (left == node.Left) { switch (left.NodeType) { diff --git a/Dynamic/Ast/ILightExceptionAwareExpression.cs b/Dynamic/Ast/ILightExceptionAwareExpression.cs index 32957a49..93393f2d 100644 --- a/Dynamic/Ast/ILightExceptionAwareExpression.cs +++ b/Dynamic/Ast/ILightExceptionAwareExpression.cs @@ -6,10 +6,10 @@ using System; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { /// - /// Implemented by expressions which can provide a version which is aware of light exceptions. - /// + /// Implemented by expressions which can provide a version which is aware of light exceptions. + /// /// Normally these expressions will simply reduce to a version which throws a real exception. /// When the expression is used inside of a region of code which supports light exceptions /// the light exception re-writer will call ReduceForLightExceptions. The expression can diff --git a/Dynamic/Ast/IfStatementBuilder.cs b/Dynamic/Ast/IfStatementBuilder.cs index 50901fe2..86eeb939 100644 --- a/Dynamic/Ast/IfStatementBuilder.cs +++ b/Dynamic/Ast/IfStatementBuilder.cs @@ -5,9 +5,9 @@ using System.Linq.Expressions; using System.Collections.Generic; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { public sealed class IfStatementBuilder { private readonly List _clauses = new List(); diff --git a/Dynamic/Ast/IfStatementTest.cs b/Dynamic/Ast/IfStatementTest.cs index 388a1eb0..d00e9f3b 100644 --- a/Dynamic/Ast/IfStatementTest.cs +++ b/Dynamic/Ast/IfStatementTest.cs @@ -4,9 +4,9 @@ using System.Linq.Expressions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { public sealed class IfStatementTest { internal IfStatementTest(Expression test, Expression body) { diff --git a/Dynamic/Ast/LambdaBuilder.cs b/Dynamic/Ast/LambdaBuilder.cs index c330e388..03e7712a 100644 --- a/Dynamic/Ast/LambdaBuilder.cs +++ b/Dynamic/Ast/LambdaBuilder.cs @@ -11,19 +11,19 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Threading; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; -using RuntimeHelpers = Microsoft.Scripting.Runtime.ScriptingRuntimeHelpers; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; +using RuntimeHelpers = Riverside.Scripting.Runtime.ScriptingRuntimeHelpers; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { /// /// The builder for creating the LambdaExpression node. - /// + /// /// Since the nodes require that parameters and variables are created /// before hand and then passed to the factories creating LambdaExpression /// this builder keeps track of the different pieces and at the end creates /// the LambdaExpression. - /// + /// /// TODO: This has some functionality related to CodeContext that should be /// removed, in favor of languages handling their own local scopes /// @@ -124,7 +124,7 @@ public bool Visible { _visible = value; } } - + public List GetVisibleVariables() { var vars = new List(_visibleVars.Count); foreach (var v in _visibleVars) { @@ -137,7 +137,7 @@ public List GetVisibleVariables() { /// /// Creates a parameter on the lambda with a given name and type. - /// + /// /// Parameters maintain the order in which they are created, /// however custom ordering is possible via direct access to /// Parameters collection. @@ -152,7 +152,7 @@ public ParameterExpression Parameter(Type type, string name) { /// /// Creates a parameter on the lambda with a given name and type. - /// + /// /// Parameters maintain the order in which they are created, /// however custom ordering is possible via direct access to /// Parameters collection. @@ -167,7 +167,7 @@ public ParameterExpression ClosedOverParameter(Type type, string name) { /// /// adds existing parameter to the lambda. - /// + /// /// Parameters maintain the order in which they are created, /// however custom ordering is possible via direct access to /// Parameters collection. @@ -178,7 +178,7 @@ public void AddParameters(params ParameterExpression[] parameters) { /// /// Creates a hidden parameter on the lambda with a given name and type. - /// + /// /// Parameters maintain the order in which they are created, /// however custom ordering is possible via direct access to /// Parameters collection. @@ -192,7 +192,7 @@ public ParameterExpression CreateHiddenParameter(string name, Type type) { /// /// Creates a params array argument on the labmda. - /// + /// /// The params array argument is added to the signature immediately. Before the lambda is /// created, the builder validates that it is still the last (since the caller can modify /// the order of parameters explicitly by maniuplating the parameter list) @@ -281,7 +281,7 @@ public LambdaExpression MakeLambda() { LambdaExpression lambda = Expression.Lambda( GetLambdaType(_returnType, _params), - AddDefaultReturn(MakeBody()), + AddDefaultReturn(MakeBody()), _name + "$" + Interlocked.Increment(ref _lambdaId), _params ); @@ -306,7 +306,7 @@ public LambdaExpression MakeGenerator(LabelTarget label, Type lambdaType) { lambdaType, label, MakeBody(), - _name + "$" + Interlocked.Increment(ref _lambdaId), + _name + "$" + Interlocked.Increment(ref _lambdaId), _params ); @@ -331,7 +331,7 @@ private void EnsureSignature(Type delegateType) { // Example: // delegate siganture del(x, params y[]) // lambda signature lambda(a, b, param n[]) - // + // // for the situation above the mapping will be , , // where V1 and V2 are synthetic variables and initialized as follows - V1 = y[0] , V2 = {y[1], y[2],... y[n]} ParameterInfo[] delegateParams = delegateType.GetMethod("Invoke").GetParameters(); @@ -500,7 +500,7 @@ private bool EmitDictionary { private Expression MakeBody() { Expression body = _body; - + // wrap a scope if needed if (_locals != null && _locals.Count > 0) { body = Expression.Block(new ReadOnlyCollection(_locals.ToArray()), body); @@ -553,13 +553,13 @@ public static LambdaBuilder Lambda(Type returnType, string name) { } } -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public static partial class ScriptingRuntimeHelpers { /// - /// Used by prologue code that is injected in lambdas to ensure that delegate signature matches what - /// lambda body expects. Such code typically unwraps subset of the params array manually, + /// Used by prologue code that is injected in lambdas to ensure that delegate signature matches what + /// lambda body expects. Such code typically unwraps subset of the params array manually, /// but then passes the rest in bulk if lambda body also expects params array. - /// + /// /// This calls ArrayUtils.ShiftLeft, but performs additional checks that /// ArrayUtils.ShiftLeft assumes. /// diff --git a/Dynamic/Ast/LambdaParameterRewriter.cs b/Dynamic/Ast/LambdaParameterRewriter.cs index c71d0a8d..a99d118e 100644 --- a/Dynamic/Ast/LambdaParameterRewriter.cs +++ b/Dynamic/Ast/LambdaParameterRewriter.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { internal sealed class LambdaParameterRewriter : ExpressionVisitor { private readonly Dictionary _map; diff --git a/Dynamic/Ast/LightCheckAndThrowExpression.cs b/Dynamic/Ast/LightCheckAndThrowExpression.cs index eac034e1..63c48a78 100644 --- a/Dynamic/Ast/LightCheckAndThrowExpression.cs +++ b/Dynamic/Ast/LightCheckAndThrowExpression.cs @@ -7,16 +7,16 @@ using System; using System.Reflection; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; using System.Collections.ObjectModel; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Interpreter; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Interpreter; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { /// - /// Provides a method call to a method which may return light exceptions. - /// + /// Provides a method call to a method which may return light exceptions. + /// /// The call is to a method which supports light exceptions. When reducing /// an additional check and throw is added. When a block code of is re-written /// for light exceptions this instead reduces to not throw a .NET exception. diff --git a/Dynamic/Ast/LightDynamicExpression.cs b/Dynamic/Ast/LightDynamicExpression.cs index 4805e06e..daa7c2fa 100644 --- a/Dynamic/Ast/LightDynamicExpression.cs +++ b/Dynamic/Ast/LightDynamicExpression.cs @@ -9,12 +9,12 @@ using System.Diagnostics; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Interpreter; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using Microsoft.Scripting.Actions; +using Riverside.Scripting.Interpreter; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using Riverside.Scripting.Actions; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { public abstract class LightDynamicExpression : Expression, IInstructionProvider { private readonly CallSiteBinder _binder; @@ -80,7 +80,7 @@ protected CallSiteBinder GetLightBinder() { public class LightDynamicExpression1 : LightDynamicExpression, ILightExceptionAwareExpression { internal readonly Expression _arg0; - internal protected LightDynamicExpression1(CallSiteBinder binder, Expression arg0) + internal protected LightDynamicExpression1(CallSiteBinder binder, Expression arg0) : base(binder) { ContractUtils.RequiresNotNull(arg0, nameof(arg0)); _arg0 = arg0; @@ -498,12 +498,12 @@ public class LightTypedDynamicExpressionN : LightDynamicExpression, ILightExcept private readonly IList _args; private readonly Type _returnType; - internal protected LightTypedDynamicExpressionN(CallSiteBinder binder, Type returnType, IList args) + internal protected LightTypedDynamicExpressionN(CallSiteBinder binder, Type returnType, IList args) : base(binder) { Debug.Assert(args.Count > 0); ContractUtils.RequiresNotNull(returnType, nameof(returnType)); ContractUtils.RequiresNotEmpty(args, nameof(args)); - + _args = args; _returnType = returnType; } @@ -550,7 +550,7 @@ protected override Expression VisitChildren(ExpressionVisitor visitor) { } return this; } - + protected sealed override Expression GetArgument(int index) { return _args[index]; } @@ -579,7 +579,7 @@ public static LightDynamicExpression LightDynamic(CallSiteBinder binder, Express } public static LightDynamicExpression LightDynamic(CallSiteBinder binder, Type returnType, Expression arg0) { - return returnType == typeof(object) ? + return returnType == typeof(object) ? new LightDynamicExpression1(binder, arg0) : (LightDynamicExpression)new LightTypedDynamicExpression1(binder, returnType, arg0); } diff --git a/Dynamic/Ast/LightExceptionConvertingExpression.cs b/Dynamic/Ast/LightExceptionConvertingExpression.cs index 8adc09de..df622097 100644 --- a/Dynamic/Ast/LightExceptionConvertingExpression.cs +++ b/Dynamic/Ast/LightExceptionConvertingExpression.cs @@ -7,11 +7,11 @@ using System; using System.Reflection; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; using System.Collections.ObjectModel; using System.Runtime.CompilerServices; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { internal class LightExceptionConvertingExpression : Expression, ILightExceptionAwareExpression { private readonly Expression _expr; private readonly bool _supportsLightEx; @@ -35,7 +35,7 @@ public override Type Type { public override Expression Reduce() { return new LightExceptionRewriter().Rewrite(_expr); - } + } #region ILightExceptionAwareExpression Members diff --git a/Dynamic/Ast/LightExceptionRewriter.cs b/Dynamic/Ast/LightExceptionRewriter.cs index 7cafc980..6407d6a2 100644 --- a/Dynamic/Ast/LightExceptionRewriter.cs +++ b/Dynamic/Ast/LightExceptionRewriter.cs @@ -10,12 +10,12 @@ using System.Runtime.CompilerServices; using System.Threading; -using Microsoft.Scripting.Actions; -using Microsoft.Scripting.Interpreter; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Actions; +using Riverside.Scripting.Interpreter; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { /// /// Internal re-writer class which creates code which is light exception aware. /// @@ -55,7 +55,7 @@ internal Expression Rewrite(Expression expr) { } /// - /// Class used to be avoid overhead of creating expression trees when we're usually + /// Class used to be avoid overhead of creating expression trees when we're usually /// class LightExceptionRewrittenCode : Expression, IInstructionProvider { private readonly LabelTarget _returnLabel; @@ -112,7 +112,7 @@ protected override Expression VisitExtension(Expression node) { var newNode = lightAware.ReduceForLightExceptions(); if (newNode != node) { return CheckExpression(Visit(newNode), node.Type); - } + } } return base.VisitExtension(node); @@ -174,7 +174,7 @@ private Expression RewriteTryFinally(Expression tryBody, Expression finallyBody) // ) // ) //); - + return Expression.TryFinally(tryBody, finallyBody); } @@ -198,7 +198,7 @@ protected override Expression VisitUnary(UnaryExpression node) { return base.VisitUnary(node); } - + private Expression RewriteTryBody(TryExpression node, LabelTarget ehLabel) { Expression body; LabelTarget prevHandler = _currentHandler; @@ -241,7 +241,7 @@ private CatchBlock[] VisitHandlers(TryExpression node, bool realCatch) { } finally { _rethrow = oldRethrow; } - } + } return handlers; } @@ -265,7 +265,7 @@ private Expression TrackCatch(Expression expression, Expression exception, bool private Expression RewriteTryCatch(TryExpression node) { // we inline the catch handlers after the catch blocks and use labels // to branch around and propagate the result out. - // + // // goto tryDone( // try { // if (LightExceptions.IsLightException(_lastValue = someCall)) { @@ -326,7 +326,7 @@ private Expression LightCatch(CatchBlock[] handlers) { // walk backwards and add each handler as a test in a cascading // conditional. If all tests fail, we make it back to the return value. Expression rethrow = PropagateException(typeof(object)); - + for (int i = handlers.Length - 1; i >= 0; i--) { var curHandler = handlers[i]; @@ -354,11 +354,11 @@ private Expression LightCatch(CatchBlock[] handlers) { ) ); } - + return rethrow; } - + /// /// Adds light exception handling to the provided expression which /// is light exception aware. @@ -367,13 +367,13 @@ private Expression CheckExpression(Expression expr, Type retType) { if (expr.Type == typeof(object)) { // if we're not object then we can't be a light exception expr = new LightExceptionCheckExpression( - expr, - retType, - _currentHandler ?? _returnLabel, + expr, + retType, + _currentHandler ?? _returnLabel, _currentHandler == null ? _lastValue : null ); } - + return expr; } @@ -425,7 +425,7 @@ public void AddInstructions(LightCompiler compiler) { // true - an exception occured compiler.Instructions.EmitBranchFalse(endOfTrue); - + if (_lastValue != null) { compiler.CompileParameterExpression(_lastValue); } @@ -437,7 +437,7 @@ public void AddInstructions(LightCompiler compiler) { ); compiler.Instructions.EmitBranch(endOfFalse, false, true); - // false - no exception + // false - no exception compiler.Instructions.MarkLabel(endOfTrue); compiler.CompileParameterExpression(LightExceptionRewriter._lastValue); compiler.Instructions.MarkLabel(endOfFalse); diff --git a/Dynamic/Ast/LightLambdaExpression.cs b/Dynamic/Ast/LightLambdaExpression.cs index f0b3dc56..e9fa4bca 100644 --- a/Dynamic/Ast/LightLambdaExpression.cs +++ b/Dynamic/Ast/LightLambdaExpression.cs @@ -6,9 +6,9 @@ using System; using System.Collections.Generic; -using Microsoft.Scripting.Interpreter; +using Riverside.Scripting.Interpreter; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { public class LightLambdaExpression : Expression { internal LightLambdaExpression(Type retType, Expression body, string name, IList args) { Body = body; diff --git a/Dynamic/Ast/LightThrowExpression.cs b/Dynamic/Ast/LightThrowExpression.cs index 5109c587..c1cc6efc 100644 --- a/Dynamic/Ast/LightThrowExpression.cs +++ b/Dynamic/Ast/LightThrowExpression.cs @@ -9,11 +9,11 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Collections.ObjectModel; -using Microsoft.Scripting.Utils; -using Microsoft.Scripting.Interpreter; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Utils; +using Riverside.Scripting.Interpreter; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { /// /// Expression which produces a light exception value. This should be constructed /// with the expression which creates the exception and this method will then call diff --git a/Dynamic/Ast/LoopStatement.cs b/Dynamic/Ast/LoopStatement.cs index a7627e3b..4601dbf1 100644 --- a/Dynamic/Ast/LoopStatement.cs +++ b/Dynamic/Ast/LoopStatement.cs @@ -6,9 +6,9 @@ using System; using System.Dynamic; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { /// /// Factory methods. /// diff --git a/Dynamic/Ast/MethodCallExpression.cs b/Dynamic/Ast/MethodCallExpression.cs index 664a32ab..e6f0bd6d 100644 --- a/Dynamic/Ast/MethodCallExpression.cs +++ b/Dynamic/Ast/MethodCallExpression.cs @@ -9,11 +9,11 @@ using System.Diagnostics; using System.Reflection; using System.Dynamic; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; -using Microsoft.Scripting.Generation; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; +using Riverside.Scripting.Generation; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] public static partial class Utils { diff --git a/Dynamic/Ast/NewArrayExpression.cs b/Dynamic/Ast/NewArrayExpression.cs index 47ccabf7..61a70640 100644 --- a/Dynamic/Ast/NewArrayExpression.cs +++ b/Dynamic/Ast/NewArrayExpression.cs @@ -7,9 +7,9 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { public static partial class Utils { public static NewArrayExpression NewArrayHelper(Type type, IEnumerable initializers) { ContractUtils.RequiresNotNull(type, nameof(type)); diff --git a/Dynamic/Ast/NewExpression.cs b/Dynamic/Ast/NewExpression.cs index 74a3fac7..1be06702 100644 --- a/Dynamic/Ast/NewExpression.cs +++ b/Dynamic/Ast/NewExpression.cs @@ -5,9 +5,9 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { public static partial class Utils { public static NewExpression SimpleNewHelper(ConstructorInfo constructor, params Expression[] arguments) { ContractUtils.RequiresNotNull(constructor, nameof(constructor)); diff --git a/Dynamic/Ast/SourceFileInformation.cs b/Dynamic/Ast/SourceFileInformation.cs index 0be3f1c8..3496b660 100644 --- a/Dynamic/Ast/SourceFileInformation.cs +++ b/Dynamic/Ast/SourceFileInformation.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. using System; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// Stores information needed to emit debugging symbol information for a /// source file, in particular the file name and unique language identifier diff --git a/Dynamic/Ast/TryStatementBuilder.cs b/Dynamic/Ast/TryStatementBuilder.cs index 9bb6cccc..f9bb0aa7 100644 --- a/Dynamic/Ast/TryStatementBuilder.cs +++ b/Dynamic/Ast/TryStatementBuilder.cs @@ -7,9 +7,9 @@ using System; using System.Collections.Generic; using System.Dynamic; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { public sealed class TryStatementBuilder { private readonly List _catchBlocks = new List(); private Expression _try; diff --git a/Dynamic/Ast/UnaryExpression.cs b/Dynamic/Ast/UnaryExpression.cs index 3f1ac051..bb2165e4 100644 --- a/Dynamic/Ast/UnaryExpression.cs +++ b/Dynamic/Ast/UnaryExpression.cs @@ -5,11 +5,11 @@ using System.Linq.Expressions; using System; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; using System.Reflection; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { public static partial class Utils { /// /// Converts an expression to a void type. diff --git a/Dynamic/Ast/Utils.cs b/Dynamic/Ast/Utils.cs index 76c3b04f..d329f63b 100644 --- a/Dynamic/Ast/Utils.cs +++ b/Dynamic/Ast/Utils.cs @@ -7,10 +7,10 @@ using System; using System.Reflection; using System.Dynamic; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { [Flags] public enum ExpressionAccess { None = 0, diff --git a/Dynamic/Ast/YieldExpression.cs b/Dynamic/Ast/YieldExpression.cs index 54ab2189..cb013ddb 100644 --- a/Dynamic/Ast/YieldExpression.cs +++ b/Dynamic/Ast/YieldExpression.cs @@ -5,9 +5,9 @@ using System.Linq.Expressions; using System; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Ast { +namespace Riverside.Scripting.Ast { /// /// Represents either a YieldBreak or YieldReturn in a GeneratorExpression /// If Value is non-null, it's a YieldReturn; otherwise it's a YieldBreak diff --git a/Dynamic/ComInterop/ArgBuilder.cs b/Dynamic/ComInterop/ArgBuilder.cs index b95bd9ed..5b156506 100644 --- a/Dynamic/ComInterop/ArgBuilder.cs +++ b/Dynamic/ComInterop/ArgBuilder.cs @@ -6,11 +6,11 @@ using System.Linq.Expressions; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// ArgBuilder provides an argument value used by the MethodBinder. One ArgBuilder exists for each - /// physical parameter defined on a method. - /// + /// physical parameter defined on a method. + /// /// Contrast this with ParameterWrapper which represents the logical argument passed to the method. /// internal abstract class ArgBuilder { diff --git a/Dynamic/ComInterop/BoolArgBuilder.cs b/Dynamic/ComInterop/BoolArgBuilder.cs index afa8f5ee..d8a59c73 100644 --- a/Dynamic/ComInterop/BoolArgBuilder.cs +++ b/Dynamic/ComInterop/BoolArgBuilder.cs @@ -12,7 +12,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal sealed class BoolArgBuilder : SimpleArgBuilder { internal BoolArgBuilder(Type parameterType) : base(parameterType) { @@ -40,4 +40,4 @@ internal override Expression UnmarshalFromRef(Expression value) { } } -#endif \ No newline at end of file +#endif diff --git a/Dynamic/ComInterop/BoundDispEvent.cs b/Dynamic/ComInterop/BoundDispEvent.cs index 3f9d0db4..2ba258de 100644 --- a/Dynamic/ComInterop/BoundDispEvent.cs +++ b/Dynamic/ComInterop/BoundDispEvent.cs @@ -8,9 +8,9 @@ using System.Dynamic; using System.Linq.Expressions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal sealed class BoundDispEvent : DynamicObject { private object _rcw; private Guid _sourceIid; diff --git a/Dynamic/ComInterop/CollectionExtensions.cs b/Dynamic/ComInterop/CollectionExtensions.cs index e895bb78..9a1ff471 100644 --- a/Dynamic/ComInterop/CollectionExtensions.cs +++ b/Dynamic/ComInterop/CollectionExtensions.cs @@ -8,8 +8,8 @@ using System.Diagnostics; using System; -namespace Microsoft.Scripting.ComInterop { - internal static class CollectionExtensions { +namespace Riverside.Scripting.ComInterop { + internal static class CollectionExtensions { internal static T[] RemoveFirst(this T[] array) { T[] result = new T[array.Length - 1]; @@ -38,4 +38,4 @@ internal static T[] AddLast(this IList list, T item) { } } } -#endif \ No newline at end of file +#endif diff --git a/Dynamic/ComInterop/ComBinder.cs b/Dynamic/ComInterop/ComBinder.cs index 1fe8c066..50409e0a 100644 --- a/Dynamic/ComInterop/ComBinder.cs +++ b/Dynamic/ComInterop/ComBinder.cs @@ -12,10 +12,10 @@ using System.Security; using System.Security.Permissions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; [assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Dynamic")] -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// Provides helper methods to bind COM objects dynamically. @@ -98,7 +98,7 @@ public static bool TryBindSetMember(SetMemberBinder binder, DynamicMetaObject in /// /// Tries to perform binding of the dynamic invoke operation. - /// + /// /// An instance of the that represents the details of the dynamic operation. /// The target of the dynamic operation. /// An array of instances - arguments to the invoke member operation. @@ -108,7 +108,7 @@ public static bool TryBindInvoke(InvokeBinder binder, DynamicMetaObject instance ContractUtils.RequiresNotNull(binder, nameof(binder)); ContractUtils.RequiresNotNull(instance, nameof(instance)); ContractUtils.RequiresNotNull(args, nameof(args)); - + if (TryGetMetaObjectInvoke(ref instance)) { result = instance.BindInvoke(binder, args); return true; @@ -199,7 +199,7 @@ public static bool TryConvert(ConvertBinder binder, DynamicMetaObject instance, if (IsComObject(instance.Value)) { - // Converting a COM object to any interface is always considered possible - it will result in + // Converting a COM object to any interface is always considered possible - it will result in // a QueryInterface at runtime if (binder.Type.IsInterface) { result = new DynamicMetaObject( diff --git a/Dynamic/ComInterop/ComBinderHelpers.cs b/Dynamic/ComInterop/ComBinderHelpers.cs index be23d7c0..d046a15b 100644 --- a/Dynamic/ComInterop/ComBinderHelpers.cs +++ b/Dynamic/ComInterop/ComBinderHelpers.cs @@ -12,7 +12,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal static class ComBinderHelpers { internal static bool PreferPut(Type type, bool holdsNull) { diff --git a/Dynamic/ComInterop/ComClassMetaObject.cs b/Dynamic/ComInterop/ComClassMetaObject.cs index a148cc9d..e867046b 100644 --- a/Dynamic/ComInterop/ComClassMetaObject.cs +++ b/Dynamic/ComInterop/ComClassMetaObject.cs @@ -7,9 +7,9 @@ using System.Linq.Expressions; using System.Dynamic; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal class ComClassMetaObject : DynamicMetaObject { internal ComClassMetaObject(Expression expression, ComTypeClassDesc cls) diff --git a/Dynamic/ComInterop/ComDispIds.cs b/Dynamic/ComInterop/ComDispIds.cs index 12f0584c..430d4685 100644 --- a/Dynamic/ComInterop/ComDispIds.cs +++ b/Dynamic/ComInterop/ComDispIds.cs @@ -4,7 +4,7 @@ #if FEATURE_COM -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal static class ComDispIds { internal const int DISPID_VALUE = 0; internal const int DISPID_PROPERTYPUT = -3; @@ -12,4 +12,4 @@ internal static class ComDispIds { } } -#endif \ No newline at end of file +#endif diff --git a/Dynamic/ComInterop/ComEventDesc.cs b/Dynamic/ComInterop/ComEventDesc.cs index 5b12a3e6..bce091ca 100644 --- a/Dynamic/ComInterop/ComEventDesc.cs +++ b/Dynamic/ComInterop/ComEventDesc.cs @@ -6,11 +6,11 @@ using System; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal class ComEventDesc { internal Guid sourceIID; internal int dispid; }; } -#endif \ No newline at end of file +#endif diff --git a/Dynamic/ComInterop/ComEventSink.netcoreapp.cs b/Dynamic/ComInterop/ComEventSink.netcoreapp.cs index e7fb2d42..16507c5f 100644 --- a/Dynamic/ComInterop/ComEventSink.netcoreapp.cs +++ b/Dynamic/ComInterop/ComEventSink.netcoreapp.cs @@ -14,7 +14,7 @@ using System.Text; using System.Threading.Tasks; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// Part of ComEventHelpers APIs which allow binding /// managed delegates to COM's connection point based events. @@ -51,7 +51,7 @@ public static ComEventSink FromRuntimeCallableWrapper(object rcw, Guid sourceIid } if (sink._iidSourceItf == Guid.Empty) { - // we found a ComEventSink object that + // we found a ComEventSink object that // was previously disposed. Now we will reuse it. sink.Initialize(rcw, sourceIid); comEventSink = sink; @@ -104,7 +104,7 @@ public void RemoveHandler(int dispid, object func) { // is a ComEventCallContext object. sinkEntry.RemoveDelegates(d => d.Target is SplatCallSite callContext && callContext._callable.Equals(func)); - // If the delegates chain is empty - we can remove + // If the delegates chain is empty - we can remove // corresponding ComEvenSinkEntry if (sinkEntry.Empty) RemoveMethod(sinkEntry); diff --git a/Dynamic/ComInterop/ComEventSink.netfx.cs b/Dynamic/ComInterop/ComEventSink.netfx.cs index d18523e2..deb39389 100644 --- a/Dynamic/ComInterop/ComEventSink.netfx.cs +++ b/Dynamic/ComInterop/ComEventSink.netfx.cs @@ -12,23 +12,23 @@ using System.Runtime.InteropServices; using System.Security; using ComTypes = System.Runtime.InteropServices.ComTypes; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// This class implements an event sink for a particular RCW. /// Unlike the implementation of events in TlbImp'd assemblies, /// we will create only one event sink per RCW (theoretically RCW might have /// several ComEventSink evenk sinks - but all these implement different source intefaces). /// Each ComEventSink contains a list of ComEventSinkMethod objects - which represent - /// a single method on the source interface an a multicast delegate to redirect - /// the calls. Notice that we are chaining multicast delegates so that same + /// a single method on the source interface an a multicast delegate to redirect + /// the calls. Notice that we are chaining multicast delegates so that same /// ComEventSinkMedhod can invoke multiple event handlers). - /// + /// /// ComEventSink implements an IDisposable pattern to Unadvise from the connection point. - /// Typically, when RCW is finalized the corresponding Dispose will be triggered by + /// Typically, when RCW is finalized the corresponding Dispose will be triggered by /// ComEventSinksContainer finalizer. Notice that lifetime of ComEventSinksContainer - /// is bound to the lifetime of the RCW. + /// is bound to the lifetime of the RCW. /// internal sealed class ComEventSink : MarshalByRefObject, IReflect, IDisposable { @@ -100,7 +100,7 @@ public static ComEventSink FromRuntimeCallableWrapper(object rcw, Guid sourceIid } if (sink._sourceIid == Guid.Empty) { - // we found a ComEventSink object that + // we found a ComEventSink object that // was previously disposed. Now we will reuse it. sink.Initialize(rcw, sourceIid); comEventSink = sink; @@ -162,16 +162,16 @@ public void RemoveHandler(int dispid, object func) { } } - // If the delegates chain is empty - we can remove + // If the delegates chain is empty - we can remove // corresponding ComEvenSinkEntry if (sinkEntry._handlers == null) _comEventSinkMethods.Remove(sinkEntry); // We can Unadvise from the ConnectionPoint if no more sink entries - // are registered for this interface + // are registered for this interface //(calling Dispose will call IConnectionPoint.Unadvise). if (_comEventSinkMethods.Count == 0) { - // notice that we do not remove + // notice that we do not remove // ComEventSinkEntry from the list, we will re-use this data structure // if a new handler needs to be attached. Dispose(); diff --git a/Dynamic/ComInterop/ComEventSinkProxy.netfx.cs b/Dynamic/ComInterop/ComEventSinkProxy.netfx.cs index 51f0233f..0905c0e0 100644 --- a/Dynamic/ComInterop/ComEventSinkProxy.netfx.cs +++ b/Dynamic/ComInterop/ComEventSinkProxy.netfx.cs @@ -13,28 +13,28 @@ using System.Runtime.Remoting.Proxies; using System.Security; using System.Security.Permissions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// - /// ComEventSinkProxy class is responsible for handling QIs for sourceIid + /// ComEventSinkProxy class is responsible for handling QIs for sourceIid /// on instances of ComEventSink. - /// - /// Background: When a COM even sink advises to a connection point it is + /// + /// Background: When a COM even sink advises to a connection point it is /// supposed to hand over the dispinterface. Now, some hosts will trust /// the COM client to pass the correct pointer, but some will not. /// E.g. Excel's implementation of Connection Points will not cause a /// QI on the pointer that has been passed, however Word will QI the /// pointer to return the required interface. - /// - /// ComEventSink does not, strongly speaking, implements the interface + /// + /// ComEventSink does not, strongly speaking, implements the interface /// that it claims to implement - it is just "faking" it by using IReflect. /// Thus, Word's QIs on the pointer passed to ICP::Advise would fail. To /// prevent this we take advangate of RealProxy's ability of - /// "dressing up" like other classes and hence successfully respond to QIs - /// for interfaces that it does not really support( it is OK to say - /// "I implement this interface" for event sinks only since the common - /// practice is to use IDistpach.Invoke when calling into event sinks). + /// "dressing up" like other classes and hence successfully respond to QIs + /// for interfaces that it does not really support( it is OK to say + /// "I implement this interface" for event sinks only since the common + /// practice is to use IDistpach.Invoke when calling into event sinks). /// internal sealed class ComEventSinkProxy : RealProxy { diff --git a/Dynamic/ComInterop/ComEventSinksContainer.cs b/Dynamic/ComInterop/ComEventSinksContainer.cs index a2e9dfe8..43c24bca 100644 --- a/Dynamic/ComInterop/ComEventSinksContainer.cs +++ b/Dynamic/ComInterop/ComEventSinksContainer.cs @@ -11,10 +11,10 @@ using System.Runtime.InteropServices; using System.Security; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// ComEventSinksContainer is just a regular list with a finalizer. - /// This list is usually attached as a custom data for RCW object and + /// This list is usually attached as a custom data for RCW object and /// is finalized whenever RCW is finalized. /// internal class ComEventSinksContainer : List, IDisposable { diff --git a/Dynamic/ComInterop/ComEventsMethod.netcoreapp.cs b/Dynamic/ComInterop/ComEventsMethod.netcoreapp.cs index 7ecf1a28..0ffd4be8 100644 --- a/Dynamic/ComInterop/ComEventsMethod.netcoreapp.cs +++ b/Dynamic/ComInterop/ComEventsMethod.netcoreapp.cs @@ -11,7 +11,7 @@ using System.Text; using System.Threading.Tasks; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// Part of ComEventHelpers APIs which allow binding /// managed delegates to COM's connection point based events. diff --git a/Dynamic/ComInterop/ComFallbackMetaObject.cs b/Dynamic/ComInterop/ComFallbackMetaObject.cs index e218c0f9..b9d4af40 100644 --- a/Dynamic/ComInterop/ComFallbackMetaObject.cs +++ b/Dynamic/ComInterop/ComFallbackMetaObject.cs @@ -9,9 +9,9 @@ using System.Dynamic; using System.Diagnostics; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { // // ComFallbackMetaObject just delegates everything to the binder. // diff --git a/Dynamic/ComInterop/ComHresults.cs b/Dynamic/ComInterop/ComHresults.cs index cb51f6c7..8bd59c3f 100644 --- a/Dynamic/ComInterop/ComHresults.cs +++ b/Dynamic/ComInterop/ComHresults.cs @@ -4,10 +4,10 @@ #if FEATURE_COM -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal static class ComHresults { - + internal const int S_OK = 0; internal const int CONNECT_E_NOCONNECTION = unchecked((int)0x80040200); diff --git a/Dynamic/ComInterop/ComInterop.cs b/Dynamic/ComInterop/ComInterop.cs index 55c26dd3..561995ba 100644 --- a/Dynamic/ComInterop/ComInterop.cs +++ b/Dynamic/ComInterop/ComInterop.cs @@ -9,7 +9,7 @@ using System.Runtime.InteropServices; using ComTypes = System.Runtime.InteropServices.ComTypes; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { [ ComImport, diff --git a/Dynamic/ComInterop/ComInvokeAction.cs b/Dynamic/ComInterop/ComInvokeAction.cs index fb0eef8b..7803dbfd 100644 --- a/Dynamic/ComInterop/ComInvokeAction.cs +++ b/Dynamic/ComInterop/ComInvokeAction.cs @@ -12,7 +12,7 @@ using System.Diagnostics; using System.Runtime.CompilerServices; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// Invokes the object. If it falls back, just produce an error. /// @@ -48,7 +48,7 @@ public override DynamicMetaObject FallbackInvoke(DynamicMetaObject target, Dynam /// /// Splats the arguments to another nested dynamic site, which does the - /// real invocation of the IDynamicMetaObjectProvider. + /// real invocation of the IDynamicMetaObjectProvider. /// internal sealed class SplatInvokeBinder : CallSiteBinder { internal static readonly SplatInvokeBinder Instance = new SplatInvokeBinder(); diff --git a/Dynamic/ComInterop/ComInvokeBinder.cs b/Dynamic/ComInterop/ComInvokeBinder.cs index 798eaf56..fb3ebdde 100644 --- a/Dynamic/ComInterop/ComInvokeBinder.cs +++ b/Dynamic/ComInterop/ComInvokeBinder.cs @@ -12,7 +12,7 @@ using System.Dynamic; using ComTypes = System.Runtime.InteropServices.ComTypes; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal sealed class ComInvokeBinder { private readonly ComMethodDesc _methodDesc; private readonly Expression _method; // ComMethodDesc to be called @@ -40,12 +40,12 @@ internal sealed class ComInvokeBinder { private ParameterExpression _propertyPutDispId; internal ComInvokeBinder( - CallInfo callInfo, + CallInfo callInfo, DynamicMetaObject[] args, bool[] isByRef, - BindingRestrictions restrictions, - Expression method, - Expression dispatch, + BindingRestrictions restrictions, + Expression method, + Expression dispatch, ComMethodDesc methodDesc ) { @@ -137,7 +137,7 @@ private static Type MarshalType(DynamicMetaObject mo, bool isByRef) { internal DynamicMetaObject Invoke() { _keywordArgNames = _callInfo.ArgumentNames.ToArray(); _totalExplicitArgs = _args.Length; - + Type[] marshalArgTypes = new Type[_args.Length]; // We already tested the instance, so no need to test it again diff --git a/Dynamic/ComInterop/ComMetaObject.cs b/Dynamic/ComInterop/ComMetaObject.cs index fb252b74..315030e6 100644 --- a/Dynamic/ComInterop/ComMetaObject.cs +++ b/Dynamic/ComInterop/ComMetaObject.cs @@ -9,9 +9,9 @@ using System.Dynamic; using System.Linq.Expressions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { // Note: we only need to support the operations used by ComBinder internal class ComMetaObject : DynamicMetaObject { diff --git a/Dynamic/ComInterop/ComMethodDesc.cs b/Dynamic/ComInterop/ComMethodDesc.cs index bdbf5da4..885f6e42 100644 --- a/Dynamic/ComInterop/ComMethodDesc.cs +++ b/Dynamic/ComInterop/ComMethodDesc.cs @@ -7,7 +7,7 @@ using System.Diagnostics; using System.Runtime.InteropServices.ComTypes; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { public class ComMethodDesc { @@ -88,7 +88,7 @@ public bool IsPropertyPutRef { return (InvokeKind & INVOKEKIND.INVOKE_PROPERTYPUTREF) != 0; } } - + internal int ParamCount { get { return _paramCnt; diff --git a/Dynamic/ComInterop/ComObject.cs b/Dynamic/ComInterop/ComObject.cs index 8e48a8fd..a11cfefe 100644 --- a/Dynamic/ComInterop/ComObject.cs +++ b/Dynamic/ComInterop/ComObject.cs @@ -16,9 +16,9 @@ using System.Security; using System.Security.Permissions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// The ComObject class wraps a runtime-callable-wrapper and enables it to be used with the Dynamic Language Runtime and the C# dynamic keyword. /// diff --git a/Dynamic/ComInterop/ComParamDesc.cs b/Dynamic/ComInterop/ComParamDesc.cs index 35b2f917..2cb0efae 100644 --- a/Dynamic/ComInterop/ComParamDesc.cs +++ b/Dynamic/ComInterop/ComParamDesc.cs @@ -10,7 +10,7 @@ using Marshal = System.Runtime.InteropServices.Marshal; using VarEnum = System.Runtime.InteropServices.VarEnum; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// The parameter description of a method defined in a type library @@ -35,7 +35,7 @@ public class ComParamDesc { /// Creates a representation for the paramter of a COM method /// internal ComParamDesc(ref ELEMDESC elemDesc, string name) { - // Ensure _defaultValue is set to DBNull.Value regardless of whether or not the + // Ensure _defaultValue is set to DBNull.Value regardless of whether or not the // default value is extracted from the parameter description. Failure to do so // yields a runtime exception in the ToString() function. _defaultValue = DBNull.Value; diff --git a/Dynamic/ComInterop/ComRuntimeHelpers.cs b/Dynamic/ComInterop/ComRuntimeHelpers.cs index 24f0bbbb..bc8e8d51 100644 --- a/Dynamic/ComInterop/ComRuntimeHelpers.cs +++ b/Dynamic/ComInterop/ComRuntimeHelpers.cs @@ -14,12 +14,12 @@ using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; using ComTypes = System.Runtime.InteropServices.ComTypes; -using Microsoft.Scripting.Generation; +using Riverside.Scripting.Generation; using System.Linq; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal static class ComRuntimeHelpers { diff --git a/Dynamic/ComInterop/ComType.cs b/Dynamic/ComInterop/ComType.cs index 7b72c903..f9be7de5 100644 --- a/Dynamic/ComInterop/ComType.cs +++ b/Dynamic/ComInterop/ComType.cs @@ -4,7 +4,7 @@ #if FEATURE_COM -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { public enum ComType { Class, diff --git a/Dynamic/ComInterop/ComTypeClassDesc.cs b/Dynamic/ComInterop/ComTypeClassDesc.cs index 35c562a9..9591c688 100644 --- a/Dynamic/ComInterop/ComTypeClassDesc.cs +++ b/Dynamic/ComInterop/ComTypeClassDesc.cs @@ -13,13 +13,13 @@ using ComTypes = System.Runtime.InteropServices.ComTypes; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { public class ComTypeClassDesc : ComTypeDesc, IDynamicMetaObjectProvider { private LinkedList _itfs; // implemented interfaces private LinkedList _sourceItfs; // source interfaces supported by this coclass private Type _typeObj; - + public object CreateInstance() { if (_typeObj == null) { _typeObj = Type.GetTypeFromCLSID(Guid); diff --git a/Dynamic/ComInterop/ComTypeDesc.cs b/Dynamic/ComInterop/ComTypeDesc.cs index 34e7adf6..864b53ed 100644 --- a/Dynamic/ComInterop/ComTypeDesc.cs +++ b/Dynamic/ComInterop/ComTypeDesc.cs @@ -10,12 +10,12 @@ using System.Runtime.InteropServices.ComTypes; using System.Threading; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { public class ComTypeDesc : ComTypeLibMemberDesc { private string _typeName; private string _documentation; - //Hashtable is threadsafe for multiple readers single writer. + //Hashtable is threadsafe for multiple readers single writer. //Enumerating and writing is mutually exclusive so require locking. private Hashtable _funcs; private Hashtable _puts; @@ -32,7 +32,7 @@ internal ComTypeDesc(ITypeInfo typeInfo, ComType memberType, ComTypeLibDesc type TypeLib = typeLibDesc; } - + internal static ComTypeDesc FromITypeInfo(ITypeInfo typeInfo, TYPEATTR typeAttr) { switch (typeAttr.typekind) { diff --git a/Dynamic/ComInterop/ComTypeEnumDesc.cs b/Dynamic/ComInterop/ComTypeEnumDesc.cs index f3f00627..0b21d00a 100644 --- a/Dynamic/ComInterop/ComTypeEnumDesc.cs +++ b/Dynamic/ComInterop/ComTypeEnumDesc.cs @@ -14,7 +14,7 @@ using ComTypes = System.Runtime.InteropServices.ComTypes; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { public sealed class ComTypeEnumDesc : ComTypeDesc, IDynamicMetaObjectProvider { private readonly string[] _memberNames; diff --git a/Dynamic/ComInterop/ComTypeLibDesc.cs b/Dynamic/ComInterop/ComTypeLibDesc.cs index b490fd45..28916202 100644 --- a/Dynamic/ComInterop/ComTypeLibDesc.cs +++ b/Dynamic/ComInterop/ComTypeLibDesc.cs @@ -12,11 +12,11 @@ using System.Globalization; using ComTypes = System.Runtime.InteropServices.ComTypes; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// Cached information from a TLB. Only information that is required is saved. CoClasses are used - /// for event hookup. Enums are stored for accessing symbolic names from scripts. + /// for event hookup. Enums are stored for accessing symbolic names from scripts. /// public sealed class ComTypeLibDesc : IDynamicMetaObjectProvider { @@ -116,7 +116,7 @@ internal static ComTypeLibDesc GetFromTypeLib(ComTypes.ITypeLib typeLib) { } else if (typeKind == ComTypes.TYPEKIND.TKIND_ENUM) { ComTypeEnumDesc enumDesc = new ComTypeEnumDesc(typeInfo, typeLibDesc); typeLibDesc._enums.Add(enumDesc.TypeName, enumDesc); - } + } else if (typeKind == ComTypes.TYPEKIND.TKIND_ALIAS) { ComTypes.TYPEATTR typeAttr = ComRuntimeHelpers.GetTypeAttrForTypeInfo(typeInfo); if (typeAttr.tdescAlias.vt == (short)VarEnum.VT_USERDEFINED) { diff --git a/Dynamic/ComInterop/ComTypeLibInfo.cs b/Dynamic/ComInterop/ComTypeLibInfo.cs index 1bd55055..e3fe8c40 100644 --- a/Dynamic/ComInterop/ComTypeLibInfo.cs +++ b/Dynamic/ComInterop/ComTypeLibInfo.cs @@ -9,7 +9,7 @@ using System; using System.Dynamic; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { public sealed class ComTypeLibInfo : IDynamicMetaObjectProvider { private readonly ComTypeLibDesc _typeLibDesc; diff --git a/Dynamic/ComInterop/ComTypeLibMemberDesc.cs b/Dynamic/ComInterop/ComTypeLibMemberDesc.cs index 318820a3..d38e2cb3 100644 --- a/Dynamic/ComInterop/ComTypeLibMemberDesc.cs +++ b/Dynamic/ComInterop/ComTypeLibMemberDesc.cs @@ -4,7 +4,7 @@ #if FEATURE_COM -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { public class ComTypeLibMemberDesc { internal ComTypeLibMemberDesc(ComType kind) { diff --git a/Dynamic/ComInterop/ConversionArgBuilder.cs b/Dynamic/ComInterop/ConversionArgBuilder.cs index 5947b7a9..2af71c5b 100644 --- a/Dynamic/ComInterop/ConversionArgBuilder.cs +++ b/Dynamic/ComInterop/ConversionArgBuilder.cs @@ -7,9 +7,9 @@ using System; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal class ConversionArgBuilder : ArgBuilder { private readonly SimpleArgBuilder _innerBuilder; diff --git a/Dynamic/ComInterop/ConvertArgBuilder.cs b/Dynamic/ComInterop/ConvertArgBuilder.cs index c0a51bb0..29d56a1d 100644 --- a/Dynamic/ComInterop/ConvertArgBuilder.cs +++ b/Dynamic/ComInterop/ConvertArgBuilder.cs @@ -8,7 +8,7 @@ using System; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal class ConvertArgBuilder : SimpleArgBuilder { private readonly Type _marshalType; diff --git a/Dynamic/ComInterop/ConvertibleArgBuilder.cs b/Dynamic/ComInterop/ConvertibleArgBuilder.cs index 1f074647..0ae48b1e 100644 --- a/Dynamic/ComInterop/ConvertibleArgBuilder.cs +++ b/Dynamic/ComInterop/ConvertibleArgBuilder.cs @@ -8,9 +8,9 @@ using System; using System.Globalization; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal class ConvertibleArgBuilder : ArgBuilder { diff --git a/Dynamic/ComInterop/CurrencyArgBuilder.cs b/Dynamic/ComInterop/CurrencyArgBuilder.cs index 69163a5c..1252cdda 100644 --- a/Dynamic/ComInterop/CurrencyArgBuilder.cs +++ b/Dynamic/ComInterop/CurrencyArgBuilder.cs @@ -11,7 +11,7 @@ using System.Diagnostics; using System.Runtime.InteropServices; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal sealed class CurrencyArgBuilder : SimpleArgBuilder { internal CurrencyArgBuilder(Type parameterType) : base(parameterType) { diff --git a/Dynamic/ComInterop/DateTimeArgBuilder.cs b/Dynamic/ComInterop/DateTimeArgBuilder.cs index 11c64f49..0309ff75 100644 --- a/Dynamic/ComInterop/DateTimeArgBuilder.cs +++ b/Dynamic/ComInterop/DateTimeArgBuilder.cs @@ -12,7 +12,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal sealed class DateTimeArgBuilder : SimpleArgBuilder { internal DateTimeArgBuilder(Type parameterType) : base(parameterType) { diff --git a/Dynamic/ComInterop/DispCallable.cs b/Dynamic/ComInterop/DispCallable.cs index 4bdc2d55..c24dd4b5 100644 --- a/Dynamic/ComInterop/DispCallable.cs +++ b/Dynamic/ComInterop/DispCallable.cs @@ -9,7 +9,7 @@ using System.Dynamic; using System.Globalization; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// This represents a bound dispmember on a IDispatch object. diff --git a/Dynamic/ComInterop/DispCallableMetaObject.cs b/Dynamic/ComInterop/DispCallableMetaObject.cs index 67d08fd0..0c088c07 100644 --- a/Dynamic/ComInterop/DispCallableMetaObject.cs +++ b/Dynamic/ComInterop/DispCallableMetaObject.cs @@ -11,7 +11,7 @@ using System.Security; using System.Security.Permissions; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal class DispCallableMetaObject : DynamicMetaObject { private readonly DispCallable _callable; diff --git a/Dynamic/ComInterop/DispatchArgBuilder.cs b/Dynamic/ComInterop/DispatchArgBuilder.cs index d9bebdfb..5801f8bd 100644 --- a/Dynamic/ComInterop/DispatchArgBuilder.cs +++ b/Dynamic/ComInterop/DispatchArgBuilder.cs @@ -11,7 +11,7 @@ using System.Linq.Expressions; using System.Runtime.InteropServices; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal class DispatchArgBuilder : SimpleArgBuilder { private readonly bool _isWrapper; diff --git a/Dynamic/ComInterop/ErrorArgBuilder.cs b/Dynamic/ComInterop/ErrorArgBuilder.cs index 655764be..a99f1243 100644 --- a/Dynamic/ComInterop/ErrorArgBuilder.cs +++ b/Dynamic/ComInterop/ErrorArgBuilder.cs @@ -12,7 +12,7 @@ using System.Runtime.InteropServices; using System.Diagnostics; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal class ErrorArgBuilder : SimpleArgBuilder { internal ErrorArgBuilder(Type parameterType) : base(parameterType) { diff --git a/Dynamic/ComInterop/Errors.cs b/Dynamic/ComInterop/Errors.cs index 3c600036..9f93e6a4 100644 --- a/Dynamic/ComInterop/Errors.cs +++ b/Dynamic/ComInterop/Errors.cs @@ -5,7 +5,7 @@ #if FEATURE_COM using System; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { #region Generated Com Exception Factory @@ -314,4 +314,4 @@ internal static Exception VariantGetAccessorNYI(object p0) { #endregion } -#endif \ No newline at end of file +#endif diff --git a/Dynamic/ComInterop/ExcepInfo.cs b/Dynamic/ComInterop/ExcepInfo.cs index 65110aa4..5a489372 100644 --- a/Dynamic/ComInterop/ExcepInfo.cs +++ b/Dynamic/ComInterop/ExcepInfo.cs @@ -12,7 +12,7 @@ using System.Security; using ComTypes = System.Runtime.InteropServices.ComTypes; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// This is similar to ComTypes.EXCEPINFO, but lets us do our own custom marshaling /// diff --git a/Dynamic/ComInterop/Helpers.cs b/Dynamic/ComInterop/Helpers.cs index a91481be..fbe19a47 100644 --- a/Dynamic/ComInterop/Helpers.cs +++ b/Dynamic/ComInterop/Helpers.cs @@ -7,7 +7,7 @@ using System; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { // Miscellaneous helpers that don't belong anywhere else internal static class Helpers { diff --git a/Dynamic/ComInterop/IDispatchComObject.cs b/Dynamic/ComInterop/IDispatchComObject.cs index 7dc37142..c6c56853 100644 --- a/Dynamic/ComInterop/IDispatchComObject.cs +++ b/Dynamic/ComInterop/IDispatchComObject.cs @@ -18,71 +18,71 @@ using System.Security; using System.Security.Permissions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; using ComTypes = System.Runtime.InteropServices.ComTypes; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// An object that implements IDispatch - /// + /// /// This currently has the following issues: /// 1. If we prefer ComObjectWithTypeInfo over IDispatchComObject, then we will often not - /// IDispatchComObject since implementations of IDispatch often rely on a registered type library. + /// IDispatchComObject since implementations of IDispatch often rely on a registered type library. /// If we prefer IDispatchComObject over ComObjectWithTypeInfo, users get a non-ideal experience. - /// 2. IDispatch cannot distinguish between properties and methods with 0 arguments (and non-0 - /// default arguments?). So obj.foo() is ambiguous as it could mean invoking method foo, + /// 2. IDispatch cannot distinguish between properties and methods with 0 arguments (and non-0 + /// default arguments?). So obj.foo() is ambiguous as it could mean invoking method foo, /// or it could mean invoking the function pointer returned by property foo. /// We are attempting to find whether we need to call a method or a property by examining /// the ITypeInfo associated with the IDispatch. ITypeInfo tell's use what parameters the method - /// expects, is it a method or a property, what is the default property of the object, how to + /// expects, is it a method or a property, what is the default property of the object, how to /// create an enumerator for collections etc. - /// 3. IronPython processes the signature and converts ref arguments into return values. - /// However, since the signature of a DispMethod is not available beforehand, this conversion - /// is not possible. There could be other signature conversions that may be affected. How does + /// 3. IronPython processes the signature and converts ref arguments into return values. + /// However, since the signature of a DispMethod is not available beforehand, this conversion + /// is not possible. There could be other signature conversions that may be affected. How does /// VB6 deal with ref arguments and IDispatch? - /// + /// /// We also support events for IDispatch objects: /// Background: /// COM objects support events through a mechanism known as Connect Points. - /// Connection Points are separate objects created off the actual COM + /// Connection Points are separate objects created off the actual COM /// object (this is to prevent circular references between event sink - /// and event source). When clients want to sink events generated by - /// COM object they would implement callback interfaces (aka source - /// interfaces) and hand it over (advise) to the Connection Point. - /// + /// and event source). When clients want to sink events generated by + /// COM object they would implement callback interfaces (aka source + /// interfaces) and hand it over (advise) to the Connection Point. + /// /// Implementation details: /// When IDispatchComObject.TryGetMember request is received we first check /// whether the requested member is a property or a method. If this check - /// fails we will try to determine whether an event is requested. To do + /// fails we will try to determine whether an event is requested. To do /// so we will do the following set of steps: /// 1. Verify the COM object implements IConnectionPointContainer /// 2. Attempt to find COM object's coclass's description /// a. Query the object for IProvideClassInfo interface. Go to 3, if found /// b. From object's IDispatch retrieve primary interface description /// c. Scan coclasses declared in object's type library. - /// d. Find coclass implementing this particular primary interface + /// d. Find coclass implementing this particular primary interface /// 3. Scan coclass for all its source interfaces. - /// 4. Check whether to any of the methods on the source interfaces matches + /// 4. Check whether to any of the methods on the source interfaces matches /// the request name - /// + /// /// Once we determine that TryGetMember requests an event we will return /// an instance of BoundDispEvent class. This class has InPlaceAdd and /// InPlaceSubtract operators defined. Calling InPlaceAdd operator will: - /// 1. An instance of ComEventSinksContainer class is created (unless + /// 1. An instance of ComEventSinksContainer class is created (unless /// RCW already had one). This instance is hanged off the RCW in attempt /// to bind the lifetime of event sinks to the lifetime of the RCW itself, /// meaning event sink will be collected once the RCW is collected (this /// is the same way event sinks lifetime is controlled by PIAs). /// Notice: ComEventSinksContainer contains a Finalizer which will go and /// unadvise all event sinks. - /// Notice: ComEventSinksContainer is a list of ComEventSink objects. - /// 2. Unless we have already created a ComEventSink for the required + /// Notice: ComEventSinksContainer is a list of ComEventSink objects. + /// 2. Unless we have already created a ComEventSink for the required /// source interface, we will create and advise a new ComEventSink. Each - /// ComEventSink implements a single source interface that COM object - /// supports. - /// 3. ComEventSink contains a map between method DISPIDs to the + /// ComEventSink implements a single source interface that COM object + /// supports. + /// 3. ComEventSink contains a map between method DISPIDs to the /// multicast delegate that will be invoked when the event is raised. /// 4. ComEventSink implements IReflect interface which is exposed as /// custom IDispatch to COM consumers. This allows us to intercept calls @@ -310,7 +310,7 @@ internal override IList> GetMembers(IEnumerable(method.Name, value)); - //evaluation failed for some reason. pass exception out + //evaluation failed for some reason. pass exception out } catch (Exception ex) { members.Add(new KeyValuePair(method.Name, ex)); } @@ -463,7 +463,7 @@ private static ComTypes.ITypeInfo GetCoClassTypeInfo(object rcw, ComTypes.ITypeI } } - // retrieving class information through IPCI has failed - + // retrieving class information through IPCI has failed - // we can try scanning the typelib to find the coclass typeInfo.GetContainingTypeLib(out ComTypes.ITypeLib typeLib, out int _); @@ -528,7 +528,7 @@ private void EnsureScanDefinedMethods() { puts.Add(name, method); // for the special dispId == 0, we need to store - // the method descriptor for the Do(SetItem) binder. + // the method descriptor for the Do(SetItem) binder. if (method.DispId == ComDispIds.DISPID_VALUE && setItem == null) { setItem = method; } @@ -537,7 +537,7 @@ private void EnsureScanDefinedMethods() { if ((funcDesc.invkind & ComTypes.INVOKEKIND.INVOKE_PROPERTYPUTREF) != 0) { putrefs.Add(name, method); // for the special dispId == 0, we need to store - // the method descriptor for the Do(SetItem) binder. + // the method descriptor for the Do(SetItem) binder. if (method.DispId == ComDispIds.DISPID_VALUE && setItem == null) { setItem = method; } @@ -551,8 +551,8 @@ private void EnsureScanDefinedMethods() { funcs.Add(name, method); - // for the special dispId == 0, we need to store the method descriptor - // for the Do(GetItem) binder. + // for the special dispId == 0, we need to store the method descriptor + // for the Do(GetItem) binder. if (funcDesc.memid == ComDispIds.DISPID_VALUE) { getItem = method; } diff --git a/Dynamic/ComInterop/IDispatchMetaObject.cs b/Dynamic/ComInterop/IDispatchMetaObject.cs index 28ae1387..5fb849a8 100644 --- a/Dynamic/ComInterop/IDispatchMetaObject.cs +++ b/Dynamic/ComInterop/IDispatchMetaObject.cs @@ -6,9 +6,9 @@ using System.Dynamic; using System.Linq.Expressions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal sealed class IDispatchMetaObject : ComFallbackMetaObject { private readonly IDispatchComObject _self; diff --git a/Dynamic/ComInterop/IPseudoComObject.cs b/Dynamic/ComInterop/IPseudoComObject.cs index a4e2c57d..95dcf74d 100644 --- a/Dynamic/ComInterop/IPseudoComObject.cs +++ b/Dynamic/ComInterop/IPseudoComObject.cs @@ -8,10 +8,10 @@ using System; using System.Dynamic; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { interface IPseudoComObject { DynamicMetaObject GetMetaObject(Expression expression); } } -#endif \ No newline at end of file +#endif diff --git a/Dynamic/ComInterop/NullArgBuilder.cs b/Dynamic/ComInterop/NullArgBuilder.cs index f379463b..385ad0b2 100644 --- a/Dynamic/ComInterop/NullArgBuilder.cs +++ b/Dynamic/ComInterop/NullArgBuilder.cs @@ -8,10 +8,10 @@ using System; using System.Diagnostics; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// - /// ArgBuilder which always produces null. + /// ArgBuilder which always produces null. /// internal sealed class NullArgBuilder : ArgBuilder { internal NullArgBuilder() { } diff --git a/Dynamic/ComInterop/SimpleArgBuilder.cs b/Dynamic/ComInterop/SimpleArgBuilder.cs index a5886084..b3be8a4a 100644 --- a/Dynamic/ComInterop/SimpleArgBuilder.cs +++ b/Dynamic/ComInterop/SimpleArgBuilder.cs @@ -8,7 +8,7 @@ using System; using System.Diagnostics; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// SimpleArgBuilder produces the value produced by the user as the argument value. It /// also tracks information about the original parameter and is used to create extended diff --git a/Dynamic/ComInterop/SplatCallSite.cs b/Dynamic/ComInterop/SplatCallSite.cs index afe3264d..5194b578 100644 --- a/Dynamic/ComInterop/SplatCallSite.cs +++ b/Dynamic/ComInterop/SplatCallSite.cs @@ -8,9 +8,9 @@ using System; using System.Diagnostics; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal sealed class SplatCallSite { // Stored callable Delegate or IDynamicMetaObjectProvider. @@ -43,4 +43,4 @@ internal object Invoke(object[] args) { } } } -#endif \ No newline at end of file +#endif diff --git a/Dynamic/ComInterop/StringArgBuilder.cs b/Dynamic/ComInterop/StringArgBuilder.cs index 3712d6f4..6ddb37aa 100644 --- a/Dynamic/ComInterop/StringArgBuilder.cs +++ b/Dynamic/ComInterop/StringArgBuilder.cs @@ -11,7 +11,7 @@ using System.Runtime.InteropServices; using System.Diagnostics; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal class StringArgBuilder : SimpleArgBuilder { private readonly bool _isWrapper; diff --git a/Dynamic/ComInterop/TypeEnumMetaObject.cs b/Dynamic/ComInterop/TypeEnumMetaObject.cs index 8c96e9b9..99735355 100644 --- a/Dynamic/ComInterop/TypeEnumMetaObject.cs +++ b/Dynamic/ComInterop/TypeEnumMetaObject.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; using System.Dynamic; -using Microsoft.Scripting.Runtime; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Runtime; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal class TypeEnumMetaObject : DynamicMetaObject { private readonly ComTypeEnumDesc _desc; diff --git a/Dynamic/ComInterop/TypeLibInfoMetaObject.cs b/Dynamic/ComInterop/TypeLibInfoMetaObject.cs index 9cb0a8d6..dc103fa4 100644 --- a/Dynamic/ComInterop/TypeLibInfoMetaObject.cs +++ b/Dynamic/ComInterop/TypeLibInfoMetaObject.cs @@ -7,10 +7,10 @@ using System.Collections.Generic; using System.Dynamic; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal sealed class TypeLibInfoMetaObject : DynamicMetaObject { private readonly ComTypeLibInfo _info; diff --git a/Dynamic/ComInterop/TypeLibMetaObject.cs b/Dynamic/ComInterop/TypeLibMetaObject.cs index 819c4a84..5053a62f 100644 --- a/Dynamic/ComInterop/TypeLibMetaObject.cs +++ b/Dynamic/ComInterop/TypeLibMetaObject.cs @@ -7,9 +7,9 @@ using System.Collections.Generic; using System.Dynamic; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal class TypeLibMetaObject : DynamicMetaObject { private readonly ComTypeLibDesc _lib; diff --git a/Dynamic/ComInterop/TypeUtils.cs b/Dynamic/ComInterop/TypeUtils.cs index e8ffe8c0..f71a2fbb 100644 --- a/Dynamic/ComInterop/TypeUtils.cs +++ b/Dynamic/ComInterop/TypeUtils.cs @@ -10,7 +10,7 @@ using System.Linq.Expressions; using System.Reflection; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal static class TypeUtils { internal const MethodAttributes PublicStatic = MethodAttributes.Public | MethodAttributes.Static; diff --git a/Dynamic/ComInterop/UnknownArgBuilder.cs b/Dynamic/ComInterop/UnknownArgBuilder.cs index a3bbd5d8..90d43c66 100644 --- a/Dynamic/ComInterop/UnknownArgBuilder.cs +++ b/Dynamic/ComInterop/UnknownArgBuilder.cs @@ -12,7 +12,7 @@ using System.Runtime.InteropServices; using System.Diagnostics; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal class UnknownArgBuilder : SimpleArgBuilder { private readonly bool _isWrapper; diff --git a/Dynamic/ComInterop/VarEnumSelector.cs b/Dynamic/ComInterop/VarEnumSelector.cs index 2582c3d4..f9f8e964 100644 --- a/Dynamic/ComInterop/VarEnumSelector.cs +++ b/Dynamic/ComInterop/VarEnumSelector.cs @@ -10,10 +10,10 @@ using System.Diagnostics; using System.Reflection; using System.Runtime.InteropServices; -using Microsoft.Scripting.ComInterop; -using Microsoft.Scripting; +using Riverside.Scripting.ComInterop; +using Riverside.Scripting; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// If a managed user type (as opposed to a primitive type or a COM object) is passed as an argument to a COM call, we need /// to determine the VarEnum type we will marshal it as. We have the following options: @@ -22,10 +22,10 @@ namespace Microsoft.Scripting.ComInterop { /// cast would be needed. /// 2. We could marshal it as VT_DISPATCH. Then COM code will be able to access all the APIs in a late-bound manner, /// but old COM components will probably malfunction if they expect a primitive type. - /// 3. We could guess which primitive type is the closest match. This will make COM components be as easily + /// 3. We could guess which primitive type is the closest match. This will make COM components be as easily /// accessible as .NET methods. /// 4. We could use the type library to check what the expected type is. However, the type library may not be available. - /// + /// /// VarEnumSelector implements option # 3 /// internal class VarEnumSelector { @@ -51,9 +51,9 @@ internal VariantBuilder[] VariantBuilders { /// /// Gets the managed type that an object needs to be coverted to in order for it to be able /// to be represented as a Variant. - /// + /// /// In general, there is a many-to-many mapping between Type and VarEnum. However, this method - /// returns a simple mapping that is needed for the current implementation. The reason for the + /// returns a simple mapping that is needed for the current implementation. The reason for the /// many-to-many relation is: /// 1. Int32 maps to VT_I4 as well as VT_ERROR, and Decimal maps to VT_DECIMAL and VT_CY. However, /// this changes if you throw the wrapper types into the mix. @@ -299,7 +299,7 @@ private static bool TryGetPrimitiveComTypeViaConversion(Type argumentType, out V private VarEnum GetComType(ref Type argumentType) { if (argumentType == typeof(Missing)) { - //actual variant type will be VT_ERROR | E_PARAMNOTFOUND + //actual variant type will be VT_ERROR | E_PARAMNOTFOUND return VarEnum.VT_RECORD; } @@ -334,7 +334,7 @@ private VarEnum GetComType(ref Type argumentType) { // Many languages require an explicit cast for an enum to be used as the underlying type. // However, we want to allow this conversion for COM without requiring an explicit cast - // so that enums from interop assemblies can be used as arguments. + // so that enums from interop assemblies can be used as arguments. if (argumentType.IsEnum) { argumentType = Enum.GetUnderlyingType(argumentType); return GetComType(ref argumentType); @@ -381,7 +381,7 @@ private VariantBuilder GetVariantBuilder(Type argumentType) { VarEnum elementVarEnum; if (elementType == typeof(object) || elementType == typeof(DBNull)) { - //no meaningful value to pass ByRef. + //no meaningful value to pass ByRef. //perhaps the calee will replace it with something. //need to pass as a variant reference elementVarEnum = VarEnum.VT_VARIANT; @@ -401,8 +401,8 @@ private VariantBuilder GetVariantBuilder(Type argumentType) { // This helper is called when we are looking for a ByVal marshalling - // In a ByVal case we can take into account conversions or IConvertible if all other - // attempts to find marshalling type failed + // In a ByVal case we can take into account conversions or IConvertible if all other + // attempts to find marshalling type failed private static ArgBuilder GetByValArgBuilder(Type elementType, ref VarEnum elementVarEnum) { // If VT indicates that marshalling type is unknown. if (elementVarEnum == VT_DEFAULT) { diff --git a/Dynamic/ComInterop/Variant.cs b/Dynamic/ComInterop/Variant.cs index 53d13605..24287dd5 100644 --- a/Dynamic/ComInterop/Variant.cs +++ b/Dynamic/ComInterop/Variant.cs @@ -16,10 +16,10 @@ using System.Security; using System.Security.Permissions; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// Variant is the basic COM type for late-binding. It can contain any other COM data type. diff --git a/Dynamic/ComInterop/VariantArgBuilder.cs b/Dynamic/ComInterop/VariantArgBuilder.cs index 95c7073d..2ddb1358 100644 --- a/Dynamic/ComInterop/VariantArgBuilder.cs +++ b/Dynamic/ComInterop/VariantArgBuilder.cs @@ -12,7 +12,7 @@ using System.Diagnostics; using System.Reflection; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { internal class VariantArgBuilder : SimpleArgBuilder { private readonly bool _isWrapper; diff --git a/Dynamic/ComInterop/VariantArray.cs b/Dynamic/ComInterop/VariantArray.cs index a9901e02..1f15e508 100644 --- a/Dynamic/ComInterop/VariantArray.cs +++ b/Dynamic/ComInterop/VariantArray.cs @@ -13,7 +13,7 @@ using System.Reflection.Emit; using System.Runtime.InteropServices; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { [StructLayout(LayoutKind.Sequential)] internal struct VariantArray1 { @@ -91,4 +91,4 @@ private static Type CreateCustomType(int size) { } } -#endif \ No newline at end of file +#endif diff --git a/Dynamic/ComInterop/VariantBuilder.cs b/Dynamic/ComInterop/VariantBuilder.cs index fb7ace3f..f9102f82 100644 --- a/Dynamic/ComInterop/VariantBuilder.cs +++ b/Dynamic/ComInterop/VariantBuilder.cs @@ -10,7 +10,7 @@ using System.Diagnostics; using System.Runtime.InteropServices; -namespace Microsoft.Scripting.ComInterop { +namespace Riverside.Scripting.ComInterop { /// /// VariantBuilder handles packaging of arguments into a Variant for a call to IDispatch.Invoke @@ -43,7 +43,7 @@ internal Expression InitializeArgumentVariant(MemberExpression variant, Expressi // paramVariants._elementN.SetAsByrefT(ref temp) Debug.Assert(TempVariable == null); var argExpr = _argBuilder.MarshalToRef(parameter); - + TempVariable = Expression.Variable(argExpr.Type, null); return Expression.Block( Expression.Assign(TempVariable, argExpr), @@ -57,7 +57,7 @@ internal Expression InitializeArgumentVariant(MemberExpression variant, Expressi Expression argument = _argBuilder.Marshal(parameter); - // we are forced to special case ConvertibleArgBuilder since it does not have + // we are forced to special case ConvertibleArgBuilder since it does not have // a corresponding _targetComType. if (_argBuilder is ConvertibleArgBuilder) { return Expression.Call( diff --git a/Dynamic/DebugOptions.cs b/Dynamic/DebugOptions.cs index bbfda4d6..604c3d90 100644 --- a/Dynamic/DebugOptions.cs +++ b/Dynamic/DebugOptions.cs @@ -5,13 +5,13 @@ using System.Security; using System; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// - /// This class holds onto internal debugging options used in this assembly. + /// This class holds onto internal debugging options used in this assembly. /// These options can be set via environment variables DLR_{option-name}. /// Boolean options map "true" to true and other values to false. - /// + /// /// These options are for internal debugging only, and should not be /// exposed through any public APIs. /// @@ -58,4 +58,4 @@ internal static bool TrackPerformance { get { return _trackPerformance; } } } -} \ No newline at end of file +} diff --git a/Dynamic/Debugging/CollectionUtils.cs b/Dynamic/Debugging/CollectionUtils.cs index 073bd654..d92c1363 100644 --- a/Dynamic/Debugging/CollectionUtils.cs +++ b/Dynamic/Debugging/CollectionUtils.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Text; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { internal static class CollectionUtils { internal static T[] RemoveLast(this T[] array) { T[] result = new T[array.Length - 1]; diff --git a/Dynamic/Debugging/CompilerServices/DebugLambdaInfo.cs b/Dynamic/Debugging/CompilerServices/DebugLambdaInfo.cs index 2276356e..3c988c41 100644 --- a/Dynamic/Debugging/CompilerServices/DebugLambdaInfo.cs +++ b/Dynamic/Debugging/CompilerServices/DebugLambdaInfo.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; -namespace Microsoft.Scripting.Debugging.CompilerServices { +namespace Riverside.Scripting.Debugging.CompilerServices { /// /// Used by compilers to provide additional debug information about LambdaExpression to DebugContext /// diff --git a/Dynamic/Debugging/CompilerServices/IDebugCompilerSupport.cs b/Dynamic/Debugging/CompilerServices/IDebugCompilerSupport.cs index e5e57cac..631bbe5f 100644 --- a/Dynamic/Debugging/CompilerServices/IDebugCompilerSupport.cs +++ b/Dynamic/Debugging/CompilerServices/IDebugCompilerSupport.cs @@ -4,7 +4,7 @@ using MSAst = System.Linq.Expressions; -namespace Microsoft.Scripting.Debugging.CompilerServices { +namespace Riverside.Scripting.Debugging.CompilerServices { /// /// Implemented by compilers to allow the traceback engine to get additional information. /// diff --git a/Dynamic/Debugging/DebugContext.GeneratorLoopProc.cs b/Dynamic/Debugging/DebugContext.GeneratorLoopProc.cs index 9afe30b6..d21d66af 100644 --- a/Dynamic/Debugging/DebugContext.GeneratorLoopProc.cs +++ b/Dynamic/Debugging/DebugContext.GeneratorLoopProc.cs @@ -7,7 +7,7 @@ using System.Diagnostics; using System.Threading; -namespace Microsoft.Scripting.Debugging.CompilerServices { +namespace Riverside.Scripting.Debugging.CompilerServices { public sealed partial class DebugContext { private static object _debugYieldValue; @@ -15,7 +15,7 @@ internal static object DebugYieldValue { get { if (_debugYieldValue == null) _debugYieldValue = new object(); - return _debugYieldValue; + return _debugYieldValue; } } diff --git a/Dynamic/Debugging/DebugContext.cs b/Dynamic/Debugging/DebugContext.cs index dfecdcb2..ad886523 100644 --- a/Dynamic/Debugging/DebugContext.cs +++ b/Dynamic/Debugging/DebugContext.cs @@ -9,9 +9,9 @@ using System.Linq.Expressions; using System.Threading; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Debugging.CompilerServices { +namespace Riverside.Scripting.Debugging.CompilerServices { /// /// Provides services to compilers for instrumenting code with tracebacks. @@ -142,7 +142,7 @@ internal static FunctionInfo CreateFunctionInfo( scopedVariables, variables, customPayload); - + foreach (DebugSourceSpan sourceSpan in (DebugSourceSpan[])locationSpanMap) { lock (sourceSpan.SourceFile.FunctionInfoMap) { sourceSpan.SourceFile.FunctionInfoMap[sourceSpan] = funcInfo; diff --git a/Dynamic/Debugging/DebugFrame.cs b/Dynamic/Debugging/DebugFrame.cs index 1fc7b7b8..059805ef 100644 --- a/Dynamic/Debugging/DebugFrame.cs +++ b/Dynamic/Debugging/DebugFrame.cs @@ -9,10 +9,10 @@ using System.Globalization; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Debugging.CompilerServices; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Debugging.CompilerServices; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { [DebuggerDisplay("FunctionInfo = {_funcInfo.Name}, CurrentSequencePointIndex = {CurrentSequencePointIndex}")] public sealed class DebugFrame { private FunctionInfo _funcInfo; @@ -202,7 +202,7 @@ internal DebugContext DebugContext { internal int CurrentLocationCookie { get { Debug.Assert(_generator != null || _liftedLocals is IDebugRuntimeVariables); - return (_generator == null ? ((IDebugRuntimeVariables)_liftedLocals).DebugMarker : + return (_generator == null ? ((IDebugRuntimeVariables)_liftedLocals).DebugMarker : (_generator.YieldMarkerLocation != Int32.MaxValue ? _generator.YieldMarkerLocation : _lastKnownGeneratorYieldMarker)); } } diff --git a/Dynamic/Debugging/DebugGenerator.cs b/Dynamic/Debugging/DebugGenerator.cs index a7bd0645..0e622bfa 100644 --- a/Dynamic/Debugging/DebugGenerator.cs +++ b/Dynamic/Debugging/DebugGenerator.cs @@ -6,7 +6,7 @@ using System.Collections; using System.Collections.Generic; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { /// /// Used to wrap a lambda that was already a generator prior to transform. /// diff --git a/Dynamic/Debugging/DebugInfoRewriter.cs b/Dynamic/Debugging/DebugInfoRewriter.cs index 838465e3..d3825142 100644 --- a/Dynamic/Debugging/DebugInfoRewriter.cs +++ b/Dynamic/Debugging/DebugInfoRewriter.cs @@ -10,14 +10,14 @@ using System.Diagnostics; using System.Globalization; using System.Linq.Expressions; -using Microsoft.Scripting.Debugging.CompilerServices; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Debugging.CompilerServices; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { using Ast = MSAst.Expression; using System.Threading; - + /// /// Used to rewrite expressions containing DebugInfoExpressions. /// diff --git a/Dynamic/Debugging/DebugMode.cs b/Dynamic/Debugging/DebugMode.cs index ffd83030..34a15596 100644 --- a/Dynamic/Debugging/DebugMode.cs +++ b/Dynamic/Debugging/DebugMode.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { internal enum DebugMode { Disabled, ExceptionsOnly, diff --git a/Dynamic/Debugging/DebugSourceFile.cs b/Dynamic/Debugging/DebugSourceFile.cs index 527bd067..6ce82373 100644 --- a/Dynamic/Debugging/DebugSourceFile.cs +++ b/Dynamic/Debugging/DebugSourceFile.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { public sealed class DebugSourceFile { private DebugMode _debugMode; private readonly Dictionary _functionInfoMap; diff --git a/Dynamic/Debugging/DebugSourceSpan.cs b/Dynamic/Debugging/DebugSourceSpan.cs index 074752a1..8b24e6f3 100644 --- a/Dynamic/Debugging/DebugSourceSpan.cs +++ b/Dynamic/Debugging/DebugSourceSpan.cs @@ -5,7 +5,7 @@ using System; using System.Diagnostics; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { /// /// Combines source file and span. Also provides Contains and Intersects functionality. /// @@ -47,7 +47,7 @@ internal int LineEnd { internal int ColumnEnd { get { return _columnEnd; } - } + } internal SourceSpan ToDlrSpan() { return new SourceSpan( diff --git a/Dynamic/Debugging/DebugThread.cs b/Dynamic/Debugging/DebugThread.cs index 99bb9301..a3798900 100644 --- a/Dynamic/Debugging/DebugThread.cs +++ b/Dynamic/Debugging/DebugThread.cs @@ -6,10 +6,10 @@ using System.Collections.Generic; using System.Diagnostics; -using Microsoft.Scripting.Debugging.CompilerServices; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Debugging.CompilerServices; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { [DebuggerDisplay("ThreadId = {_threadId}")] public abstract class DebugThread { private readonly int _threadId; @@ -24,9 +24,9 @@ internal DebugThread(DebugContext debugContext) { internal Exception ThrownException { get; set; } internal bool IsCurrentThread { - get + get { - return _threadId == ThreadingUtils.GetCurrentThreadId(); + return _threadId == ThreadingUtils.GetCurrentThreadId(); } } diff --git a/Dynamic/Debugging/DebuggableLambdaBuilder.cs b/Dynamic/Debugging/DebuggableLambdaBuilder.cs index 5002e8bb..4205aac8 100644 --- a/Dynamic/Debugging/DebuggableLambdaBuilder.cs +++ b/Dynamic/Debugging/DebuggableLambdaBuilder.cs @@ -7,12 +7,12 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using Microsoft.Scripting.Ast; -using Microsoft.Scripting.Debugging.CompilerServices; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Ast; +using Riverside.Scripting.Debugging.CompilerServices; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { using Ast = MSAst.Expression; /// @@ -371,7 +371,7 @@ private void CreateFunctionInfo(MSAst.LambdaExpression generatorFactoryLambda) { _debugMarkerLocationMap, _variableScopeMap, _variableInfos, - _lambdaInfo.CustomPayload), + _lambdaInfo.CustomPayload), typeof(FunctionInfo)); } } @@ -424,7 +424,7 @@ private MSAst.Expression TransformToGeneratorBody(MSAst.Expression body) { } } - // Don't perform leaf-frame optimization if the compiler didn't ask for it or + // Don't perform leaf-frame optimization if the compiler didn't ask for it or // if we found unconditional calls to other debuggable labmdas. _noPushFrameOptimization = !_lambdaInfo.OptimizeForLeafFrames || debugInfoToYieldRewriter.HasUnconditionalFunctionCalls; return transformedBody; @@ -492,9 +492,9 @@ private MSAst.LambdaExpression CreateOuterLambda(Type lambdaType, MSAst.Expressi // normal exit tryExpressions.Add( Ast.Block( - _retVal != null ? Ast.Assign(_retVal, debuggableBody) : debuggableBody, + _retVal != null ? Ast.Assign(_retVal, debuggableBody) : debuggableBody, Ast.Assign(_frameExitException, Ast.Constant(true)), - frameExit) + frameExit) ); tryExpressions.Add( @@ -535,7 +535,7 @@ private MSAst.LambdaExpression CreateOuterLambda(Type lambdaType, MSAst.Expressi ArrayUtils.Append(tryExpressions.ToArray(), Ast.Default(returnType)) ), Ast.Catch( - caughtException = Ast.Variable(typeof(Exception), "$caughtException"), + caughtException = Ast.Variable(typeof(Exception), "$caughtException"), Ast.Block( // The expressions below will always throw. // If the exception needs to be cancelled then OnTraceEvent will throw ForceToGeneratorLoopException. @@ -579,7 +579,7 @@ private MSAst.LambdaExpression CreateOuterLambda(Type lambdaType, MSAst.Expressi Ast.Block( returnType != typeof(void) ? Ast.Block( Ast.Assign( - _retValFromGeneratorLoop, + _retValFromGeneratorLoop, Ast.Call( typeof(RuntimeOps).GetMethod(nameof(RuntimeOps.GeneratorLoopProc)), _thread @@ -616,7 +616,7 @@ private MSAst.LambdaExpression CreateOuterLambda(Type lambdaType, MSAst.Expressi ), // Make sure that the debugMarker is up-to-date after the generator loop Ast.Assign( - _debugMarker, + _debugMarker, Ast.Call( typeof(RuntimeOps).GetMethod(nameof(RuntimeOps.GetCurrentSequencePointForLeafGeneratorFrame)), _thread diff --git a/Dynamic/Debugging/DefaultRuntimeVariablesImpl/DebugRuntimeVariables.cs b/Dynamic/Debugging/DefaultRuntimeVariablesImpl/DebugRuntimeVariables.cs index beb0ac7d..231ef50b 100644 --- a/Dynamic/Debugging/DefaultRuntimeVariablesImpl/DebugRuntimeVariables.cs +++ b/Dynamic/Debugging/DefaultRuntimeVariablesImpl/DebugRuntimeVariables.cs @@ -5,7 +5,7 @@ using System.Runtime.CompilerServices; using System.Diagnostics; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { /// /// Implementation of IDebugRuntimeVariables, which wraps IRuntimeVariables + FunctionInfo/DebugMarker /// diff --git a/Dynamic/Debugging/DefaultRuntimeVariablesImpl/DefaultDebugThread.cs b/Dynamic/Debugging/DefaultRuntimeVariablesImpl/DefaultDebugThread.cs index 55434d23..e6964aea 100644 --- a/Dynamic/Debugging/DefaultRuntimeVariablesImpl/DefaultDebugThread.cs +++ b/Dynamic/Debugging/DefaultRuntimeVariablesImpl/DefaultDebugThread.cs @@ -6,9 +6,9 @@ using System.Collections.Generic; using System.Diagnostics; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Debugging.CompilerServices; +using Riverside.Scripting.Debugging.CompilerServices; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { /// /// Default implementation of BaseDebugThread, which uses DLR's RuntimeVariablesExpression for lifting locals. /// diff --git a/Dynamic/Debugging/DefaultRuntimeVariablesImpl/DefaultDebugThreadFactory.cs b/Dynamic/Debugging/DefaultRuntimeVariablesImpl/DefaultDebugThreadFactory.cs index 9825072a..8a929978 100644 --- a/Dynamic/Debugging/DefaultRuntimeVariablesImpl/DefaultDebugThreadFactory.cs +++ b/Dynamic/Debugging/DefaultRuntimeVariablesImpl/DefaultDebugThreadFactory.cs @@ -5,16 +5,16 @@ using MSAst = System.Linq.Expressions; using System.Collections.Generic; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { using Ast = MSAst.Expression; /// /// Default implementation of IDebugThreadFactory, which uses DLR's RuntimeVariablesExpression for lifting locals. /// internal sealed class DefaultDebugThreadFactory : IDebugThreadFactory { - public DebugThread CreateDebugThread(Microsoft.Scripting.Debugging.CompilerServices.DebugContext debugContext) { + public DebugThread CreateDebugThread(Riverside.Scripting.Debugging.CompilerServices.DebugContext debugContext) { return new DefaultDebugThread(debugContext); } diff --git a/Dynamic/Debugging/DelegateHelpers.cs b/Dynamic/Debugging/DelegateHelpers.cs index f9559304..aab29bf2 100644 --- a/Dynamic/Debugging/DelegateHelpers.cs +++ b/Dynamic/Debugging/DelegateHelpers.cs @@ -7,9 +7,9 @@ using System; using System.Reflection; using System.Reflection.Emit; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { internal static class DelegateHelpers { private static ModuleBuilder _moduleBuilder; private const MethodAttributes CtorAttributes = MethodAttributes.RTSpecialName | MethodAttributes.HideBySig | MethodAttributes.Public; @@ -40,9 +40,9 @@ private static ModuleBuilder GetModule() { lock (_DelegateCtorSignature) { if (_moduleBuilder == null) { AssemblyBuilder assemblyBuilder = ReflectionUtils.DefineDynamicAssembly( - new AssemblyName("Snippets.Microsoft.Scripting.Debugging"), AssemblyBuilderAccess.Run); - - _moduleBuilder = assemblyBuilder.DefineDynamicModule("Snippets.Microsoft.Scripting.Debugging", true); + new AssemblyName("Snippets.Riverside.Scripting.Debugging"), AssemblyBuilderAccess.Run); + + _moduleBuilder = assemblyBuilder.DefineDynamicModule("Snippets.Riverside.Scripting.Debugging", true); } } return _moduleBuilder; diff --git a/Dynamic/Debugging/ForceToGeneratorLoopException.cs b/Dynamic/Debugging/ForceToGeneratorLoopException.cs index b29bb2ac..81a37ba9 100644 --- a/Dynamic/Debugging/ForceToGeneratorLoopException.cs +++ b/Dynamic/Debugging/ForceToGeneratorLoopException.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { [Serializable] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design","CA1032:ImplementStandardExceptionConstructors")] public sealed class ForceToGeneratorLoopException : Exception { diff --git a/Dynamic/Debugging/FunctionInfo.cs b/Dynamic/Debugging/FunctionInfo.cs index cecaf08b..79f83216 100644 --- a/Dynamic/Debugging/FunctionInfo.cs +++ b/Dynamic/Debugging/FunctionInfo.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Diagnostics; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { [DebuggerDisplay("{Name}")] public sealed class FunctionInfo { private readonly bool[] _traceLocations; diff --git a/Dynamic/Debugging/IDebugCallback.cs b/Dynamic/Debugging/IDebugCallback.cs index 2ceb3b82..f173a442 100644 --- a/Dynamic/Debugging/IDebugCallback.cs +++ b/Dynamic/Debugging/IDebugCallback.cs @@ -2,17 +2,17 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { internal interface IDebugCallback { /// /// Callback that is fired by the traceback engine /// void OnDebugEvent( - TraceEventKind kind, - DebugThread thread, - FunctionInfo functionInfo, + TraceEventKind kind, + DebugThread thread, + FunctionInfo functionInfo, int sequencePointIndex, - int stackDepth, + int stackDepth, object payload); } } diff --git a/Dynamic/Debugging/InvokeTargets.cs b/Dynamic/Debugging/InvokeTargets.cs index 98d5810d..ffacd696 100644 --- a/Dynamic/Debugging/InvokeTargets.cs +++ b/Dynamic/Debugging/InvokeTargets.cs @@ -8,7 +8,7 @@ using System.Collections; using System.Collections.Generic; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { using Ast = MSAst.Expression; internal static class InvokeTargets { diff --git a/Dynamic/Debugging/LambdaWalker.cs b/Dynamic/Debugging/LambdaWalker.cs index c8ff7d71..d1c1a854 100644 --- a/Dynamic/Debugging/LambdaWalker.cs +++ b/Dynamic/Debugging/LambdaWalker.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { /// /// Used to extract locals information from expressions. /// diff --git a/Dynamic/Debugging/Microsoft.Scripting.Debugging.Generated.cs b/Dynamic/Debugging/Riverside.Scripting.Debugging.Generated.cs similarity index 97% rename from Dynamic/Debugging/Microsoft.Scripting.Debugging.Generated.cs rename to Dynamic/Debugging/Riverside.Scripting.Debugging.Generated.cs index 36030f32..6f8f86bf 100644 --- a/Dynamic/Debugging/Microsoft.Scripting.Debugging.Generated.cs +++ b/Dynamic/Debugging/Riverside.Scripting.Debugging.Generated.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { #region Generated Exception Factory diff --git a/Dynamic/Debugging/RuntimeOps.cs b/Dynamic/Debugging/RuntimeOps.cs index 5d6c48c8..9fb768df 100644 --- a/Dynamic/Debugging/RuntimeOps.cs +++ b/Dynamic/Debugging/RuntimeOps.cs @@ -7,9 +7,9 @@ using System.Diagnostics; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Debugging.CompilerServices; +using Riverside.Scripting.Debugging.CompilerServices; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { public static class RuntimeOps { [Obsolete("do not call this method", true)] public static DebugFrame CreateFrameForGenerator(DebugContext debugContext, FunctionInfo func) { diff --git a/Dynamic/Debugging/RuntimeVariablesSupport/IDebugRuntimeVariables.cs b/Dynamic/Debugging/RuntimeVariablesSupport/IDebugRuntimeVariables.cs index d38f52c6..c8e74564 100644 --- a/Dynamic/Debugging/RuntimeVariablesSupport/IDebugRuntimeVariables.cs +++ b/Dynamic/Debugging/RuntimeVariablesSupport/IDebugRuntimeVariables.cs @@ -4,7 +4,7 @@ using System.Runtime.CompilerServices; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { /// /// IDebugRuntimeVariables is used to wrap IRuntimeVariables and add properties for retrieving /// FunctionInfo and DebugMarker from debuggable labmdas. diff --git a/Dynamic/Debugging/RuntimeVariablesSupport/IDebugThreadFactory.cs b/Dynamic/Debugging/RuntimeVariablesSupport/IDebugThreadFactory.cs index f6a67bcc..c94bccff 100644 --- a/Dynamic/Debugging/RuntimeVariablesSupport/IDebugThreadFactory.cs +++ b/Dynamic/Debugging/RuntimeVariablesSupport/IDebugThreadFactory.cs @@ -5,9 +5,9 @@ using MSAst = System.Linq.Expressions; using System.Collections.Generic; -using Microsoft.Scripting.Debugging.CompilerServices; +using Riverside.Scripting.Debugging.CompilerServices; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { /// /// IDebugThreadFactory is used to abstract how frames and local variables are maintained at run/debug time. /// diff --git a/Dynamic/Debugging/ScopedRuntimeVariables.cs b/Dynamic/Debugging/ScopedRuntimeVariables.cs index a5b382ad..82f8af7a 100644 --- a/Dynamic/Debugging/ScopedRuntimeVariables.cs +++ b/Dynamic/Debugging/ScopedRuntimeVariables.cs @@ -6,7 +6,7 @@ using System.Diagnostics; using System.Runtime.CompilerServices; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { /// /// Implements IRuntimeVariables in a way that preserves scoping within the lambda. /// diff --git a/Dynamic/Debugging/ThreadLocal.cs b/Dynamic/Debugging/ThreadLocal.cs index 1cba52d2..a72aab47 100644 --- a/Dynamic/Debugging/ThreadLocal.cs +++ b/Dynamic/Debugging/ThreadLocal.cs @@ -7,7 +7,7 @@ using System.Threading; using System.Diagnostics; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { internal class ThreadLocal { private StorageInfo[] _stores; // array of storage indexed by managed thread ID private static readonly StorageInfo[] Updating = Array.Empty(); // a marker used when updating the array @@ -78,7 +78,7 @@ private StorageInfo CreateStorageInfo() { StorageInfo newInfo = new StorageInfo(Thread.CurrentThread); // set to updating while potentially resizing/mutating, then we'll - // set back to the current value. + // set back to the current value. while ((curStorage = Interlocked.Exchange(ref _stores, Updating)) == Updating) { // another thread is already updating... Thread.Sleep(0); diff --git a/Dynamic/Debugging/TraceEventKind.cs b/Dynamic/Debugging/TraceEventKind.cs index 0d320ca3..d6548ee3 100644 --- a/Dynamic/Debugging/TraceEventKind.cs +++ b/Dynamic/Debugging/TraceEventKind.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { public enum TraceEventKind { // Fired when the execution enters a new frame // @@ -29,12 +29,12 @@ public enum TraceEventKind { TracePoint, // Fired when an exception is thrown during the execution - // + // // Payload: // the exception object that was thrown Exception, - // Fired when an exception is thrown and is not handled by + // Fired when an exception is thrown and is not handled by // the current method. // // Payload: diff --git a/Dynamic/Debugging/TracePipeline/ITraceCallback.cs b/Dynamic/Debugging/TracePipeline/ITraceCallback.cs index 70517770..050c1463 100644 --- a/Dynamic/Debugging/TracePipeline/ITraceCallback.cs +++ b/Dynamic/Debugging/TracePipeline/ITraceCallback.cs @@ -3,11 +3,11 @@ // See the LICENSE file in the project root for more information. using System; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; using System.Collections.Generic; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { public interface ITraceCallback { void OnTraceEvent( TraceEventKind kind, diff --git a/Dynamic/Debugging/TracePipeline/ITracePipeline.cs b/Dynamic/Debugging/TracePipeline/ITracePipeline.cs index a3705ed4..32233667 100644 --- a/Dynamic/Debugging/TracePipeline/ITracePipeline.cs +++ b/Dynamic/Debugging/TracePipeline/ITracePipeline.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { public interface ITracePipeline { void Close(); diff --git a/Dynamic/Debugging/TracePipeline/TracePipeline.cs b/Dynamic/Debugging/TracePipeline/TracePipeline.cs index 71e4cc5e..0decf571 100644 --- a/Dynamic/Debugging/TracePipeline/TracePipeline.cs +++ b/Dynamic/Debugging/TracePipeline/TracePipeline.cs @@ -5,14 +5,14 @@ using System; using System.Diagnostics; using System.Threading; -using Microsoft.Scripting.Debugging.CompilerServices; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Debugging.CompilerServices; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { /// /// TraceSession. - /// - /// Basically holds a list of last encountered DebugFrame instances + /// + /// Basically holds a list of last encountered DebugFrame instances /// (one per running thread). /// public sealed class TracePipeline : ITracePipeline, IDebugCallback { diff --git a/Dynamic/Debugging/VariableInfo.cs b/Dynamic/Debugging/VariableInfo.cs index e52dfe3d..4546d89c 100644 --- a/Dynamic/Debugging/VariableInfo.cs +++ b/Dynamic/Debugging/VariableInfo.cs @@ -5,13 +5,13 @@ using System; using System.Diagnostics; -namespace Microsoft.Scripting.Debugging { +namespace Riverside.Scripting.Debugging { /// /// Used to provide information about locals/parameters at debug time. /// [DebuggerDisplay("{Name}")] internal sealed class VariableInfo { - + /// /// Index within byref variables list or within strongbox variables list. /// diff --git a/Dynamic/Generation/AssemblyGen.cs b/Dynamic/Generation/AssemblyGen.cs index 1055f3b6..08bc8d35 100644 --- a/Dynamic/Generation/AssemblyGen.cs +++ b/Dynamic/Generation/AssemblyGen.cs @@ -15,10 +15,10 @@ using System.Text; using System.Threading; using System.Linq; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; using System.Collections.Generic; -namespace Microsoft.Scripting.Generation { +namespace Riverside.Scripting.Generation { public sealed class AssemblyGen { private readonly AssemblyBuilder _myAssembly; private readonly ModuleBuilder _myModule; @@ -66,7 +66,7 @@ public AssemblyGen(AssemblyName name, string outDir, string outFileExtension, bo } // mark the assembly transparent so that it works in partial trust: - var attributes = new List { + var attributes = new List { new CustomAttributeBuilder(typeof(SecurityTransparentAttribute).GetConstructor(ReflectionUtils.EmptyTypes), EmptyArray.Instance), #if FEATURE_SECURITY_RULES new CustomAttributeBuilder(typeof(SecurityRulesAttribute).GetConstructor(new[] { typeof(SecurityRuleSet) }), new object[] { SecurityRuleSet.Level1 }), @@ -79,7 +79,7 @@ public AssemblyGen(AssemblyName name, string outDir, string outFileExtension, bo continue; } - ConstructorInfo ctor = null; + ConstructorInfo ctor = null; switch(attr.Key) { case "assemblyFileVersion": ctor = typeof(AssemblyFileVersionAttribute).GetConstructor(new[] { typeof(string) }); @@ -98,7 +98,7 @@ public AssemblyGen(AssemblyName name, string outDir, string outFileExtension, bo if(ctor != null) { attributes.Add(new CustomAttributeBuilder(ctor, new object[] { a })); } - } + } } if (outDir != null) { @@ -313,7 +313,7 @@ internal TypeBuilder DefineType(string name, Type parent, TypeAttributes attr, b sb.Append(index); } - // There is a bug in Reflection.Emit that leads to + // There is a bug in Reflection.Emit that leads to // Unhandled Exception: System.Runtime.InteropServices.COMException (0x80131130): Record not found on lookup. // if there is any of the characters []*&+,\ in the type name and a method defined on the type is called. sb.Replace('+', '_').Replace('[', '_').Replace(']', '_').Replace('*', '_').Replace('&', '_').Replace(',', '_').Replace('\\', '_'); diff --git a/Dynamic/Generation/CompilerHelpers.cs b/Dynamic/Generation/CompilerHelpers.cs index fff161fc..4e4b8a7c 100644 --- a/Dynamic/Generation/CompilerHelpers.cs +++ b/Dynamic/Generation/CompilerHelpers.cs @@ -15,14 +15,14 @@ using System.Reflection.Emit; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Actions; -using Microsoft.Scripting.Ast; -using Microsoft.Scripting.Interpreter; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Actions; +using Riverside.Scripting.Ast; +using Riverside.Scripting.Interpreter; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Generation { +namespace Riverside.Scripting.Generation { // TODO: keep this? [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")] @@ -120,7 +120,7 @@ public static bool IsComparisonOperator(ExpressionType op) { /// /// Returns the System.Type for any object, including null. The type of null - /// is represented by None.Type and all other objects just return the + /// is represented by None.Type and all other objects just return the /// result of Object.GetType /// public static Type GetType(object obj) { @@ -170,7 +170,7 @@ public static bool CanOptimizeMethod(MethodBase method) { /// Given a MethodInfo which may be declared on a non-public type this attempts to /// return a MethodInfo which will dispatch to the original MethodInfo but is declared /// on a public type. - /// + /// /// Returns the original method if the method if a public version cannot be found. /// public static MethodInfo TryGetCallableMethod(Type targetType, MethodInfo method) { @@ -209,7 +209,7 @@ public static MethodInfo TryGetCallableMethod(Type targetType, MethodInfo method /// /// Non-public types can have public members that we find when calling type.GetMember(...). This /// filters out the non-visible members by attempting to resolve them to the correct visible type. - /// + /// /// If no correct visible type can be found then the member is not visible and we won't call it. /// public static IEnumerable FilterNonVisibleMembers(Type targetType, IEnumerable members) { @@ -649,11 +649,11 @@ public static void CompileToMethod(this LambdaExpression lambda, MethodBuilder m /// /// Compiles the LambdaExpression. - /// + /// /// If the lambda is compiled with emitDebugSymbols, it will be /// generated into a TypeBuilder. Otherwise, this method is the same as /// calling LambdaExpression.Compile() - /// + /// /// This is a workaround for a CLR limitiation: DynamicMethods cannot /// have debugging information. /// @@ -677,7 +677,7 @@ public static T Compile(this Expression lambda, bool emitDebugSymbols) { /// /// Compiles the LambdaExpression, emitting it into a new type, and /// optionally making it debuggable. - /// + /// /// This is a workaround for a CLR limitiation: DynamicMethods cannot /// have debugging information. /// @@ -705,7 +705,7 @@ public static Delegate CompileToMethod(LambdaExpression lambda, DebugInfoGenerat var finished = type.CreateType(); rewriter.InitializeFields(finished); - + return finished.GetMethod(method.Name).CreateDelegate(lambda.Type); } diff --git a/Dynamic/Generation/ConstantCheck.cs b/Dynamic/Generation/ConstantCheck.cs index 19aea7ea..70b991e2 100644 --- a/Dynamic/Generation/ConstantCheck.cs +++ b/Dynamic/Generation/ConstantCheck.cs @@ -5,9 +5,9 @@ using System.Linq.Expressions; using System.Diagnostics; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Generation { +namespace Riverside.Scripting.Generation { public static class ConstantCheck { @@ -65,7 +65,7 @@ private static bool CheckAndAlso(BinaryExpression node, object value) { if (node.Conversion != null) { return false; } - + if (value is bool b) { if (b) { return IsConstant(node.Left, true) && IsConstant(node.Right, true); diff --git a/Dynamic/Generation/DelegateHelpers.Generated.cs b/Dynamic/Generation/DelegateHelpers.Generated.cs index c57a3847..039852ad 100644 --- a/Dynamic/Generation/DelegateHelpers.Generated.cs +++ b/Dynamic/Generation/DelegateHelpers.Generated.cs @@ -5,9 +5,9 @@ using System; using System.Linq; using System.Diagnostics; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Generation { +namespace Riverside.Scripting.Generation { internal static partial class DelegateHelpers { #region Generated Maximum Delegate Arity diff --git a/Dynamic/Generation/DelegateHelpers.cs b/Dynamic/Generation/DelegateHelpers.cs index 2c589881..1c5065b9 100644 --- a/Dynamic/Generation/DelegateHelpers.cs +++ b/Dynamic/Generation/DelegateHelpers.cs @@ -7,9 +7,9 @@ using System.Reflection; using System.Reflection.Emit; using System.Threading; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Generation { +namespace Riverside.Scripting.Generation { internal static partial class DelegateHelpers { private static Dictionary, Type> _DelegateTypes; diff --git a/Dynamic/Generation/DynamicILGen.cs b/Dynamic/Generation/DynamicILGen.cs index 0ec4ab41..b84b368f 100644 --- a/Dynamic/Generation/DynamicILGen.cs +++ b/Dynamic/Generation/DynamicILGen.cs @@ -7,9 +7,9 @@ using System; using System.Reflection; using System.Reflection.Emit; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Generation { +namespace Riverside.Scripting.Generation { public abstract class DynamicILGen : ILGen { internal DynamicILGen(ILGenerator il) diff --git a/Dynamic/Generation/FieldBuilderExpression.cs b/Dynamic/Generation/FieldBuilderExpression.cs index 2b6c009e..399ffe9e 100644 --- a/Dynamic/Generation/FieldBuilderExpression.cs +++ b/Dynamic/Generation/FieldBuilderExpression.cs @@ -11,9 +11,9 @@ using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Generation { +namespace Riverside.Scripting.Generation { /// /// Provides a simple expression which enables embedding FieldBuilder's /// in an AST before the type is complete. diff --git a/Dynamic/Generation/IExpressionSerializable.cs b/Dynamic/Generation/IExpressionSerializable.cs index ee5dc12a..26c49fbc 100644 --- a/Dynamic/Generation/IExpressionSerializable.cs +++ b/Dynamic/Generation/IExpressionSerializable.cs @@ -4,7 +4,7 @@ using System.Linq.Expressions; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Enables an object to be serializable to an Expression tree. The expression tree can then /// be emitted into an assembly enabling the de-serialization of the object. diff --git a/Dynamic/Generation/ILGen.cs b/Dynamic/Generation/ILGen.cs index 6b974460..847367c5 100644 --- a/Dynamic/Generation/ILGen.cs +++ b/Dynamic/Generation/ILGen.cs @@ -17,10 +17,10 @@ using System.Runtime.InteropServices; using System.Linq; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Generation { +namespace Riverside.Scripting.Generation { public delegate void EmitArrayHelper(int index); @@ -1345,7 +1345,7 @@ private void EmitNullableToNonNullableStructConversion(Type typeFrom, Type typeT private void EmitNullableToReferenceConversion(Type typeFrom) { Debug.Assert(TypeUtils.IsNullableType(typeFrom)); // We've got a conversion from nullable to Object, ValueType, Enum, etc. Just box it so that - // we get the nullable semantics. + // we get the nullable semantics. Emit(OpCodes.Box, typeFrom); } @@ -1426,7 +1426,7 @@ public void EmitArray(Type elementType, int count, EmitArrayHelper emit) { } /// - /// Emits an array construction code. + /// Emits an array construction code. /// The code assumes that bounds for all dimensions /// are already emitted. /// diff --git a/Dynamic/Generation/KeyedQueue.cs b/Dynamic/Generation/KeyedQueue.cs index 845b1f89..156e54a6 100644 --- a/Dynamic/Generation/KeyedQueue.cs +++ b/Dynamic/Generation/KeyedQueue.cs @@ -4,8 +4,8 @@ using System.Collections.Generic; -namespace Microsoft.Scripting.Generation { - +namespace Riverside.Scripting.Generation { + /// /// A simple dictionary of queues, keyed off a particular type /// This is useful for storing free lists of variables diff --git a/Dynamic/Generation/MethodSignatureInfo.cs b/Dynamic/Generation/MethodSignatureInfo.cs index dcd150ba..b1765ffa 100644 --- a/Dynamic/Generation/MethodSignatureInfo.cs +++ b/Dynamic/Generation/MethodSignatureInfo.cs @@ -4,7 +4,7 @@ using System.Reflection; -namespace Microsoft.Scripting.Generation { +namespace Riverside.Scripting.Generation { /// /// Helper class to remove methods w/ identical signatures. Used for GetDefaultMembers /// which returns members from all types in the hierarchy. @@ -14,7 +14,7 @@ public class MethodSignatureInfo { private readonly bool _isStatic; private readonly int _genericArity; - public MethodSignatureInfo(MethodInfo info) + public MethodSignatureInfo(MethodInfo info) : this(info.IsStatic, info.GetParameters(), info.IsGenericMethodDefinition ? info.GetGenericArguments().Length : 0){ } diff --git a/Dynamic/Generation/Snippets.cs b/Dynamic/Generation/Snippets.cs index fc96f13a..0e3c829d 100644 --- a/Dynamic/Generation/Snippets.cs +++ b/Dynamic/Generation/Snippets.cs @@ -9,10 +9,10 @@ using System.Reflection; using System.Reflection.Emit; using System.Threading; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; using System.Collections.Generic; -namespace Microsoft.Scripting.Generation { +namespace Riverside.Scripting.Generation { // TODO: This should be a static class // TODO: simplify initialization logic & state public sealed class Snippets { @@ -194,7 +194,7 @@ public TypeBuilder DefineDelegateType(string name) { public Type DefineDelegate(string name, Type returnType, params Type[] argTypes) { TypeBuilder tb = DefineDelegateType(name); tb.DefineConstructor( - MethodAttributes.RTSpecialName | MethodAttributes.HideBySig | MethodAttributes.Public, + MethodAttributes.RTSpecialName | MethodAttributes.HideBySig | MethodAttributes.Public, CallingConventions.Standard, _DelegateCtorSignature).SetImplementationFlags(MethodImplAttributes.Runtime | MethodImplAttributes.Managed); tb.DefineMethod("Invoke", MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.NewSlot | MethodAttributes.Virtual, returnType, argTypes).SetImplementationFlags(MethodImplAttributes.Runtime | MethodImplAttributes.Managed); return tb.CreateTypeInfo(); @@ -220,7 +220,7 @@ public DynamicILGen CreateDynamicMethod(string methodName, Type returnType, Type TypeBuilder tb = assembly.DefinePublicType(methodName, typeof(object), false); MethodBuilder mb = tb.DefineMethod(methodName, CompilerHelpers.PublicStatic, returnType, parameterTypes); return new DynamicILGenType(tb, mb, mb.GetILGenerator()); - } + } #endif DynamicMethod dm = ReflectionUtils.RawCreateDynamicMethod(methodName, returnType, parameterTypes); return new DynamicILGenMethod(dm, dm.GetILGenerator()); diff --git a/Dynamic/Generation/SymbolGuids.cs b/Dynamic/Generation/SymbolGuids.cs index bc81b36d..9a3444a9 100644 --- a/Dynamic/Generation/SymbolGuids.cs +++ b/Dynamic/Generation/SymbolGuids.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Generation { +namespace Riverside.Scripting.Generation { internal static class SymbolGuids { internal static readonly Guid LanguageType_ILAssembly = new Guid(-1358664493, -12063, 0x11d2, 0x97, 0x7c, 0, 160, 0xc9, 180, 0xd5, 12); diff --git a/Dynamic/Generation/ToDiskRewriter.cs b/Dynamic/Generation/ToDiskRewriter.cs index 356cfb6a..b6f5db0d 100644 --- a/Dynamic/Generation/ToDiskRewriter.cs +++ b/Dynamic/Generation/ToDiskRewriter.cs @@ -13,11 +13,11 @@ using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Threading; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Generation { +namespace Riverside.Scripting.Generation { /// /// Serializes constants and dynamic sites so the code can be saved to disk @@ -30,8 +30,8 @@ internal sealed class ToDiskRewriter : DynamicExpressionVisitor { private Dictionary _delegateTypes; private int _depth; private readonly TypeGen _typeGen; - - internal ToDiskRewriter(TypeGen typeGen) { + + internal ToDiskRewriter(TypeGen typeGen) { _typeGen = typeGen; } diff --git a/Dynamic/Generation/TypeGen.cs b/Dynamic/Generation/TypeGen.cs index 4c1bf68c..7d4d7ea3 100644 --- a/Dynamic/Generation/TypeGen.cs +++ b/Dynamic/Generation/TypeGen.cs @@ -7,9 +7,9 @@ using System; using System.Reflection; using System.Reflection.Emit; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Generation { +namespace Riverside.Scripting.Generation { public sealed class TypeGen { private ILGen _initGen; // The IL generator for the .cctor() diff --git a/Dynamic/GlobalSuppressions.cs b/Dynamic/GlobalSuppressions.cs index b0412eb8..5ee0485f 100644 --- a/Dynamic/GlobalSuppressions.cs +++ b/Dynamic/GlobalSuppressions.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Scripting.Hosting.Providers")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Scripting.Math")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Riverside.Scripting.Hosting.Providers")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Riverside.Scripting.Math")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Collections")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Scripting.Debugging.CompilerServices")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Riverside.Scripting.Debugging.CompilerServices")] diff --git a/Dynamic/Hosting/Shell/BasicConsole.cs b/Dynamic/Hosting/Shell/BasicConsole.cs index 9d3528e6..51ea15e0 100644 --- a/Dynamic/Hosting/Shell/BasicConsole.cs +++ b/Dynamic/Hosting/Shell/BasicConsole.cs @@ -6,9 +6,9 @@ using System.IO; using System.Threading; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting.Shell { +namespace Riverside.Scripting.Hosting.Shell { public class BasicConsole : IConsole, IDisposable { private TextWriter _output; @@ -142,7 +142,7 @@ private static ConsoleColor MakeDark(ConsoleColor color) { protected void WriteColor(TextWriter output, string str, ConsoleColor c) { ConsoleColor origColor = Console.ForegroundColor; Console.ForegroundColor = c; - + output.Write(str); output.Flush(); @@ -166,7 +166,7 @@ public virtual string ReadLine(int autoIndentSize) { // received ctrl-C return ""; } - + // received ctrl-Z return null; } diff --git a/Dynamic/Hosting/Shell/CommandLine.cs b/Dynamic/Hosting/Shell/CommandLine.cs index f15bb1d3..ef2db429 100644 --- a/Dynamic/Hosting/Shell/CommandLine.cs +++ b/Dynamic/Hosting/Shell/CommandLine.cs @@ -7,11 +7,11 @@ using System.IO; using System.Text; using System.Threading; -using Microsoft.Scripting.Hosting.Providers; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Hosting.Providers; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting.Shell { +namespace Riverside.Scripting.Hosting.Shell { /// /// Command line hosting service. /// @@ -34,18 +34,18 @@ public class CommandLine { /// /// Scope is not remotable, and this only works in the same AppDomain. /// - protected Scope Scope { + protected Scope Scope { get { if (_scope == null) { return null; } - return HostingHelpers.GetScope(_scope); + return HostingHelpers.GetScope(_scope); } set { _scope = HostingHelpers.CreateScriptScope(_engine, value); } } - + protected LanguageContext Language { get { // LanguageContext is not remotable, and this only works in the same AppDomain. @@ -189,7 +189,7 @@ protected void PrintLogo() { /// /// Starts the interactive loop. Performs any initialization necessary before /// starting the loop and then calls RunInteractiveLoop to start the loop. - /// + /// /// Returns the exit code when the interactive loop is completed. /// protected virtual int RunInteractive() { @@ -268,7 +268,7 @@ protected virtual void UnhandledException(Exception e) { /// Attempts to run a single interaction and handle any language-specific /// exceptions. Base classes can override this and call the base implementation /// surrounded with their own exception handling. - /// + /// /// Returns null if successful and execution should continue, or an exit code. /// protected virtual int? TryInteractiveAction() { @@ -296,9 +296,9 @@ protected virtual void UnhandledException(Exception e) { /// /// Parses a single interactive command or a set of statements and executes it. - /// + /// /// Returns null if successful and execution should continue, or the appropiate exit code. - /// + /// /// We check if the code read is an interactive command or statements is by checking for NewLine /// If the code contains NewLine, it's a set of statements (most probably from SendToConsole) /// If the code does not contain a NewLine, it's an interactive command typed by the user at the prompt @@ -336,7 +336,7 @@ protected virtual ErrorSink ErrorSink { /// /// Private helper function to see if we should treat the current input as a blank link. - /// + /// /// We do this if we only have auto-indent text. /// private static bool TreatAsBlankLine(string line, int autoIndentSize) { @@ -351,7 +351,7 @@ private static bool TreatAsBlankLine(string line, int autoIndentSize) { /// /// Read a statement, which can potentially be a multiple-line statement suite (like a class declaration). /// - /// Should the console session continue, or did the user indicate + /// Should the console session continue, or did the user indicate /// that it should be terminated? /// Expression to evaluate. null for empty input protected string ReadStatement(out bool continueInteraction) { diff --git a/Dynamic/Hosting/Shell/ConsoleHost.cs b/Dynamic/Hosting/Shell/ConsoleHost.cs index ec45bd59..df9a1eba 100644 --- a/Dynamic/Hosting/Shell/ConsoleHost.cs +++ b/Dynamic/Hosting/Shell/ConsoleHost.cs @@ -13,11 +13,11 @@ using System.Runtime.CompilerServices; using System.Text; using System.Threading; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting.Shell { +namespace Riverside.Scripting.Hosting.Shell { /// /// Core functionality to implement an interactive console. This should be derived for concrete implementations /// @@ -46,7 +46,7 @@ public abstract class ConsoleHost { protected virtual string ExeName { get { Assembly entryAssembly = Assembly.GetEntryAssembly(); - + // Can be null if called from unmanaged code (VS integration scenario) return entryAssembly != null ? entryAssembly.GetName().Name : "ConsoleHost"; } @@ -90,7 +90,7 @@ private string GetLanguageProvider(ScriptRuntimeSetup setup) { if (providerType != null) { return providerType.AssemblyQualifiedName; } - + if (Options.HasLanguageProvider) { return Options.LanguageProvider; } @@ -125,7 +125,7 @@ protected virtual IConsole CreateConsole(ScriptEngine engine, CommandLine comman return new BasicConsole(options); } - // The advanced console functions are in a special non-inlined function so that + // The advanced console functions are in a special non-inlined function so that // dependencies are pulled in only if necessary. [MethodImplAttribute(MethodImplOptions.NoInlining)] private static IConsole CreateSuperConsole(CommandLine commandLine, ConsoleOptions options) { @@ -206,7 +206,7 @@ protected virtual ConsoleOptions ParseOptions(string/*!*/[]/*!*/ args, ScriptRun return null; } - return languageOptionsParser.CommonConsoleOptions; + return languageOptionsParser.CommonConsoleOptions; } protected virtual void ReportInvalidOption(InvalidOptionException e) { @@ -346,7 +346,7 @@ private int RunFile() { int result = 0; try { return _engine.CreateScriptSourceFromFile(Options.RunFile).ExecuteProgram(); -#if !FEATURE_PROCESS +#if !FEATURE_PROCESS } catch (ExitProcessException e) { result = e.ExitCode; #endif diff --git a/Dynamic/Hosting/Shell/ConsoleHostOptions.cs b/Dynamic/Hosting/Shell/ConsoleHostOptions.cs index e7286fbb..b4f83287 100644 --- a/Dynamic/Hosting/Shell/ConsoleHostOptions.cs +++ b/Dynamic/Hosting/Shell/ConsoleHostOptions.cs @@ -3,10 +3,10 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; using System.Reflection; -namespace Microsoft.Scripting.Hosting.Shell { +namespace Riverside.Scripting.Hosting.Shell { public class ConsoleHostOptions { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] // TODO: fix diff --git a/Dynamic/Hosting/Shell/ConsoleHostOptionsParser.cs b/Dynamic/Hosting/Shell/ConsoleHostOptionsParser.cs index 66c3408e..feea9636 100644 --- a/Dynamic/Hosting/Shell/ConsoleHostOptionsParser.cs +++ b/Dynamic/Hosting/Shell/ConsoleHostOptionsParser.cs @@ -7,10 +7,10 @@ using System.Globalization; using System.Linq; -using Microsoft.Scripting.Utils; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Utils; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Hosting.Shell { +namespace Riverside.Scripting.Hosting.Shell { public class ConsoleHostOptionsParser { public ConsoleHostOptions Options { get; } diff --git a/Dynamic/Hosting/Shell/ConsoleOptions.cs b/Dynamic/Hosting/Shell/ConsoleOptions.cs index 6d261f48..8102cf07 100644 --- a/Dynamic/Hosting/Shell/ConsoleOptions.cs +++ b/Dynamic/Hosting/Shell/ConsoleOptions.cs @@ -3,9 +3,9 @@ // See the LICENSE file in the project root for more information. using System; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting.Shell { +namespace Riverside.Scripting.Hosting.Shell { [Serializable] public class ConsoleOptions { diff --git a/Dynamic/Hosting/Shell/ICommandDispatcher.cs b/Dynamic/Hosting/Shell/ICommandDispatcher.cs index 739cb59a..0ef3fafd 100644 --- a/Dynamic/Hosting/Shell/ICommandDispatcher.cs +++ b/Dynamic/Hosting/Shell/ICommandDispatcher.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Hosting.Shell { +namespace Riverside.Scripting.Hosting.Shell { /// /// Used to dispatch a single interactive command. It can be used to control things like which Thread /// the command is executed on, how long the command is allowed to execute, etc @@ -10,4 +10,4 @@ namespace Microsoft.Scripting.Hosting.Shell { public interface ICommandDispatcher { object Execute(CompiledCode compiledCode, ScriptScope scope); } -} \ No newline at end of file +} diff --git a/Dynamic/Hosting/Shell/IConsole.cs b/Dynamic/Hosting/Shell/IConsole.cs index d1b69ba7..4b1a5eac 100644 --- a/Dynamic/Hosting/Shell/IConsole.cs +++ b/Dynamic/Hosting/Shell/IConsole.cs @@ -4,15 +4,15 @@ using System.IO; -namespace Microsoft.Scripting.Hosting.Shell { +namespace Riverside.Scripting.Hosting.Shell { /// - /// Handles input and output for the console. It is comparable to System.IO.TextReader, + /// Handles input and output for the console. It is comparable to System.IO.TextReader, /// System.IO.TextWriter, System.Console, etc /// public interface IConsole { /// /// Read a single line of interactive input, or a block of multi-line statements. - /// + /// /// An event-driven GUI console can implement this method by creating a thread that /// blocks and waits for an event indicating that input is available /// diff --git a/Dynamic/Hosting/Shell/OptionsParser.cs b/Dynamic/Hosting/Shell/OptionsParser.cs index 01d4dd65..b67d9815 100644 --- a/Dynamic/Hosting/Shell/OptionsParser.cs +++ b/Dynamic/Hosting/Shell/OptionsParser.cs @@ -6,11 +6,11 @@ using System.Collections.Generic; using System.Runtime.Serialization; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting.Shell { +namespace Riverside.Scripting.Hosting.Shell { [Serializable] public class InvalidOptionException : Exception { diff --git a/Dynamic/Hosting/Shell/Remote/ConsoleRestartManager.cs b/Dynamic/Hosting/Shell/Remote/ConsoleRestartManager.cs index a434ddfe..7daf1a72 100644 --- a/Dynamic/Hosting/Shell/Remote/ConsoleRestartManager.cs +++ b/Dynamic/Hosting/Shell/Remote/ConsoleRestartManager.cs @@ -9,21 +9,21 @@ using System.Diagnostics; using System.Threading; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting.Shell.Remote { +namespace Riverside.Scripting.Hosting.Shell.Remote { /// /// Supports detecting the remote runtime being killed, and starting up a new one. - /// + /// /// Threading model: - /// - /// ConsoleRestartManager creates a separate thread on which to create and execute the consoles. + /// + /// ConsoleRestartManager creates a separate thread on which to create and execute the consoles. /// There are usually at least three threads involved: - /// - /// 1. Main app thread: Instantiates ConsoleRestartManager and accesses its APIs. This thread has to stay + /// + /// 1. Main app thread: Instantiates ConsoleRestartManager and accesses its APIs. This thread has to stay /// responsive to user input and so the ConsoleRestartManager APIs cannot be long-running or blocking. - /// Since the remote runtime process can terminate asynchronously, the current RemoteConsoleHost can - /// change at any time (if auto-restart is enabled). The app should typically not care which instance of + /// Since the remote runtime process can terminate asynchronously, the current RemoteConsoleHost can + /// change at any time (if auto-restart is enabled). The app should typically not care which instance of /// RemoteConsoleHost is currently being used. The flowchart of this thread is: /// Create ConsoleRestartManager /// ConsoleRestartManager.Start @@ -44,11 +44,11 @@ namespace Microsoft.Scripting.Hosting.Shell.Remote { /// /// 3. CompletionPort async callbacks: /// Process.Exited | Process.OutputDataReceived | Process.ErrorDataReceived - /// + /// /// 4. Finalizer thread /// Some objects may have a Finalize method (which possibly calls Dispose). Not many (if any) types /// should have a Finalize method. - /// + /// /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1012:AbstractTypesShouldNotHaveConstructors")] // TODO: This is public only because the test (RemoteConsole.py) needs it to be so. The test should be rewritten public abstract class ConsoleRestartManager { @@ -115,7 +115,7 @@ private void RunWorker() { while (true) { RemoteConsoleHost remoteConsoleHost = CreateRemoteConsoleHost(); - // Reading _terminating and setting of _remoteConsoleHost should be done atomically. + // Reading _terminating and setting of _remoteConsoleHost should be done atomically. // Terminate() does the reverse operation (setting _terminating reading _remoteConsoleHost) atomically lock (_accessLock) { if (_terminating) { @@ -143,7 +143,7 @@ private void RunWorker() { } } - // TODO: We have to catch all exceptions as we are executing user code in the remote runtime, and we cannot control what + // TODO: We have to catch all exceptions as we are executing user code in the remote runtime, and we cannot control what // exception it may throw. This could be fixed if we built our own remoting channel which returned an error code // instead of propagating exceptions back from the remote runtime. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] @@ -205,7 +205,7 @@ public void Terminate() { _terminating = true; _remoteConsoleHost.Terminate(0); } - + _consoleThread.Join(); } } diff --git a/Dynamic/Hosting/Shell/Remote/RemoteCommandDispatcher.cs b/Dynamic/Hosting/Shell/Remote/RemoteCommandDispatcher.cs index bb813713..7516c171 100644 --- a/Dynamic/Hosting/Shell/Remote/RemoteCommandDispatcher.cs +++ b/Dynamic/Hosting/Shell/Remote/RemoteCommandDispatcher.cs @@ -9,7 +9,7 @@ using System.Threading; using System.Security.Permissions; -namespace Microsoft.Scripting.Hosting.Shell.Remote { +namespace Riverside.Scripting.Hosting.Shell.Remote { /// /// This allows the RemoteConsoleHost to abort a long-running operation. The RemoteConsoleHost itself /// does not know which ThreadPool thread might be processing the remote call, and so it needs @@ -78,4 +78,4 @@ public override object InitializeLifetimeService() { } } -#endif \ No newline at end of file +#endif diff --git a/Dynamic/Hosting/Shell/Remote/RemoteConsoleCommandLine.cs b/Dynamic/Hosting/Shell/Remote/RemoteConsoleCommandLine.cs index f05bd9e1..1da96f9a 100644 --- a/Dynamic/Hosting/Shell/Remote/RemoteConsoleCommandLine.cs +++ b/Dynamic/Hosting/Shell/Remote/RemoteConsoleCommandLine.cs @@ -9,7 +9,7 @@ using System.Runtime.Remoting; using System.Threading; -namespace Microsoft.Scripting.Hosting.Shell.Remote { +namespace Riverside.Scripting.Hosting.Shell.Remote { /// /// Customize the CommandLine for remote scenarios /// @@ -72,4 +72,4 @@ public object Execute(CompiledCode compiledCode, ScriptScope scope) { } } -#endif \ No newline at end of file +#endif diff --git a/Dynamic/Hosting/Shell/Remote/RemoteConsoleHost.cs b/Dynamic/Hosting/Shell/Remote/RemoteConsoleHost.cs index ad5bd27d..45c4200f 100644 --- a/Dynamic/Hosting/Shell/Remote/RemoteConsoleHost.cs +++ b/Dynamic/Hosting/Shell/Remote/RemoteConsoleHost.cs @@ -11,15 +11,15 @@ using System.Runtime.Serialization; using System.Threading; -namespace Microsoft.Scripting.Hosting.Shell.Remote { +namespace Riverside.Scripting.Hosting.Shell.Remote { /// /// ConsoleHost where the ScriptRuntime is hosted in a separate process (referred to as the remote runtime server) - /// + /// /// The RemoteConsoleHost spawns the remote runtime server and specifies an IPC channel name to use to communicate /// with each other. The remote runtime server creates and initializes a ScriptRuntime and a ScriptEngine, and publishes /// it over the specified IPC channel at a well-known URI. Note that the RemoteConsoleHost cannot easily participate /// in the initialization of the ScriptEngine as classes like LanguageContext are not remotable. - /// + /// /// The RemoteConsoleHost then starts the interactive loop and executes commands on the ScriptEngine over the remoting channel. /// The RemoteConsoleHost listens to stdout of the remote runtime server and echos it locally to the user. /// @@ -73,7 +73,7 @@ private void StartRemoteRuntimeProcess() { process.BeginOutputReadLine(); process.BeginErrorReadLine(); - // wire up exited + // wire up exited process.EnableRaisingEvents = true; // Wait for the output marker to know when the startup output is complete @@ -116,7 +116,7 @@ protected virtual void OnRemoteRuntimeExited(object sender, EventArgs args) { EventHandler remoteRuntimeExited = RemoteRuntimeExited; remoteRuntimeExited?.Invoke(sender, args); - // StartRemoteRuntimeProcess also blocks on this event. Signal it in case the + // StartRemoteRuntimeProcess also blocks on this event. Signal it in case the // remote runtime terminates during startup itself. _remoteOutputReceived.Set(); @@ -165,7 +165,7 @@ protected override CommandLine CreateCommandLine() { public ScriptScope ScriptScope { get { return CommandLine.ScriptScope; } } public Process RemoteRuntimeProcess { get { return _remoteRuntimeProcess; } } - // TODO: We have to catch all exceptions as we are executing user code in the remote runtime, and we cannot control what + // TODO: We have to catch all exceptions as we are executing user code in the remote runtime, and we cannot control what // exception it may throw. This could be fixed if we built our own remoting channel which returned an error code // instead of propagating exceptions back from the remote runtime. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] diff --git a/Dynamic/Hosting/Shell/Remote/RemoteRuntimeServer.cs b/Dynamic/Hosting/Shell/Remote/RemoteRuntimeServer.cs index 8ff9d46c..3e25f5f7 100644 --- a/Dynamic/Hosting/Shell/Remote/RemoteRuntimeServer.cs +++ b/Dynamic/Hosting/Shell/Remote/RemoteRuntimeServer.cs @@ -11,9 +11,9 @@ using System.Runtime.Remoting.Channels.Ipc; using System.Runtime.Remoting.Lifetime; -namespace Microsoft.Scripting.Hosting.Shell.Remote { +namespace Riverside.Scripting.Hosting.Shell.Remote { /// - /// The remote runtime server uses this class to publish an initialized ScriptEngine and ScriptRuntime + /// The remote runtime server uses this class to publish an initialized ScriptEngine and ScriptRuntime /// over a remoting channel. /// public static class RemoteRuntimeServer { @@ -21,10 +21,10 @@ public static class RemoteRuntimeServer { internal const string RemoteRuntimeArg = "RemoteRuntimeChannel"; private static TimeSpan GetSevenDays() { - return new TimeSpan(7, 0, 0, 0); // days,hours,mins,secs + return new TimeSpan(7, 0, 0, 0); // days,hours,mins,secs } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods")] // TODO: Microsoft.Scripting does not need to be APTCA + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods")] // TODO: Riverside.Scripting does not need to be APTCA internal static IpcChannel CreateChannel(string channelName, string portName) { // The Hosting API classes require TypeFilterLevel.Full to be remoted BinaryServerFormatterSinkProvider serverProv = new BinaryServerFormatterSinkProvider(); @@ -32,19 +32,19 @@ internal static IpcChannel CreateChannel(string channelName, string portName) { System.Collections.IDictionary properties = new System.Collections.Hashtable(); properties["name"] = channelName; properties["portName"] = portName; - // exclusiveAddressUse corresponds to the FILE_FLAG_FIRST_PIPE_INSTANCE flag of CreateNamedPipe. + // exclusiveAddressUse corresponds to the FILE_FLAG_FIRST_PIPE_INSTANCE flag of CreateNamedPipe. // Setting it to true seems to cause "Failed to create an IPC Port: Access is denied." occasionally. // TODO: Setting this to false is secure only if we use ACLs as well. properties["exclusiveAddressUse"] = false; - // Create the channel. + // Create the channel. IpcChannel channel = new IpcChannel(properties, null, serverProv); return channel; } /// /// Publish objects so that the host can use it, and then block indefinitely (until the input stream is open). - /// + /// /// Note that we should publish only one object, and then have other objects be accessible from it. Publishing /// multiple objects can cause problems if the client does a call like "remoteProxy1(remoteProxy2)" as remoting /// will not be able to know if the server object for both the proxies is on the same server. diff --git a/Dynamic/Hosting/Shell/Style.cs b/Dynamic/Hosting/Shell/Style.cs index 05c4f2a0..3d09c4f7 100644 --- a/Dynamic/Hosting/Shell/Style.cs +++ b/Dynamic/Hosting/Shell/Style.cs @@ -2,8 +2,8 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Hosting.Shell { +namespace Riverside.Scripting.Hosting.Shell { public enum Style { Prompt, Out, Error, Warning } -} \ No newline at end of file +} diff --git a/Dynamic/Hosting/Shell/SuperConsole.cs b/Dynamic/Hosting/Shell/SuperConsole.cs index fdad11f7..b12de0e8 100644 --- a/Dynamic/Hosting/Shell/SuperConsole.cs +++ b/Dynamic/Hosting/Shell/SuperConsole.cs @@ -7,9 +7,9 @@ using System.Diagnostics; using System.Text; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting.Shell { +namespace Riverside.Scripting.Hosting.Shell { public sealed class SuperConsole : BasicConsole { #region Nested types: EditMode, History, SuperConsoleOptions, Cursor @@ -299,7 +299,7 @@ private bool BackspaceAutoIndentation() { } // Calculate the previous indentation level - //!!! int newLength = ((input.Length - 1) / ConsoleOptions.AutoIndentSize) * ConsoleOptions.AutoIndentSize; + //!!! int newLength = ((input.Length - 1) / ConsoleOptions.AutoIndentSize) * ConsoleOptions.AutoIndentSize; int newLength = _input.Length - 4; int backspaceSize = _input.Length - newLength; diff --git a/Dynamic/Interpreter/BranchLabel.cs b/Dynamic/Interpreter/BranchLabel.cs index 0027ba51..0802b576 100644 --- a/Dynamic/Interpreter/BranchLabel.cs +++ b/Dynamic/Interpreter/BranchLabel.cs @@ -6,9 +6,9 @@ using System.Diagnostics; using System.Collections.Generic; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { internal struct RuntimeLabel { public readonly int Index; public readonly int StackDepth; @@ -34,7 +34,7 @@ public sealed class BranchLabel { internal int _stackDepth = UnknownDepth; internal int _continuationStackDepth = UnknownDepth; - // Offsets of forward branching instructions targetting this label + // Offsets of forward branching instructions targetting this label // that need to be updated after we emit the label. private List _forwardBranchFixups; diff --git a/Dynamic/Interpreter/ILightCallSiteBinder.cs b/Dynamic/Interpreter/ILightCallSiteBinder.cs index 4cd5d5f5..169f2ac4 100644 --- a/Dynamic/Interpreter/ILightCallSiteBinder.cs +++ b/Dynamic/Interpreter/ILightCallSiteBinder.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { public interface ILightCallSiteBinder { bool AcceptsArgumentArray { get; } } diff --git a/Dynamic/Interpreter/Instructions/AddInstruction.cs b/Dynamic/Interpreter/Instructions/AddInstruction.cs index 09e9a855..5e6c9e32 100644 --- a/Dynamic/Interpreter/Instructions/AddInstruction.cs +++ b/Dynamic/Interpreter/Instructions/AddInstruction.cs @@ -5,10 +5,10 @@ using System; using System.Diagnostics; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { internal abstract class AddInstruction : Instruction { private static Instruction _Int16, _Int32, _Int64, _UInt16, _UInt32, _UInt64, _Single, _Double; diff --git a/Dynamic/Interpreter/Instructions/ArrayOperations.cs b/Dynamic/Interpreter/Instructions/ArrayOperations.cs index 12cf3171..43ce6472 100644 --- a/Dynamic/Interpreter/Instructions/ArrayOperations.cs +++ b/Dynamic/Interpreter/Instructions/ArrayOperations.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { public sealed class NewArrayInitInstruction : Instruction { private readonly int _elementCount; diff --git a/Dynamic/Interpreter/Instructions/CallInstruction.Generated.cs b/Dynamic/Interpreter/Instructions/CallInstruction.Generated.cs index d7db3bba..1ba9c105 100644 --- a/Dynamic/Interpreter/Instructions/CallInstruction.Generated.cs +++ b/Dynamic/Interpreter/Instructions/CallInstruction.Generated.cs @@ -9,13 +9,13 @@ using System.Diagnostics; using System.Reflection; using System.Threading; -using Microsoft.Scripting.Utils; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Utils; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; using System.Dynamic; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { #region Generated Reflected Caller // *** BEGIN GENERATED CODE *** @@ -71,13 +71,13 @@ public virtual object Invoke(params object[] args) { /// Fast creation works if we have a known primitive types for the entire /// method siganture. If we have any non-primitive types then FastCreate /// falls back to SlowCreate which works for all types. - /// + /// /// Fast creation is fast because it avoids using reflection (MakeGenericType /// and Activator.CreateInstance) to create the types. It does this through /// calling a series of generic methods picking up each strong type of the - /// signature along the way. When it runs out of types it news up the + /// signature along the way. When it runs out of types it news up the /// appropriate CallInstruction with the strong-types that have been built up. - /// + /// /// One relaxation is that for return types which are non-primitive types /// we can fallback to object due to relaxed delegates. /// diff --git a/Dynamic/Interpreter/Instructions/CallInstruction.cs b/Dynamic/Interpreter/Instructions/CallInstruction.cs index 01c903f5..e59263a4 100644 --- a/Dynamic/Interpreter/Instructions/CallInstruction.cs +++ b/Dynamic/Interpreter/Instructions/CallInstruction.cs @@ -7,10 +7,10 @@ using System.Reflection; using System.Security; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { public abstract partial class CallInstruction : Instruction { public abstract MethodInfo Info { get; } @@ -22,7 +22,7 @@ public abstract partial class CallInstruction : Instruction { #region Construction internal CallInstruction() { } - + private static readonly Dictionary _cache = new Dictionary(); /// Instruction can't be created due to insufficient privileges. @@ -69,7 +69,7 @@ public static CallInstruction Create(MethodInfo info, ParameterInfo[] parameters } } - // create it + // create it try { if (argumentCount < MaxArgs) { res = FastCreate(info, parameters); @@ -83,9 +83,9 @@ public static CallInstruction Create(MethodInfo info, ParameterInfo[] parameters res = new MethodInfoCallInstruction(info, argumentCount); } catch (NotSupportedException) { - // if Delegate.CreateDelegate can't handle the method fallback to - // the slow reflection version. For example this can happen w/ - // a generic method defined on an interface and implemented on a class or + // if Delegate.CreateDelegate can't handle the method fallback to + // the slow reflection version. For example this can happen w/ + // a generic method defined on an interface and implemented on a class or // a virtual generic method. res = new MethodInfoCallInstruction(info, argumentCount); } @@ -109,20 +109,20 @@ private static CallInstruction GetArrayAccessor(MethodInfo info, int argumentCou arrayType.GetMethod("GetValue", new[] { typeof(int)}) : new Action(ArrayItemSetter1).GetMethodInfo() ); - - case 2: - return Create(isGetter ? + + case 2: + return Create(isGetter ? arrayType.GetMethod("GetValue", new[] { typeof(int), typeof(int) }) : new Action(ArrayItemSetter2).GetMethodInfo() ); - case 3: + case 3: return Create(isGetter ? arrayType.GetMethod("GetValue", new[] { typeof(int), typeof(int), typeof(int) }) : new Action(ArrayItemSetter3).GetMethodInfo() ); - default: + default: return new MethodInfoCallInstruction(info, argumentCount); } } @@ -142,7 +142,7 @@ public static void ArrayItemSetter3(Array array, int index0, int index1, int ind private static bool ShouldCache(MethodInfo info) { return !ReflectionUtils.IsDynamicMethod(info); } - + /// /// Gets the next type or null if no more types are available. /// @@ -216,11 +216,11 @@ internal MethodInfoCallInstruction(MethodInfo target, int argumentCount) { _target = target; _argumentCount = argumentCount; } - + public override object Invoke(params object[] args) { return InvokeWorker(args); } - + public override object InvokeInstance(object instance, params object[] args) { if (_target.IsStatic) { try { diff --git a/Dynamic/Interpreter/Instructions/ControlFlowInstructions.cs b/Dynamic/Interpreter/Instructions/ControlFlowInstructions.cs index add0f7de..7df57a04 100644 --- a/Dynamic/Interpreter/Instructions/ControlFlowInstructions.cs +++ b/Dynamic/Interpreter/Instructions/ControlFlowInstructions.cs @@ -10,9 +10,9 @@ using System.Threading; using System.Threading.Tasks; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { using LoopFunc = Func[], InterpretedFrame, int>; internal abstract class OffsetInstruction : Instruction { @@ -160,27 +160,27 @@ public override string ToString() { } /// - /// This instruction implements a goto expression that can jump out of any expression. - /// It pops values (arguments) from the evaluation stack that the expression tree nodes in between - /// the goto expression and the target label node pushed and not consumed yet. - /// A goto expression can jump into a node that evaluates arguments only if it carries - /// a value and jumps right after the first argument (the carried value will be used as the first argument). - /// Goto can jump into an arbitrary child of a BlockExpression since the block doesn’t accumulate values + /// This instruction implements a goto expression that can jump out of any expression. + /// It pops values (arguments) from the evaluation stack that the expression tree nodes in between + /// the goto expression and the target label node pushed and not consumed yet. + /// A goto expression can jump into a node that evaluates arguments only if it carries + /// a value and jumps right after the first argument (the carried value will be used as the first argument). + /// Goto can jump into an arbitrary child of a BlockExpression since the block doesn�t accumulate values /// on evaluation stack as its child expressions are being evaluated. - /// + /// /// Goto needs to execute any finally blocks on the way to the target label. /// - /// { + /// { /// f(1, 2, try { g(3, 4, try { goto L } finally { ... }, 6) } finally { ... }, 7, 8) - /// L: ... + /// L: ... /// } /// - /// The goto expression here jumps to label L while having 4 items on evaluation stack (1, 2, 3 and 4). - /// The jump needs to execute both finally blocks, the first one on stack level 4 the - /// second one on stack level 2. So, it needs to jump the first finally block, pop 2 items from the stack, + /// The goto expression here jumps to label L while having 4 items on evaluation stack (1, 2, 3 and 4). + /// The jump needs to execute both finally blocks, the first one on stack level 4 the + /// second one on stack level 2. So, it needs to jump the first finally block, pop 2 items from the stack, /// run second finally block and pop another 2 items from the stack and set instruction pointer to label L. - /// - /// Goto also needs to rethrow ThreadAbortException iff it jumps out of a catch handler and + /// + /// Goto also needs to rethrow ThreadAbortException iff it jumps out of a catch handler and /// the current thread is in "abort requested" state. /// internal sealed class GotoInstruction : IndexedBranchInstruction { @@ -192,8 +192,8 @@ internal sealed class GotoInstruction : IndexedBranchInstruction { // TODO: We can remember hasValue in label and look it up when calculating stack balance. That would save some cache. private readonly bool _hasValue; - // The values should technically be Consumed = 1, Produced = 1 for gotos that target a label whose continuation depth - // is different from the current continuation depth. However, in case of forward gotos, we don't not know that is the + // The values should technically be Consumed = 1, Produced = 1 for gotos that target a label whose continuation depth + // is different from the current continuation depth. However, in case of forward gotos, we don't not know that is the // case until the label is emitted. By then the consumed and produced stack information is useless. // The important thing here is that the stack balance is 0. public override int ConsumedContinuations => 0; @@ -243,7 +243,7 @@ internal static EnterTryFinallyInstruction Create(int labelIndex) { } public override int Run(InterpretedFrame frame) { - // Push finally. + // Push finally. frame.PushContinuation(_labelIndex); return 1; } @@ -299,10 +299,10 @@ private EnterExceptionHandlerInstruction(bool hasValue) { _hasValue = hasValue; } - // If an exception is throws in try-body the expression result of try-body is not evaluated and loaded to the stack. + // If an exception is throws in try-body the expression result of try-body is not evaluated and loaded to the stack. // So the stack doesn't contain the try-body's value when we start executing the handler. - // However, while emitting instructions try block falls thru the catch block with a value on stack. - // We need to declare it consumed so that the stack state upon entry to the handler corresponds to the real + // However, while emitting instructions try block falls thru the catch block with a value on stack. + // We need to declare it consumed so that the stack state upon entry to the handler corresponds to the real // stack depth after throw jumped to this catch block. public override int ConsumedStack => _hasValue ? 1 : 0; @@ -325,7 +325,7 @@ internal sealed class LeaveExceptionHandlerInstruction : IndexedBranchInstructio private readonly bool _hasValue; - // The catch block yields a value if the body is non-void. This value is left on the stack. + // The catch block yields a value if the body is non-void. This value is left on the stack. public override int ConsumedStack => _hasValue ? 1 : 0; public override int ProducedStack => _hasValue ? 1 : 0; @@ -365,7 +365,7 @@ internal sealed class LeaveFaultInstruction : Instruction { // and pop it at the end. public override int ConsumedStack => 1; - // While emitting instructions a non-void try-fault expression is expected to produce a value. + // While emitting instructions a non-void try-fault expression is expected to produce a value. public override int ProducedStack => _hasValue ? 1 : 0; private LeaveFaultInstruction(bool hasValue) { @@ -452,7 +452,7 @@ public override int Run(InterpretedFrame frame) { // // The first is okay, it just means we take longer to compile. // The second we explicitly guard against inside of Compile(). - // + // // We can't miss 0. The first thread that writes -1 must have read 0 and hence start compilation. if (unchecked(_compilationThreshold--) == 0) { if (frame.Interpreter.CompileSynchronously) { diff --git a/Dynamic/Interpreter/Instructions/DivInstruction.cs b/Dynamic/Interpreter/Instructions/DivInstruction.cs index 345ccb47..7a28acab 100644 --- a/Dynamic/Interpreter/Instructions/DivInstruction.cs +++ b/Dynamic/Interpreter/Instructions/DivInstruction.cs @@ -5,10 +5,10 @@ using System; using System.Diagnostics; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { internal abstract class DivInstruction : Instruction { private static Instruction _Int16, _Int32, _Int64, _UInt16, _UInt32, _UInt64, _Single, _Double; diff --git a/Dynamic/Interpreter/Instructions/DynamicInstructionN.cs b/Dynamic/Interpreter/Instructions/DynamicInstructionN.cs index 86c4bfd2..ce02458c 100644 --- a/Dynamic/Interpreter/Instructions/DynamicInstructionN.cs +++ b/Dynamic/Interpreter/Instructions/DynamicInstructionN.cs @@ -6,9 +6,9 @@ using System.Linq; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { internal sealed partial class DynamicInstructionN : Instruction { private readonly CallInstruction _targetInvocationInstruction; private readonly object _targetDelegate; diff --git a/Dynamic/Interpreter/Instructions/DynamicInstructions.Generated.cs b/Dynamic/Interpreter/Instructions/DynamicInstructions.Generated.cs index 8f3b4a4c..33da4fce 100644 --- a/Dynamic/Interpreter/Instructions/DynamicInstructions.Generated.cs +++ b/Dynamic/Interpreter/Instructions/DynamicInstructions.Generated.cs @@ -5,9 +5,9 @@ using System; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { internal partial class DynamicInstructionN { internal static Type GetDynamicInstructionType(Type delegateType) { Type[] argTypes = delegateType.GetGenericArguments(); @@ -43,7 +43,7 @@ internal static Type GetDynamicInstructionType(Type delegateType) { default: throw Assert.Unreachable; } - + return genericType.MakeGenericType(newArgTypes); } @@ -74,7 +74,7 @@ internal static Instruction CreateUntypedInstruction(CallSiteBinder binder, int // *** END GENERATED CODE *** #endregion - + default: return null; } } diff --git a/Dynamic/Interpreter/Instructions/DynamicSplatInstruction.cs b/Dynamic/Interpreter/Instructions/DynamicSplatInstruction.cs index 0dd5993f..d5f593dd 100644 --- a/Dynamic/Interpreter/Instructions/DynamicSplatInstruction.cs +++ b/Dynamic/Interpreter/Instructions/DynamicSplatInstruction.cs @@ -5,9 +5,9 @@ using System; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { /// /// Implements dynamic call site with many arguments. Wraps the arguments into . /// diff --git a/Dynamic/Interpreter/Instructions/EqualInstruction.cs b/Dynamic/Interpreter/Instructions/EqualInstruction.cs index 951ef68f..48502fda 100644 --- a/Dynamic/Interpreter/Instructions/EqualInstruction.cs +++ b/Dynamic/Interpreter/Instructions/EqualInstruction.cs @@ -4,9 +4,9 @@ using System; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { internal abstract class EqualInstruction : Instruction { // Perf: EqualityComparer but is 3/2 to 2 times slower. private static Instruction _Reference, _Boolean, _SByte, _Int16, _Char, _Int32, _Int64, _Byte, _UInt16, _UInt32, _UInt64, _Single, _Double; diff --git a/Dynamic/Interpreter/Instructions/FieldOperations.cs b/Dynamic/Interpreter/Instructions/FieldOperations.cs index cc5c2ffa..88a0bae2 100644 --- a/Dynamic/Interpreter/Instructions/FieldOperations.cs +++ b/Dynamic/Interpreter/Instructions/FieldOperations.cs @@ -5,9 +5,9 @@ using System.Diagnostics; using System.Reflection; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { internal sealed class LoadStaticFieldInstruction : Instruction { private readonly FieldInfo _field; @@ -77,4 +77,4 @@ public override int Run(InterpretedFrame frame) { return +1; } } -} \ No newline at end of file +} diff --git a/Dynamic/Interpreter/Instructions/GreaterThanInstruction.cs b/Dynamic/Interpreter/Instructions/GreaterThanInstruction.cs index e9feba0c..3b9db06e 100644 --- a/Dynamic/Interpreter/Instructions/GreaterThanInstruction.cs +++ b/Dynamic/Interpreter/Instructions/GreaterThanInstruction.cs @@ -5,9 +5,9 @@ using System; using System.Diagnostics; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { internal abstract class GreaterThanInstruction : Instruction { private static Instruction _SByte, _Int16, _Char, _Int32, _Int64, _Byte, _UInt16, _UInt32, _UInt64, _Single, _Double; diff --git a/Dynamic/Interpreter/Instructions/Instruction.cs b/Dynamic/Interpreter/Instructions/Instruction.cs index 28d0201a..4d29eab5 100644 --- a/Dynamic/Interpreter/Instructions/Instruction.cs +++ b/Dynamic/Interpreter/Instructions/Instruction.cs @@ -5,9 +5,9 @@ using System; using System.Collections.Generic; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { public interface IInstructionProvider { void AddInstructions(LightCompiler compiler); } diff --git a/Dynamic/Interpreter/Instructions/InstructionFactory.cs b/Dynamic/Interpreter/Instructions/InstructionFactory.cs index 1ae8f34c..44b3b19c 100644 --- a/Dynamic/Interpreter/Instructions/InstructionFactory.cs +++ b/Dynamic/Interpreter/Instructions/InstructionFactory.cs @@ -6,9 +6,9 @@ using System.Collections.Generic; using System.Numerics; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { public abstract class InstructionFactory { // TODO: weak table for types in a collectible assembly? private static Dictionary _factories; diff --git a/Dynamic/Interpreter/Instructions/InstructionList.cs b/Dynamic/Interpreter/Instructions/InstructionList.cs index 6d512d7c..99e4fd79 100644 --- a/Dynamic/Interpreter/Instructions/InstructionList.cs +++ b/Dynamic/Interpreter/Instructions/InstructionList.cs @@ -11,10 +11,10 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Security; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes")] [DebuggerTypeProxy(typeof(InstructionArray.DebugView))] public struct InstructionArray { @@ -27,7 +27,7 @@ public struct InstructionArray { // list of (instruction index, cookie) sorted by instruction index: internal readonly List> DebugCookies; - internal InstructionArray(int maxStackDepth, int maxContinuationDepth, Instruction[] instructions, + internal InstructionArray(int maxStackDepth, int maxContinuationDepth, Instruction[] instructions, object[] objects, RuntimeLabel[] labels, List> debugCookies) { MaxStackDepth = maxStackDepth; @@ -54,9 +54,9 @@ public DebugView(InstructionArray array) { public InstructionList.DebugView.InstructionView[]/*!*/ A0 { get { return InstructionList.DebugView.GetInstructionViews( - _array.Instructions, - _array.Objects, - (index) => _array.Labels[index].Index, + _array.Instructions, + _array.Objects, + (index) => _array.Labels[index].Index, _array.DebugCookies ); } @@ -78,7 +78,7 @@ public sealed class InstructionList { private int _maxContinuationDepth; private int _runtimeLabelCount; private List _labels; - + // list of (instruction index, cookie) sorted by instruction index: private List> _debugCookies = null; @@ -95,9 +95,9 @@ public DebugView(InstructionList list) { public InstructionView[]/*!*/ A0 { get { return GetInstructionViews( - _list._instructions, - _list._objects, - (index) => _list._labels[index].TargetIndex, + _list._instructions, + _list._objects, + (index) => _list._labels[index].TargetIndex, _list._debugCookies ); } @@ -263,7 +263,7 @@ public InstructionArray ToArray() { return new InstructionArray( _maxStackDepth, _maxContinuationDepth, - _instructions.ToArray(), + _instructions.ToArray(), _objects?.ToArray(), BuildRuntimeLabels(), _debugCookies @@ -306,8 +306,8 @@ public void EmitLoad(object value, Type type) { if (value is bool b) { EmitLoad(b); return; - } - + } + if (value is int i) { if (i >= PushIntMinCachedValue && i <= PushIntMaxCachedValue) { if (_ints == null) { @@ -726,7 +726,7 @@ private Instruction GetLoadField(FieldInfo field) { return instruction; } } - + public void EmitStoreField(FieldInfo field) { if (field.IsStatic) { Emit(new StoreStaticFieldInstruction(field)); diff --git a/Dynamic/Interpreter/Instructions/LabelInfo.cs b/Dynamic/Interpreter/Instructions/LabelInfo.cs index 0699e5b8..11474554 100644 --- a/Dynamic/Interpreter/Instructions/LabelInfo.cs +++ b/Dynamic/Interpreter/Instructions/LabelInfo.cs @@ -8,9 +8,9 @@ using System.Linq; using System.Linq.Expressions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { /// /// Contains compiler state corresponding to a LabelTarget @@ -26,7 +26,7 @@ internal sealed class LabelInfo { // The blocks where this label is defined. If it has more than one item, // the blocks can't be jumped to except from a child block // If there's only 1 block (the common case) it's stored here, if there's multiple blocks it's stored - // as a HashSet + // as a HashSet private object _definitions; // Blocks that jump to this block @@ -75,7 +75,7 @@ internal void Define(LabelScopeInfo block) { // Was just redefined, if we had any across block jumps, they're // now invalid if (_acrossBlockJump) { - throw new InvalidOperationException("Ambiguous jump"); + throw new InvalidOperationException("Ambiguous jump"); } // For local jumps, we need a new IL label // This is okay because: @@ -137,7 +137,7 @@ private void EnsureLabel(LightCompiler compiler) { if (_label == null) { _label = compiler.Instructions.MakeLabel(); } - } + } private bool DefinedIn(LabelScopeInfo scope) { if (_definitions == scope) { diff --git a/Dynamic/Interpreter/Instructions/LessThanInstruction.cs b/Dynamic/Interpreter/Instructions/LessThanInstruction.cs index 2993a145..76872762 100644 --- a/Dynamic/Interpreter/Instructions/LessThanInstruction.cs +++ b/Dynamic/Interpreter/Instructions/LessThanInstruction.cs @@ -5,10 +5,10 @@ using System; using System.Diagnostics; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { internal abstract class LessThanInstruction : Instruction { private readonly object _nullValue; private static Instruction _SByte, _Int16, _Char, _Int32, _Int64, _Byte, _UInt16, _UInt32, _UInt64, _Single, _Double; diff --git a/Dynamic/Interpreter/Instructions/LocalAccess.cs b/Dynamic/Interpreter/Instructions/LocalAccess.cs index f49531d6..cffdd295 100644 --- a/Dynamic/Interpreter/Instructions/LocalAccess.cs +++ b/Dynamic/Interpreter/Instructions/LocalAccess.cs @@ -7,9 +7,9 @@ using System.Reflection; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { internal interface IBoxableInstruction { Instruction BoxIfIndexMatches(int index); } @@ -22,8 +22,8 @@ protected LocalAccessInstruction(int index) { } public override string ToDebugString(int instructionIndex, object cookie, Func labelIndexer, IList objects) { - return cookie == null ? - InstructionName + "(" + _index + ")" : + return cookie == null ? + InstructionName + "(" + _index + ")" : InstructionName + "(" + cookie + ": " + _index + ")"; } } @@ -42,7 +42,7 @@ public override int Run(InterpretedFrame frame) { //frame.Push(frame.Data[_index]); return +1; } - + public Instruction BoxIfIndexMatches(int index) { return (index == _index) ? InstructionList.LoadLocalBoxed(index) : null; } diff --git a/Dynamic/Interpreter/Instructions/NotEqualInstruction.cs b/Dynamic/Interpreter/Instructions/NotEqualInstruction.cs index 97739777..08fbd903 100644 --- a/Dynamic/Interpreter/Instructions/NotEqualInstruction.cs +++ b/Dynamic/Interpreter/Instructions/NotEqualInstruction.cs @@ -4,9 +4,9 @@ using System; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { internal abstract class NotEqualInstruction : Instruction { // Perf: EqualityComparer but is 3/2 to 2 times slower. private static Instruction _Reference, _Boolean, _SByte, _Int16, _Char, _Int32, _Int64, _Byte, _UInt16, _UInt32, _UInt64, _Single, _Double; diff --git a/Dynamic/Interpreter/Instructions/NumericConvertInstruction.cs b/Dynamic/Interpreter/Instructions/NumericConvertInstruction.cs index 0ff5cde6..8e84b00b 100644 --- a/Dynamic/Interpreter/Instructions/NumericConvertInstruction.cs +++ b/Dynamic/Interpreter/Instructions/NumericConvertInstruction.cs @@ -4,9 +4,9 @@ using System; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { internal abstract class NumericConvertInstruction : Instruction { internal readonly TypeCode _from, _to; @@ -236,4 +236,4 @@ private object ConvertDouble(Double obj) { } } } -} \ No newline at end of file +} diff --git a/Dynamic/Interpreter/Instructions/StackOperations.cs b/Dynamic/Interpreter/Instructions/StackOperations.cs index 020a820b..fafade28 100644 --- a/Dynamic/Interpreter/Instructions/StackOperations.cs +++ b/Dynamic/Interpreter/Instructions/StackOperations.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { internal sealed class LoadObjectInstruction : Instruction { private readonly object _value; @@ -42,7 +42,7 @@ public override int Run(InterpretedFrame frame) { public override string ToDebugString(int instructionIndex, object cookie, Func labelIndexer, IList objects) { return $"LoadCached({_index}: {objects[(int)_index]})"; } - + public override string ToString() { return "LoadCached(" + _index + ")"; } diff --git a/Dynamic/Interpreter/Instructions/TypeOperations.cs b/Dynamic/Interpreter/Instructions/TypeOperations.cs index b466d075..7df2bcc6 100644 --- a/Dynamic/Interpreter/Instructions/TypeOperations.cs +++ b/Dynamic/Interpreter/Instructions/TypeOperations.cs @@ -6,9 +6,9 @@ using System.Reflection; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { internal sealed class CreateDelegateInstruction : Instruction { private readonly LightDelegateCreator _creator; @@ -99,7 +99,7 @@ public override int Run(InterpretedFrame frame) { } public override string ToString() { - return "TypeIs " + typeof(T).Name; + return "TypeIs " + typeof(T).Name; } } diff --git a/Dynamic/Interpreter/InterpretedFrame.cs b/Dynamic/Interpreter/InterpretedFrame.cs index 26f949e5..d031444e 100644 --- a/Dynamic/Interpreter/InterpretedFrame.cs +++ b/Dynamic/Interpreter/InterpretedFrame.cs @@ -8,11 +8,11 @@ using System.Reflection; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Utils; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Utils; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Interpreter { - using InterpretedFrameThreadLocal = Microsoft.Scripting.Utils.ThreadLocal; +namespace Riverside.Scripting.Interpreter { + using InterpretedFrameThreadLocal = Riverside.Scripting.Utils.ThreadLocal; public sealed class InterpretedFrame { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] diff --git a/Dynamic/Interpreter/Interpreter.cs b/Dynamic/Interpreter/Interpreter.cs index 9da6d7bf..3dca4e39 100644 --- a/Dynamic/Interpreter/Interpreter.cs +++ b/Dynamic/Interpreter/Interpreter.cs @@ -9,16 +9,16 @@ using System.Runtime.CompilerServices; using System.Threading; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { /// /// A simple forth-style stack machine for executing Expression trees /// without the need to compile to IL and then invoke the JIT. This trades /// off much faster compilation time for a slower execution performance. - /// For code that is only run a small number of times this can be a + /// For code that is only run a small number of times this can be a /// sweet spot. - /// + /// /// The core loop in the interpreter is the RunInstructions method. /// internal sealed class Interpreter { @@ -76,8 +76,8 @@ internal int ClosureSize { /// Runs instructions within the given frame. /// /// - /// Interpreted stack frames are linked via Parent reference so that each CLR frame of this method corresponds - /// to an interpreted stack frame in the chain. It is therefore possible to combine CLR stack traces with + /// Interpreted stack frames are linked via Parent reference so that each CLR frame of this method corresponds + /// to an interpreted stack frame in the chain. It is therefore possible to combine CLR stack traces with /// interpreted stack traces by aligning interpreted frames to the frames of this method. /// Each group of subsequent frames of Run method corresponds to a single interpreted frame. /// @@ -116,7 +116,7 @@ private ExceptionHandlingResult HandleException(InterpretedFrame frame, Exceptio } return ExceptionHandlingResult.Return; } - + #if FEATURE_THREAD // stay in the current catch so that ThreadAbortException is not rethrown by CLR: if (exception is ThreadAbortException abort) { @@ -134,7 +134,7 @@ private ExceptionHandlingResult HandleException(InterpretedFrame frame, Exceptio index += curInstr.Run(frame); frame.InstructionIndex = index; - + if (curInstr is LeaveExceptionHandlerInstruction) { // we've completed handling of this exception return ExceptionHandlingResult.Continue; @@ -164,7 +164,7 @@ enum ExceptionHandlingResult { } #if FEATURE_THREAD - // To get to the current AbortReason object on Thread.CurrentThread + // To get to the current AbortReason object on Thread.CurrentThread // we need to use ExceptionState property of any ThreadAbortException instance. [ThreadStatic] private static ThreadAbortException _anyAbortException; diff --git a/Dynamic/Interpreter/LightCompiler.cs b/Dynamic/Interpreter/LightCompiler.cs index f610b4f3..c3e072d2 100644 --- a/Dynamic/Interpreter/LightCompiler.cs +++ b/Dynamic/Interpreter/LightCompiler.cs @@ -12,12 +12,12 @@ using System.Runtime.CompilerServices; using System.Security; -using Microsoft.Scripting.Ast; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Ast; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { public sealed class ExceptionHandler { public readonly Type ExceptionType; public readonly int StartIndex; @@ -91,7 +91,7 @@ int IComparer.Compare(DebugInfo d1, DebugInfo d2) { return -1; } } - + public static DebugInfo GetMatchingDebugInfo(DebugInfo[] debugInfos, int index) { //Create a faked DebugInfo to do the search DebugInfo d = new DebugInfo { Index = index }; @@ -124,7 +124,7 @@ public override string ToString() [Serializable] public struct InterpretedFrameInfo { public readonly string MethodName; - + // TODO: [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public readonly DebugInfo DebugInfo; @@ -149,7 +149,7 @@ public sealed class LightCompiler { private readonly LocalVariables _locals = new LocalVariables(); private readonly List _handlers = new List(); - + private readonly List _debugInfos = new List(); private readonly HybridReferenceDictionary _treeLabels = new HybridReferenceDictionary(); private LabelScopeInfo _labelBlock = new LabelScopeInfo(null, LabelScopeKind.Lambda); @@ -191,7 +191,7 @@ internal LightDelegateCreator CompileTop(LambdaExpression node) { } Compile(node.Body); - + // pop the result of the last expression: if (node.Body.Type != typeof(void) && node.ReturnType == typeof(void)) { Instructions.EmitPop(); @@ -353,7 +353,7 @@ private void CompileBlockExpression(Expression expr, bool asVoid) { private LocalDefinition[] CompileBlockStart(BlockExpression node) { var start = Instructions.Count; - + LocalDefinition[] locals; var variables = node.Variables; if (variables.Count != 0) { @@ -492,14 +492,14 @@ private void CompileAssignBinaryExpression(Expression expr, bool asVoid) { switch (node.Left.NodeType) { case ExpressionType.Index: - CompileIndexAssignment(node, asVoid); + CompileIndexAssignment(node, asVoid); break; case ExpressionType.MemberAccess: - CompileMemberAssignment(node, asVoid); + CompileMemberAssignment(node, asVoid); break; case ExpressionType.Parameter: case ExpressionType.Extension: - CompileVariableAssignment(node, asVoid); + CompileVariableAssignment(node, asVoid); break; default: throw new InvalidOperationException("Invalid lvalue for assignment: " + node.Left.NodeType); @@ -575,7 +575,7 @@ private void CompileComparison(ExpressionType nodeType, Expression left, Express Compile(left); Compile(right); - + switch (nodeType) { case ExpressionType.LessThan: Instructions.EmitLessThan(left.Type); break; case ExpressionType.LessThanOrEqual: Instructions.EmitLessThanOrEqual(left.Type); break; @@ -636,7 +636,7 @@ private void CompileConvertToType(Type typeFrom, Type typeTo, bool isChecked) { return; } - // TODO: Conversions to a super-class or implemented interfaces are no-op. + // TODO: Conversions to a super-class or implemented interfaces are no-op. // A conversion to a non-implemented interface or an unrelated class, etc. should fail. return; } @@ -652,7 +652,7 @@ private void CompileNotExpression(UnaryExpression node) { private void CompileUnaryExpression(Expression expr) { var node = (UnaryExpression)expr; - + if (node.Method != null) { Compile(node.Operand); EmitCall(node.Method); @@ -892,7 +892,7 @@ private bool TryPushLabelBlock(Expression node) { // Anything that is "statement-like" -- e.g. has no associated // stack state can be jumped into, with the exception of try-blocks // We indicate this by a "Block" - // + // // Otherwise, we push an "Expression" to indicate that it can't be // jumped into switch (node.NodeType) { @@ -1054,8 +1054,8 @@ private void CompileTryExpression(Expression expr) { // handlers jump here: Instructions.MarkLabel(gotoEnd); Instructions.EmitGoto(end, hasValue, hasValue); - - // keep the result on the stack: + + // keep the result on the stack: if (node.Handlers.Count > 0) { // TODO: emulates faults (replace by true fault support) if (node.Finally == null && node.Handlers.Count == 1) { @@ -1120,7 +1120,7 @@ private void CompileTryExpression(Expression expr) { _handlers.Add(new ExceptionHandler(tryStart, tryEnd, handlerLabel, handlerStart, handler.Test)); PopLabelBlock(LabelScopeKind.Catch); - + _locals.UndefineLocal(local, Instructions.Count); } @@ -1128,7 +1128,7 @@ private void CompileTryExpression(Expression expr) { throw new NotImplementedException(); } } - + if (node.Finally != null) { PushLabelBlock(LabelScopeKind.Finally); @@ -1195,7 +1195,7 @@ public void EmitCall(MethodInfo method, ParameterInfo[] parameters) { instruction = CallInstruction.Create(method, parameters); } catch (SecurityException) { _forceCompile = true; - + Instructions.Emit(new PopNInstruction((method.IsStatic ? 0 : 1) + parameters.Length)); if (method.ReturnType != typeof(void)) { Instructions.EmitLoad(null); diff --git a/Dynamic/Interpreter/LightDelegateCreator.cs b/Dynamic/Interpreter/LightDelegateCreator.cs index c9b16df4..9a7f9418 100644 --- a/Dynamic/Interpreter/LightDelegateCreator.cs +++ b/Dynamic/Interpreter/LightDelegateCreator.cs @@ -7,11 +7,11 @@ using System.Linq.Expressions; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Ast; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Ast; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { /// /// Manages creation of interpreted delegates. These delegates will get @@ -122,7 +122,7 @@ internal void Compile(object state) { } PerfTrack.NoteEvent(PerfTrack.Categories.Compiler, "Interpreted lambda compiled"); - + // Interpreter needs a standard delegate type. // So change the lambda's delegate type to Func<...> or // Action<...> so it can be called from the LightLambda.Run diff --git a/Dynamic/Interpreter/LightLambda.Generated.cs b/Dynamic/Interpreter/LightLambda.Generated.cs index 9fb74753..09915b91 100644 --- a/Dynamic/Interpreter/LightLambda.Generated.cs +++ b/Dynamic/Interpreter/LightLambda.Generated.cs @@ -6,9 +6,9 @@ using System; using System.Runtime.CompilerServices; using System.Reflection; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { public partial class LightLambda { #region Generated LightLambda Run Methods diff --git a/Dynamic/Interpreter/LightLambda.cs b/Dynamic/Interpreter/LightLambda.cs index 628c8c70..1d0c0127 100644 --- a/Dynamic/Interpreter/LightLambda.cs +++ b/Dynamic/Interpreter/LightLambda.cs @@ -10,12 +10,12 @@ using System.Security; using System.Threading.Tasks; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { public sealed class LightLambdaCompileEventArgs : EventArgs { public Delegate Compiled { get; } @@ -93,7 +93,7 @@ private static Func MakeRunDelegateCtor(Type delegateType if (DelegateHelpers.MakeDelegate(paramTypes) == delegateType) { name = "Make" + name + paramInfos.Length; - + MethodInfo ctorMethod = typeof(LightLambda).GetMethod(name, BindingFlags.NonPublic | BindingFlags.Static).MakeGenericMethod(paramTypes); return _runCache[delegateType] = (Func)ctorMethod.CreateDelegate(typeof(Func)); } @@ -118,7 +118,7 @@ private static Func MakeRunDelegateCtor(Type delegateType var targetMethod = runMethod.IsGenericMethodDefinition ? runMethod.MakeGenericMethod(paramTypes) : runMethod; return _runCache[delegateType] = lambda => targetMethod.CreateDelegate(delegateType, lambda); } - + //TODO enable sharing of these custom delegates private Delegate CreateCustomDelegate(Type delegateType) { PerfTrack.NoteEvent(PerfTrack.Categories.Compiler, "Synchronously compiling a custom delegate"); @@ -179,8 +179,8 @@ private bool TryGetCompiled() { if (_interpreter.CompileSynchronously) { _delegateCreator.Compile(null); return TryGetCompiled(); - } - + } + // Kick off the compile on another thread so this one can keep going new Task(_delegateCreator.Compile, null).Start(); } diff --git a/Dynamic/Interpreter/LightLambdaClosureVisitor.cs b/Dynamic/Interpreter/LightLambdaClosureVisitor.cs index bde45879..1e57dd3b 100644 --- a/Dynamic/Interpreter/LightLambdaClosureVisitor.cs +++ b/Dynamic/Interpreter/LightLambdaClosureVisitor.cs @@ -7,16 +7,16 @@ using System.Linq.Expressions; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { /// /// Visits a LambdaExpression, replacing the constants with direct accesses /// to their StrongBox fields. This is very similar to what /// ExpressionQuoter does for LambdaCompiler. - /// + /// /// Also inserts debug information tracking similar to what the interpreter /// would do. /// diff --git a/Dynamic/Interpreter/LocalVariables.cs b/Dynamic/Interpreter/LocalVariables.cs index b747604d..d5c07d78 100644 --- a/Dynamic/Interpreter/LocalVariables.cs +++ b/Dynamic/Interpreter/LocalVariables.cs @@ -8,9 +8,9 @@ using System.Linq.Expressions; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { public sealed class LocalVariable { private const int IsBoxedFlag = 1; private const int InClosureFlag = 2; @@ -120,7 +120,7 @@ public void UndefineLocal(LocalDefinition definition, int end) { } else { _variables.Remove(definition.Parameter); } - + _localCount--; } @@ -130,7 +130,7 @@ internal void Box(ParameterExpression variable, InstructionList instructions) { LocalVariable local = scope.Variable; Debug.Assert(!local.IsBoxed && !local.InClosure); _variables[variable].Variable.IsBoxed = true; - + int curChild = 0; for (int i = scope.Start; i < scope.Stop && i < instructions.Count; i++) { if (scope.ChildScopes != null && scope.ChildScopes[curChild].Start == i) { diff --git a/Dynamic/Interpreter/LoopCompiler.cs b/Dynamic/Interpreter/LoopCompiler.cs index f3313a50..144c21a0 100644 --- a/Dynamic/Interpreter/LoopCompiler.cs +++ b/Dynamic/Interpreter/LoopCompiler.cs @@ -8,11 +8,11 @@ using System.Linq.Expressions; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Ast; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Ast; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Interpreter { - using AstUtils = Microsoft.Scripting.Ast.Utils; +namespace Riverside.Scripting.Interpreter { + using AstUtils = Riverside.Scripting.Ast.Utils; using LoopFunc = Func[], InterpretedFrame, int>; internal sealed class LoopCompiler : ExpressionVisitor { @@ -37,10 +37,10 @@ public override string ToString() { private readonly ParameterExpression _frameVar; private readonly LabelTarget _returnLabel; // locals and closure variables defined outside the loop - private readonly Dictionary _outerVariables, _closureVariables; + private readonly Dictionary _outerVariables, _closureVariables; private readonly LoopExpression _loop; private ReadOnlyCollectionBuilder _temps; - // tracks variables that flow in and flow out for initialization and + // tracks variables that flow in and flow out for initialization and private readonly Dictionary _loopVariables; // variables which are defined and used within the loop private HashSet _loopLocals; @@ -124,8 +124,8 @@ protected override Expression VisitExtension(Expression node) { protected override Expression VisitGoto(GotoExpression node) { var target = node.Target; var value = Visit(node.Value); - - // TODO: Is it possible for an inner reducible node of the loop to rely on nodes produced by reducing outer reducible nodes? + + // TODO: Is it possible for an inner reducible node of the loop to rely on nodes produced by reducing outer reducible nodes? // Unknown label => must be within the loop: if (!_labelMapping.TryGetValue(target, out BranchLabel label)) { @@ -137,7 +137,7 @@ protected override Expression VisitGoto(GotoExpression node) { return node.Update(target, value); } - return Expression.Return(_returnLabel, + return Expression.Return(_returnLabel, (value != null) ? Expression.Call(_frameVar, InterpretedFrame.GotoMethod, Expression.Constant(label.LabelIndex), AstUtils.Box(value)) : Expression.Call(_frameVar, InterpretedFrame.VoidGotoMethod, Expression.Constant(label.LabelIndex)), @@ -150,14 +150,14 @@ protected override Expression VisitGoto(GotoExpression node) { #region Local Variables // Gather all outer variables accessed in the loop. - // Determines which ones are read from and written to. - // We will consider a variable as "read" if it is read anywhere in the loop even though + // Determines which ones are read from and written to. + // We will consider a variable as "read" if it is read anywhere in the loop even though // the first operation might actually always be "write". We could do better if we had CFG. protected override Expression VisitBlock(BlockExpression node) { var variables = node.Variables; var prevLocals = EnterVariableScope(variables); - + var res = base.VisitBlock(node); ExitVariableScope(prevLocals); @@ -169,7 +169,7 @@ private HashSet EnterVariableScope(ICollection(variables); return null; } - + var prevLocals = new HashSet(_loopLocals); _loopLocals.UnionWith(variables); return prevLocals; @@ -245,7 +245,7 @@ protected override Expression VisitUnary(UnaryExpression node) { return base.VisitUnary(node); } - // TODO: if we supported ref/out parameter we would need to override + // TODO: if we supported ref/out parameter we would need to override // MethodCallExpression, VisitDynamic and VisitNew protected override Expression VisitParameter(ParameterExpression node) { @@ -265,7 +265,7 @@ private Expression VisitVariable(ParameterExpression node, ExpressionAccess acce // existing outer variable that we are already tracking box = existing.BoxStorage; _loopVariables[node] = new LoopVariable(existing.Access | access, box); - } else if (_outerVariables.TryGetValue(node, out LocalVariable loc) || + } else if (_outerVariables.TryGetValue(node, out LocalVariable loc) || (_closureVariables != null && _closureVariables.TryGetValue(node, out loc))) { // not tracking this variable yet, but defined in outer scope and seen for the 1st time @@ -286,7 +286,7 @@ private Expression VisitVariable(ParameterExpression node, ExpressionAccess acce // box.Value = (object)rhs return LightCompiler.Unbox(box); - } + } // (T)box.Value return Expression.Convert(LightCompiler.Unbox(box), node.Type); diff --git a/Dynamic/Interpreter/RuntimeVariables.cs b/Dynamic/Interpreter/RuntimeVariables.cs index c41df079..c7b1ae6d 100644 --- a/Dynamic/Interpreter/RuntimeVariables.cs +++ b/Dynamic/Interpreter/RuntimeVariables.cs @@ -4,7 +4,7 @@ using System.Runtime.CompilerServices; -namespace Microsoft.Scripting.Interpreter { +namespace Riverside.Scripting.Interpreter { internal sealed class RuntimeVariables : IRuntimeVariables { private readonly IStrongBox[] _boxes; diff --git a/Dynamic/KeyboardInterruptException.cs b/Dynamic/KeyboardInterruptException.cs index 5005bacc..2bb9bdf2 100644 --- a/Dynamic/KeyboardInterruptException.cs +++ b/Dynamic/KeyboardInterruptException.cs @@ -5,7 +5,7 @@ using System; using System.Runtime.Serialization; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { [Serializable] public class KeyboardInterruptException : Exception { public KeyboardInterruptException() : base() { } diff --git a/Dynamic/MultiRuntimeAwareAttribute.cs b/Dynamic/MultiRuntimeAwareAttribute.cs index 6d189f87..5e79625a 100644 --- a/Dynamic/MultiRuntimeAwareAttribute.cs +++ b/Dynamic/MultiRuntimeAwareAttribute.cs @@ -5,19 +5,19 @@ using System; using System.Diagnostics; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// marks a field, class, or struct as being safe to have statics which can be accessed /// from multiple runtimes. - /// - /// Static fields which are not read-only or marked with this attribute will be flagged + /// + /// Static fields which are not read-only or marked with this attribute will be flagged /// by a test which looks for state being shared between runtimes. Before applying this /// attribute you should ensure that it is safe to share the state. This is typically /// state which is lazy initialized or state which is caching values which are identical /// in all runtimes and are immutable. /// [Conditional("DEBUG")] - [AttributeUsage(AttributeTargets.Field)] + [AttributeUsage(AttributeTargets.Field)] public sealed class MultiRuntimeAwareAttribute : Attribute { } } diff --git a/Dynamic/MutableTuple.cs b/Dynamic/MutableTuple.cs index 99e31d8e..f5dfdcb6 100644 --- a/Dynamic/MutableTuple.cs +++ b/Dynamic/MutableTuple.cs @@ -10,10 +10,10 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { public abstract class MutableTuple { public const int MaxSize = 128; private static readonly Dictionary _sizeDict = new Dictionary(); @@ -98,10 +98,10 @@ public static Type GetTupleType(int size) { } /// - /// Creates a generic tuple with the specified types. - /// - /// If the number of slots fits within the maximum tuple size then we simply - /// create a single tuple. If it's greater then we create nested tuples + /// Creates a generic tuple with the specified types. + /// + /// If the number of slots fits within the maximum tuple size then we simply + /// create a single tuple. If it's greater then we create nested tuples /// (e.g. a Tuple`2 which contains a Tuple`128 and a Tuple`8 if we had a size of 136). /// public static Type MakeTupleType(params Type[] types) { @@ -123,7 +123,7 @@ public static int GetSize(Type tupleType) { } } - Stack types = new Stack(tupleType.GetGenericArguments()); + Stack types = new Stack(tupleType.GetGenericArguments()); while (types.Count != 0) { Type t = types.Pop(); @@ -202,7 +202,7 @@ internal static IEnumerable GetAccessPath(int size, int index) { // inner most tuples. The mask is initialized to mask the upper bits and adjust is initialized // and adjust is the value we need to divide by to get the index in the least significant bits. // As we go through we shift the mask and adjust down each loop to pull out the inner slot. Logically - // everything in here is shifting bits (not multiplying or dividing) because NewTuple.MaxSize is a + // everything in here is shifting bits (not multiplying or dividing) because NewTuple.MaxSize is a // power of 2. int depth = 0; int mask = MutableTuple.MaxSize - 1; @@ -267,7 +267,7 @@ private static MutableTuple MakeTuple(Type tupleType, int start, int end, object private static MutableTuple CreateTupleInstance(Type tupleType, int start, int end, object[] args) { if (args == null) return (MutableTuple)Activator.CreateInstance(tupleType); - + object[] realArgs = new object[tupleType.GetGenericArguments().Length]; Array.Copy(args, start, realArgs, 0, end - start); return (MutableTuple)Activator.CreateInstance(tupleType, realArgs); @@ -367,9 +367,9 @@ internal static Expression CreateNew(Type tupleType, int start, int end, Express newValues[i] = Expression.Constant(null, typeof(DynamicNull)); } } - + return Expression.New( - tupleType.GetConstructor(ArrayUtils.ConvertAll(newValues, x => x.Type)), + tupleType.GetConstructor(ArrayUtils.ConvertAll(newValues, x => x.Type)), newValues); } } diff --git a/Dynamic/PerfTrack.cs b/Dynamic/PerfTrack.cs index 7846d9f0..cebb64e2 100644 --- a/Dynamic/PerfTrack.cs +++ b/Dynamic/PerfTrack.cs @@ -7,11 +7,11 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; using System.Dynamic; using System.IO; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// This class is useful for quickly collecting performance counts for expensive /// operations. Usually this means operations involving either reflection or @@ -24,7 +24,7 @@ public static class PerfTrack { public enum Categories { /// /// temporary categories for quick investigation, use a custom key if you - /// need to track multiple items, and if you want to keep it then create + /// need to track multiple items, and if you want to keep it then create /// a new Categories entry and rename all your temporary entries. /// Temporary, @@ -42,7 +42,7 @@ public enum Categories { RuleEvaluation, // a rule was evaluated Binding, // a rule was bound BindingSlow, - BindingFast, + BindingFast, BindingTarget, // a rule was bound against a target of a specific type Count } @@ -54,8 +54,8 @@ public enum Categories { private static Dictionary> MakeEventsDictionary() { Dictionary> result = new Dictionary>(); - - // We do not use Enum.GetValues here since it is not available in SILVERLIGHT + + // We do not use Enum.GetValues here since it is not available in SILVERLIGHT for (int i = 0; i <= (int)Categories.Count; i++) { result[(Categories)i] = new Dictionary(); } @@ -74,9 +74,9 @@ public static void DumpStats() { public static void DumpHistogram(IDictionary histogram, TextWriter output) { var keys = ArrayUtils.MakeArray(histogram.Keys); var values = ArrayUtils.MakeArray(histogram.Values); - + Array.Sort(values, keys); - + for (int i = 0; i < keys.Length; i++) { output.WriteLine("{0} {1}", keys[i], values[i]); } diff --git a/Dynamic/Properties/AssemblyInfo.cs b/Dynamic/Properties/AssemblyInfo.cs index 0b4df231..959134b5 100644 --- a/Dynamic/Properties/AssemblyInfo.cs +++ b/Dynamic/Properties/AssemblyInfo.cs @@ -8,10 +8,10 @@ using System.Runtime.InteropServices; using System.Security; -[assembly: AssemblyTitle("Microsoft.Dynamic")] +[assembly: AssemblyTitle("Riverside.Dynamic")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -29,6 +29,6 @@ [assembly: System.Resources.NeutralResourcesLanguage("en-US")] [assembly: InternalsVisibleTo("TestInternalDLR, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c10ce00dd2e0ce5046d68183d3ad035b47e92bf0ce7bcf8a03a217ca5d0b0c7db973fdf97579b52b502a23d4069dbf043389e1ab65a1d6c508a9837f3e2350f15e05cc63c0fc4b0410867a51919090e4c33f80203e9b0035b21c32bae20f98b068f90d99a50133a5336480d94039b176519f5fd8524765f33be43da65c4b68ba")] -[assembly: TypeForwardedTo(typeof(Microsoft.Scripting.Runtime.DynamicStackFrame))] +[assembly: TypeForwardedTo(typeof(Riverside.Scripting.Runtime.DynamicStackFrame))] [assembly: AllowPartiallyTrustedCallers] diff --git a/Dynamic/Microsoft.Dynamic.csproj b/Dynamic/Riverside.Dynamic.csproj similarity index 85% rename from Dynamic/Microsoft.Dynamic.csproj rename to Dynamic/Riverside.Dynamic.csproj index 1682b415..832a1197 100644 --- a/Dynamic/Microsoft.Dynamic.csproj +++ b/Dynamic/Riverside.Dynamic.csproj @@ -2,15 +2,15 @@ net462;netstandard2.0;net6.0;net8.0 - Microsoft.Scripting + Riverside.Scripting 859832320 true true - - + + diff --git a/Dynamic/Microsoft.Scripting.txt b/Dynamic/Riverside.Scripting.txt similarity index 100% rename from Dynamic/Microsoft.Scripting.txt rename to Dynamic/Riverside.Scripting.txt diff --git a/Dynamic/Runtime/AmbiguousFileNameException.cs b/Dynamic/Runtime/AmbiguousFileNameException.cs index bbaee7c6..805bf154 100644 --- a/Dynamic/Runtime/AmbiguousFileNameException.cs +++ b/Dynamic/Runtime/AmbiguousFileNameException.cs @@ -5,9 +5,9 @@ using System; using System.Runtime.Serialization; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { [Serializable] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")] public class AmbiguousFileNameException : Exception { diff --git a/Dynamic/Runtime/ArgumentArray.cs b/Dynamic/Runtime/ArgumentArray.cs index f32884b3..93e27b77 100644 --- a/Dynamic/Runtime/ArgumentArray.cs +++ b/Dynamic/Runtime/ArgumentArray.cs @@ -7,10 +7,10 @@ using System.Linq.Expressions; using System.Reflection; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { - using AstUtils = Microsoft.Scripting.Ast.Utils; +namespace Riverside.Scripting.Runtime { + using AstUtils = Riverside.Scripting.Ast.Utils; /// /// Wraps all arguments passed to a dynamic site with more arguments than can be accepted by a Func/Action delegate. @@ -42,7 +42,7 @@ public DynamicMetaObject GetMetaObject(Expression parameter, int index) { return DynamicMetaObject.Create( GetArgument(index), Expression.Call( - _GetArgMethod, + _GetArgMethod, AstUtils.Convert(parameter, typeof(ArgumentArray)), AstUtils.Constant(index) ) diff --git a/Dynamic/Runtime/AssemblyTypeNames.cs b/Dynamic/Runtime/AssemblyTypeNames.cs index 7c6e3b33..916520c7 100644 --- a/Dynamic/Runtime/AssemblyTypeNames.cs +++ b/Dynamic/Runtime/AssemblyTypeNames.cs @@ -8,9 +8,9 @@ using System.Linq; using System.Reflection; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { internal struct TypeName : IEquatable { internal TypeName(Type type) { diff --git a/Dynamic/Runtime/BinderOps.cs b/Dynamic/Runtime/BinderOps.cs index 6a580dd0..7afe9779 100644 --- a/Dynamic/Runtime/BinderOps.cs +++ b/Dynamic/Runtime/BinderOps.cs @@ -10,11 +10,11 @@ using System.Reflection; using System.Text; -using Microsoft.Scripting.Actions; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Actions; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Helper methods that calls are generated to from the default DLR binders. /// diff --git a/Dynamic/Runtime/BinderType.cs b/Dynamic/Runtime/BinderType.cs index 3da84d78..c046a139 100644 --- a/Dynamic/Runtime/BinderType.cs +++ b/Dynamic/Runtime/BinderType.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public enum BinderType { /// /// The MethodBinder will perform normal method binding. @@ -15,7 +15,7 @@ public enum BinderType { BinaryOperator, ComparisonOperator, /// - /// The MethodBinder will set properties/fields for unused keyword arguments on the instance + /// The MethodBinder will set properties/fields for unused keyword arguments on the instance /// that gets returned from the method. /// Constructor diff --git a/Dynamic/Runtime/BindingRestrictionsHelpers.cs b/Dynamic/Runtime/BindingRestrictionsHelpers.cs index 1632d38c..1d0a60df 100644 --- a/Dynamic/Runtime/BindingRestrictionsHelpers.cs +++ b/Dynamic/Runtime/BindingRestrictionsHelpers.cs @@ -6,9 +6,9 @@ using System.Dynamic; using System.Linq.Expressions; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public static class BindingRestrictionsHelpers { - //If the type is Microsoft.Scripting.Runtime.DynamicNull, create an instance restriction to test null + //If the type is Riverside.Scripting.Runtime.DynamicNull, create an instance restriction to test null public static BindingRestrictions GetRuntimeTypeRestriction(Expression expr, Type type) { if (type == typeof(DynamicNull)) { return BindingRestrictions.GetInstanceRestriction(expr, null); diff --git a/Dynamic/Runtime/CallTargets.cs b/Dynamic/Runtime/CallTargets.cs index 4e52dbfa..a17ca439 100644 --- a/Dynamic/Runtime/CallTargets.cs +++ b/Dynamic/Runtime/CallTargets.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// The delegate representing the DLR Main function /// diff --git a/Dynamic/Runtime/CallTypes.cs b/Dynamic/Runtime/CallTypes.cs index 966e0816..ca164428 100644 --- a/Dynamic/Runtime/CallTypes.cs +++ b/Dynamic/Runtime/CallTypes.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { [Flags] public enum CallTypes { None = 0, diff --git a/Dynamic/Runtime/Cast.Generated.cs b/Dynamic/Runtime/Cast.Generated.cs index 47b4e581..4543b891 100644 --- a/Dynamic/Runtime/Cast.Generated.cs +++ b/Dynamic/Runtime/Cast.Generated.cs @@ -5,9 +5,9 @@ using System; using System.CodeDom.Compiler; using System.Diagnostics; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Implements explicit casts supported by the runtime. /// diff --git a/Dynamic/Runtime/Cast.cs b/Dynamic/Runtime/Cast.cs index f51f3ab1..debeec49 100644 --- a/Dynamic/Runtime/Cast.cs +++ b/Dynamic/Runtime/Cast.cs @@ -5,9 +5,9 @@ using System; using System.Diagnostics; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Implements explicit casts supported by the runtime. /// @@ -29,7 +29,7 @@ public static object Explicit(object o, Type to) { } throw new InvalidCastException($"Cannot cast null to a value type {to.Name}"); - + } // Explicit cast to reference type is simply null @@ -38,13 +38,13 @@ public static object Explicit(object o, Type to) { if (to.IsValueType) { return ExplicitCastToValueType(o, to); - } - + } + Type type = o.GetType(); if (to.IsAssignableFrom(type)) { return o; } - + throw new InvalidCastException($"Cannot cast {type.Name} to {to.Name}"); } diff --git a/Dynamic/Runtime/CodeDomCodeGen.cs b/Dynamic/Runtime/CodeDomCodeGen.cs index 32ce6d35..a1a9e390 100644 --- a/Dynamic/Runtime/CodeDomCodeGen.cs +++ b/Dynamic/Runtime/CodeDomCodeGen.cs @@ -6,9 +6,9 @@ using System.CodeDom; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")] // TODO: fix public abstract class CodeDomCodeGen { diff --git a/Dynamic/Runtime/CompilerContext.cs b/Dynamic/Runtime/CompilerContext.cs index 09f6f713..36fd28ae 100644 --- a/Dynamic/Runtime/CompilerContext.cs +++ b/Dynamic/Runtime/CompilerContext.cs @@ -2,9 +2,9 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Represents the context that is flowed for doing Compiler. Languages can derive diff --git a/Dynamic/Runtime/CustomStringDictionary.cs b/Dynamic/Runtime/CustomStringDictionary.cs index be721e97..08534ada 100644 --- a/Dynamic/Runtime/CustomStringDictionary.cs +++ b/Dynamic/Runtime/CustomStringDictionary.cs @@ -7,19 +7,19 @@ using System.Collections.Generic; using System.Diagnostics; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Abstract base class used for optimized thread-safe dictionaries which have a set /// of pre-defined string keys. - /// - /// Implementers derive from this class and override the GetExtraKeys, TrySetExtraValue, - /// and TryGetExtraValue methods. When looking up a value first the extra keys will be + /// + /// Implementers derive from this class and override the GetExtraKeys, TrySetExtraValue, + /// and TryGetExtraValue methods. When looking up a value first the extra keys will be /// searched using the optimized Try*ExtraValue functions. If the value isn't found there /// then the value is stored in the underlying .NET dictionary. - /// + /// /// This dictionary can store object values in addition to string values. It also supports /// null keys. /// @@ -36,7 +36,7 @@ public abstract class CustomStringDictionary : IDictionary, IDictionary - /// Try to set the extra value and return true if the specified key was found in the + /// Try to set the extra value and return true if the specified key was found in the /// list of extra values. /// protected internal abstract bool TrySetExtraValue(string key, object value); @@ -367,8 +367,8 @@ public virtual bool ValueEquals(object other) { return true; } - #endregion - + #endregion + public void CopyTo(Array array, int index) { throw Error.MethodOrOperatorNotImplemented(); } diff --git a/Dynamic/Runtime/DelegateInfo.cs b/Dynamic/Runtime/DelegateInfo.cs index 5e4d2553..8737998a 100644 --- a/Dynamic/Runtime/DelegateInfo.cs +++ b/Dynamic/Runtime/DelegateInfo.cs @@ -9,11 +9,11 @@ using System.Reflection.Emit; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Actions; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Actions; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Used as the value for the ScriptingRuntimeHelpers.GetDelegate method caching system /// @@ -28,8 +28,8 @@ public sealed class DelegateInfo { // to enable: // function x() { } - // someClass.someEvent += delegateType(x) - // someClass.someEvent -= delegateType(x) + // someClass.someEvent += delegateType(x) + // someClass.someEvent -= delegateType(x) // // We need to avoid re-creating the closure because the delegates won't // compare equal when removing the delegate if they have different closure @@ -43,7 +43,7 @@ public sealed class DelegateInfo { // Note that the closure content depends on the signature of the delegate. So a single dynamic object // might need multiple closures if it is converted to delegates of different signatures. private WeakDictionary _closureMap = new WeakDictionary(); - + private readonly Type _returnType; private readonly Type[] _parameterTypes; private readonly MethodInfo _method; @@ -259,11 +259,11 @@ internal static Delegate CreateDelegateForDynamicObject(LanguageContext context, convertSiteType = null; convertSite = null; } - + var locals = new List(); - + ParameterExpression invokeSiteVar = Expression.Parameter(invokeSiteType, "site"); - ParameterExpression convertSiteVar = null; + ParameterExpression convertSiteVar = null; var args = new List(); args.Add(invokeSiteVar); @@ -277,13 +277,13 @@ internal static Delegate CreateDelegateForDynamicObject(LanguageContext context, Type elementType = argType.GetElementType(); Type concreteType = typeof(StrongBox<>).MakeGenericType(elementType); - + var strongBox = Expression.Parameter(concreteType, "box" + i); locals.Add(strongBox); args.Add( Expression.Assign( - strongBox, + strongBox, Expression.New( concreteType.GetConstructor(new Type[] { elementType }), parameters[i] @@ -297,15 +297,15 @@ internal static Delegate CreateDelegateForDynamicObject(LanguageContext context, } int strongBoxVarsEnd = locals.Count; - + Expression invocation = Expression.Invoke( Expression.Field( Expression.Assign( - invokeSiteVar, + invokeSiteVar, Expression.Convert(Expression.Constant(invokeSite), invokeSiteType) - ), + ), invokeSiteType.GetDeclaredField("Target") - ), + ), args ); @@ -315,12 +315,12 @@ internal static Delegate CreateDelegateForDynamicObject(LanguageContext context, invocation = Expression.Invoke( Expression.Field( Expression.Assign( - convertSiteVar, + convertSiteVar, Expression.Convert(Expression.Constant(convertSite), convertSiteType) ), convertSiteType.GetDeclaredField("Target") ), - convertSiteVar, + convertSiteVar, invocation ); } @@ -335,7 +335,7 @@ internal static Delegate CreateDelegateForDynamicObject(LanguageContext context, // copy back from StrongBox.Value if (strongBoxVarsEnd > strongBoxVarsStart) { var block = new Expression[1 + strongBoxVarsEnd - strongBoxVarsStart + 1]; - + var resultVar = Expression.Parameter(invocation.Type, "result"); locals.Add(resultVar); @@ -351,7 +351,7 @@ internal static Delegate CreateDelegateForDynamicObject(LanguageContext context, block[b++] = Expression.Assign( parameters[i], Expression.Field(local, local.Type.GetDeclaredField("Value")) - ); + ); } } diff --git a/Dynamic/Runtime/DelegateSignatureInfo.cs b/Dynamic/Runtime/DelegateSignatureInfo.cs index 197d1a5f..b8bb4910 100644 --- a/Dynamic/Runtime/DelegateSignatureInfo.cs +++ b/Dynamic/Runtime/DelegateSignatureInfo.cs @@ -6,9 +6,9 @@ using System.Reflection; using System.Text; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Used as the key for the LanguageContext.GetDelegate method caching system /// diff --git a/Dynamic/Runtime/DlrCachedCodeAttribute.cs b/Dynamic/Runtime/DlrCachedCodeAttribute.cs index 83f3b919..79c7695b 100644 --- a/Dynamic/Runtime/DlrCachedCodeAttribute.cs +++ b/Dynamic/Runtime/DlrCachedCodeAttribute.cs @@ -4,9 +4,9 @@ using System; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// An attribute that is applied to saved ScriptCode's to be used to re-create the ScriptCode /// from disk. @@ -28,7 +28,7 @@ public CachedOptimizedCodeAttribute(string[] names) { } /// - /// Gets names stored in optimized scope. + /// Gets names stored in optimized scope. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] Names { get; } diff --git a/Dynamic/Runtime/DocumentationAttribute.cs b/Dynamic/Runtime/DocumentationAttribute.cs index 341d5d15..e7b61604 100644 --- a/Dynamic/Runtime/DocumentationAttribute.cs +++ b/Dynamic/Runtime/DocumentationAttribute.cs @@ -4,10 +4,10 @@ using System; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// - /// Provides a mechanism for providing documentation stored in an assembly as metadata. - /// + /// Provides a mechanism for providing documentation stored in an assembly as metadata. + /// /// Applying this attribute will enable documentation to be provided to the user at run-time /// even if XML Documentation files are unavailable. /// diff --git a/Dynamic/Runtime/DynamicDelegateCreator.cs b/Dynamic/Runtime/DynamicDelegateCreator.cs index 88619b20..5387039d 100644 --- a/Dynamic/Runtime/DynamicDelegateCreator.cs +++ b/Dynamic/Runtime/DynamicDelegateCreator.cs @@ -6,17 +6,17 @@ using System.Dynamic; using System.Reflection; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Provides support for converting objects to delegates using the DLR binders /// available by the provided language context. - /// + /// /// Primarily this supports converting objects implementing IDynamicMetaObjectProvider - /// to the appropriate delegate type. - /// - /// If the provided object is already a delegate of the appropriate type then the + /// to the appropriate delegate type. + /// + /// If the provided object is already a delegate of the appropriate type then the /// delegate will simply be returned. /// public class DynamicDelegateCreator { @@ -34,7 +34,7 @@ public DynamicDelegateCreator(LanguageContext languageContext) { /// The stub should be executed within a context of this object's language. /// /// The converted delegate. - /// The object is either a subclass of Delegate but not the requested type or does not implement IDynamicMetaObjectProvider. + /// The object is either a subclass of Delegate but not the requested type or does not implement IDynamicMetaObjectProvider. public Delegate GetDelegate(object callableObject, Type delegateType) { ContractUtils.RequiresNotNull(delegateType, nameof(delegateType)); @@ -64,18 +64,18 @@ public Delegate GetDelegate(object callableObject, Type delegateType) { } #if FEATURE_LCG - // Table of dynamically generated delegates which are shared based upon method signature. + // Table of dynamically generated delegates which are shared based upon method signature. // // We generate a dynamic method stub and object[] closure template for each signature. // The stub does only depend on the signature, it doesn't depend on the dynamic object. // So we can reuse these stubs among multiple dynamic object for which a delegate was created with the same signature. - // + // private Publisher _dynamicDelegateCache = new Publisher(); public Delegate GetOrCreateDelegateForDynamicObject(object dynamicObject, Type delegateType, MethodInfo invoke) { var signatureInfo = new DelegateSignatureInfo(invoke); DelegateInfo delegateInfo = _dynamicDelegateCache.GetOrCreateValue( - signatureInfo, + signatureInfo, () => new DelegateInfo(_languageContext, signatureInfo.ReturnType, signatureInfo.ParameterTypes) ); diff --git a/Dynamic/Runtime/DynamicNull.cs b/Dynamic/Runtime/DynamicNull.cs index c2790346..ff2dfb7f 100644 --- a/Dynamic/Runtime/DynamicNull.cs +++ b/Dynamic/Runtime/DynamicNull.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Represents the type of a null value. /// diff --git a/Dynamic/Runtime/ExceptionHelpers.cs b/Dynamic/Runtime/ExceptionHelpers.cs index c36f4594..76f0805a 100644 --- a/Dynamic/Runtime/ExceptionHelpers.cs +++ b/Dynamic/Runtime/ExceptionHelpers.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Diagnostics; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public static class ExceptionHelpers { #if FEATURE_STACK_TRACE private const string prevStackTraces = "PreviousStackTraces"; @@ -45,7 +45,7 @@ private static void AssociateStackTraces(Exception e, List traces) { private static bool TryGetAssociatedStackTraces(Exception e, out List traces) { traces = e.Data[prevStackTraces] as List; return traces != null; - } + } #else public static Exception UpdateForRethrow(Exception rethrow) { return rethrow; diff --git a/Dynamic/Runtime/ExplicitConversionMethodAttribute.cs b/Dynamic/Runtime/ExplicitConversionMethodAttribute.cs index c0777894..446de8b2 100644 --- a/Dynamic/Runtime/ExplicitConversionMethodAttribute.cs +++ b/Dynamic/Runtime/ExplicitConversionMethodAttribute.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { [AttributeUsage(AttributeTargets.Method, Inherited = false)] public sealed class ExplicitConversionMethodAttribute : Attribute { } diff --git a/Dynamic/Runtime/Extensible.cs b/Dynamic/Runtime/Extensible.cs index 321deb23..d57c6334 100644 --- a/Dynamic/Runtime/Extensible.cs +++ b/Dynamic/Runtime/Extensible.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public class Extensible { public Extensible() { } diff --git a/Dynamic/Runtime/ExtensionTypeAttribute.cs b/Dynamic/Runtime/ExtensionTypeAttribute.cs index 8aa3492e..34c98b98 100644 --- a/Dynamic/Runtime/ExtensionTypeAttribute.cs +++ b/Dynamic/Runtime/ExtensionTypeAttribute.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Marks a class in the assembly as being an extension type for another type. /// diff --git a/Dynamic/Runtime/ExtraKeyEnumerator.cs b/Dynamic/Runtime/ExtraKeyEnumerator.cs index e53a0aec..25f369c6 100644 --- a/Dynamic/Runtime/ExtraKeyEnumerator.cs +++ b/Dynamic/Runtime/ExtraKeyEnumerator.cs @@ -4,9 +4,9 @@ using System.Diagnostics; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { class ExtraKeyEnumerator : CheckedDictionaryEnumerator { private readonly CustomStringDictionary _idDict; private int _curIndex = -1; diff --git a/Dynamic/Runtime/Generator.cs b/Dynamic/Runtime/Generator.cs index 20e0b761..f8e26339 100644 --- a/Dynamic/Runtime/Generator.cs +++ b/Dynamic/Runtime/Generator.cs @@ -6,13 +6,13 @@ using System.Collections; using System.Collections.Generic; -using Microsoft.Scripting.Ast; +using Riverside.Scripting.Ast; // Suppress these for GeneratorNext. It's not a public API for users so the warning is irrelevant -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", MessageId = "0#", Scope = "member", Target = "Microsoft.Scripting.Runtime.GeneratorNext`1.#Invoke(System.Int32&,!0&)")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", MessageId = "1#", Scope = "member", Target = "Microsoft.Scripting.Runtime.GeneratorNext`1.#Invoke(System.Int32&,!0&)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", MessageId = "0#", Scope = "member", Target = "Riverside.Scripting.Runtime.GeneratorNext`1.#Invoke(System.Int32&,!0&)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", MessageId = "1#", Scope = "member", Target = "Riverside.Scripting.Runtime.GeneratorNext`1.#Invoke(System.Int32&,!0&)")] -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public interface IDebuggableGenerator { int YieldMarkerLocation { get; set; } } @@ -84,7 +84,7 @@ internal DebugGeneratorEnumerator(GeneratorNext next, int[] yieldMarkers) : base(next) { _yieldMarkers = yieldMarkers; } - + int IDebuggableGenerator.YieldMarkerLocation { get { if (_state < _yieldMarkers.Length) diff --git a/Dynamic/Runtime/IConvertibleMetaObject.cs b/Dynamic/Runtime/IConvertibleMetaObject.cs index 315602ca..0909bbfc 100644 --- a/Dynamic/Runtime/IConvertibleMetaObject.cs +++ b/Dynamic/Runtime/IConvertibleMetaObject.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Indicates that a DynamicMetaObject might be convertible to a CLR type. /// diff --git a/Dynamic/Runtime/ICustomScriptCodeData.cs b/Dynamic/Runtime/ICustomScriptCodeData.cs index 8d51c516..e9f3aefe 100644 --- a/Dynamic/Runtime/ICustomScriptCodeData.cs +++ b/Dynamic/Runtime/ICustomScriptCodeData.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// Gets custom data to be serialized when saving script codes to disk. /// diff --git a/Dynamic/Runtime/IMembersList.cs b/Dynamic/Runtime/IMembersList.cs index 213e0037..7697fa69 100644 --- a/Dynamic/Runtime/IMembersList.cs +++ b/Dynamic/Runtime/IMembersList.cs @@ -4,10 +4,10 @@ using System.Collections.Generic; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// - /// Provides a list of all the members of an instance. + /// Provides a list of all the members of an instance. /// public interface IMembersList { IList GetMemberNames(); diff --git a/Dynamic/Runtime/IRestrictedMetaObject.cs b/Dynamic/Runtime/IRestrictedMetaObject.cs index e7df300d..1d1ca65e 100644 --- a/Dynamic/Runtime/IRestrictedMetaObject.cs +++ b/Dynamic/Runtime/IRestrictedMetaObject.cs @@ -5,7 +5,7 @@ using System; using System.Dynamic; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Indicates that a MetaObject is already representing a restricted type. Useful /// when we're already restricted to a known type but this isn't captured in diff --git a/Dynamic/Runtime/ISlice.cs b/Dynamic/Runtime/ISlice.cs index 8d48fd12..bb367f23 100644 --- a/Dynamic/Runtime/ISlice.cs +++ b/Dynamic/Runtime/ISlice.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// A useful interface for taking slices of numeric arrays, inspired by Python's Slice objects. /// @@ -24,4 +24,4 @@ public interface ISlice { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Step")] // TODO: fix object Step { get; } } -} \ No newline at end of file +} diff --git a/Dynamic/Runtime/IdDispenser.cs b/Dynamic/Runtime/IdDispenser.cs index ce267800..b354c577 100644 --- a/Dynamic/Runtime/IdDispenser.cs +++ b/Dynamic/Runtime/IdDispenser.cs @@ -5,9 +5,9 @@ using System; using System.Collections.Generic; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public static class IdDispenser { // The one and only comparer instance. private static readonly IEqualityComparer _comparer = new WrapperComparer(); @@ -81,7 +81,7 @@ public static long GetId(object o) { } /// - /// Goes over the hashtable and removes empty entries + /// Goes over the hashtable and removes empty entries /// private static void Cleanup() { int liveCount = 0; @@ -132,9 +132,9 @@ public override int GetHashCode() { } /// - /// WrapperComparer treats Wrapper as transparent envelope + /// WrapperComparer treats Wrapper as transparent envelope /// - private sealed class WrapperComparer : IEqualityComparer { + private sealed class WrapperComparer : IEqualityComparer { bool IEqualityComparer.Equals(object x, object y) { if (x is Wrapper wx) x = wx.Target; diff --git a/Dynamic/Runtime/ImplicitConversionMethodAttribute.cs b/Dynamic/Runtime/ImplicitConversionMethodAttribute.cs index 307293c1..a47b8748 100644 --- a/Dynamic/Runtime/ImplicitConversionMethodAttribute.cs +++ b/Dynamic/Runtime/ImplicitConversionMethodAttribute.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { [AttributeUsage(AttributeTargets.Method, Inherited = false)] public sealed class ImplicitConversionMethodAttribute : Attribute { } diff --git a/Dynamic/Runtime/LanguageBoundTextContentProvider.cs b/Dynamic/Runtime/LanguageBoundTextContentProvider.cs index 6791c2cd..7b996a7a 100644 --- a/Dynamic/Runtime/LanguageBoundTextContentProvider.cs +++ b/Dynamic/Runtime/LanguageBoundTextContentProvider.cs @@ -4,9 +4,9 @@ using System.Text; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Internal class which binds a LanguageContext, StreamContentProvider, and Encoding together to produce /// a TextContentProvider which reads binary data with the correct language semantics. diff --git a/Dynamic/Runtime/LegacyScriptCode.cs b/Dynamic/Runtime/LegacyScriptCode.cs index 15273408..cabf90ac 100644 --- a/Dynamic/Runtime/LegacyScriptCode.cs +++ b/Dynamic/Runtime/LegacyScriptCode.cs @@ -8,13 +8,13 @@ using System; using System.Collections.Generic; using System.Text; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; using System.Threading; -using Microsoft.Scripting.Generation; +using Riverside.Scripting.Generation; using System.Reflection.Emit; using System.Reflection; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public class LegacyScriptCode : SavableScriptCode { private DlrMainCallTarget _target; private LambdaExpression _code; @@ -35,7 +35,7 @@ public override object Run() { } public override object Run(Scope scope) { - return EnsureTarget(_code)(scope, SourceUnit.LanguageContext); + return EnsureTarget(_code)(scope, SourceUnit.LanguageContext); } public void EnsureCompiled() { @@ -73,4 +73,4 @@ public static ScriptCode Load(DlrMainCallTarget method, LanguageContext language } } } -#endif \ No newline at end of file +#endif diff --git a/Dynamic/Runtime/LightExceptions.cs b/Dynamic/Runtime/LightExceptions.cs index a6653269..9cc3272a 100644 --- a/Dynamic/Runtime/LightExceptions.cs +++ b/Dynamic/Runtime/LightExceptions.cs @@ -10,27 +10,27 @@ using System.Reflection; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Actions; -using Microsoft.Scripting.Ast; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Actions; +using Riverside.Scripting.Ast; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Provides support for light exceptions. These exceptions are propagated by /// returning an instance of a private wrapper class containing the exception. Code /// which is aware of light exceptions will branch to apporiate exception handling - /// blocks when in a try and otherwise return the value up the stack. This avoids - /// using the underlying CLR exception mechanism with overhead such as creating stack + /// blocks when in a try and otherwise return the value up the stack. This avoids + /// using the underlying CLR exception mechanism with overhead such as creating stack /// traces. - /// + /// /// When a light exception reaches the boundary of code which is not light exception /// aware the caller must check to see if a light exception is being thrown and if /// so raise a .NET exception. - /// + /// /// This class provides methods for re-writing expression trees to support light exceptions, /// methods to create light throw objects, check if an object is a light /// throw object, and turn such an object back into a .NET Exception which can be thrown. - /// + /// /// Light exceptions also don't build up stack traces or interoperate with filter blocks /// via 2-pass exception handling. /// @@ -38,15 +38,15 @@ public static class LightExceptions { internal static MethodInfo _checkAndThrow = new Func(LightExceptions.CheckAndThrow).GetMethodInfo(); /// - /// Rewrites the provided expression to support light exceptions. - /// + /// Rewrites the provided expression to support light exceptions. + /// /// Calls to the returned expression, if not from other light-weight aware calls, /// need to call GetLightException on return to see if an exception was thrown /// and if so throw it. /// public static Expression Rewrite(Expression expression) { ContractUtils.RequiresNotNull(expression, nameof(expression)); - + return new LightExceptionRewriter().Rewrite(expression); } @@ -63,7 +63,7 @@ public static Expression RewriteLazy(Expression expression) { /// /// Returns a new expression which is re-written for light exceptions /// but will throw an exception if it escapes the expression. If this - /// expression is part of a larger experssion which is later re-written + /// expression is part of a larger experssion which is later re-written /// for light exceptions then it will propagate the light exception up. /// public static Expression RewriteExternal(Expression expression) { @@ -102,7 +102,7 @@ public static Expression Throw(Expression exceptionValue, Type retType) { /// /// If the binder supports light exceptions then a light exception throwing expression is returned. - /// + /// /// Otherwise a normal throwing expression is returned. /// public static Expression Throw(this DynamicMetaObjectBinder binder, Expression exceptionValue) { @@ -118,7 +118,7 @@ public static Expression Throw(this DynamicMetaObjectBinder binder, Expression e /// /// If the binder supports light exceptions then a light exception throwing expression is returned. - /// + /// /// Otherwise a normal throwing expression is returned. /// public static Expression Throw(this DynamicMetaObjectBinder binder, Expression exceptionValue, Type retType) { @@ -167,8 +167,8 @@ public static bool IsLightException(object value) { /// /// Gets the light exception from an object which may contain a light /// exception. Returns null if the object is not a light exception. - /// - /// Used for throwing the exception at non-light exception boundaries. + /// + /// Used for throwing the exception at non-light exception boundaries. /// public static Exception GetLightException(object exceptionValue) { LightException lightEx = exceptionValue as LightException; @@ -200,7 +200,7 @@ public LightException(Exception exception) { Exception = exception; } } - + private static ReadOnlyCollection ToReadOnly(Expression[] args) { return new ReadOnlyCollectionBuilder(args).ToReadOnlyCollection(); } diff --git a/Dynamic/Runtime/LightThrowingAttribute.cs b/Dynamic/Runtime/LightThrowingAttribute.cs index 5180e615..c3923889 100644 --- a/Dynamic/Runtime/LightThrowingAttribute.cs +++ b/Dynamic/Runtime/LightThrowingAttribute.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Marks a method which may return a light exception. Such /// methods need to have their return value checked and the exception diff --git a/Dynamic/Runtime/LocalsDictionary.cs b/Dynamic/Runtime/LocalsDictionary.cs index 53741434..2f213b89 100644 --- a/Dynamic/Runtime/LocalsDictionary.cs +++ b/Dynamic/Runtime/LocalsDictionary.cs @@ -5,9 +5,9 @@ using System.Collections.Generic; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Creates a dictionary of locals in this scope diff --git a/Dynamic/Runtime/MetaObjectExtensions.cs b/Dynamic/Runtime/MetaObjectExtensions.cs index 8374dc05..610566a1 100644 --- a/Dynamic/Runtime/MetaObjectExtensions.cs +++ b/Dynamic/Runtime/MetaObjectExtensions.cs @@ -7,11 +7,11 @@ using System; using System.Dynamic; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Utils; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public static class MetaObjectExtensions { public static bool NeedsDeferral(this DynamicMetaObject self) { if (self.HasValue) { @@ -77,13 +77,13 @@ public static DynamicMetaObject Clone(this DynamicMetaObject self, BindingRestri } public static DynamicMetaObject Clone(this DynamicMetaObject self, Expression newExpression, BindingRestrictions newRestrictions) { - return (self.HasValue) ? + return (self.HasValue) ? new DynamicMetaObject(newExpression, newRestrictions, self.Value) : new DynamicMetaObject(newExpression, newRestrictions); } /// - ///Returns Microsoft.Scripting.Runtime.DynamicNull if the object contains a null value, + ///Returns Riverside.Scripting.Runtime.DynamicNull if the object contains a null value, ///otherwise, returns self.LimitType /// public static Type GetLimitType(this DynamicMetaObject self) { @@ -94,7 +94,7 @@ public static Type GetLimitType(this DynamicMetaObject self) { } /// - ///Returns Microsoft.Scripting.Runtime.DynamicNull if the object contains a null value, + ///Returns Riverside.Scripting.Runtime.DynamicNull if the object contains a null value, ///otherwise, returns self.RuntimeType /// public static Type GetRuntimeType(this DynamicMetaObject self) { diff --git a/Dynamic/Runtime/ModuleChangeEventArgs.cs b/Dynamic/Runtime/ModuleChangeEventArgs.cs index f47b4e2c..d8d3973b 100644 --- a/Dynamic/Runtime/ModuleChangeEventArgs.cs +++ b/Dynamic/Runtime/ModuleChangeEventArgs.cs @@ -4,9 +4,9 @@ using System; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// - /// Event args for when a ScriptScope has had its contents changed. + /// Event args for when a ScriptScope has had its contents changed. /// public class ModuleChangeEventArgs : EventArgs { /// diff --git a/Dynamic/Runtime/ModuleChangeEventType.cs b/Dynamic/Runtime/ModuleChangeEventType.cs index 0ea2b1c8..eeaea897 100644 --- a/Dynamic/Runtime/ModuleChangeEventType.cs +++ b/Dynamic/Runtime/ModuleChangeEventType.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// The way in which a module has changed : Set or Delete /// diff --git a/Dynamic/Runtime/NullTextContentProvider.cs b/Dynamic/Runtime/NullTextContentProvider.cs index 8034249f..0edc1de0 100644 --- a/Dynamic/Runtime/NullTextContentProvider.cs +++ b/Dynamic/Runtime/NullTextContentProvider.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// A NullTextContentProvider to be provided when we have a pre-compiled ScriptCode which doesn't /// have source code associated with it. diff --git a/Dynamic/Runtime/OperationFailed.cs b/Dynamic/Runtime/OperationFailed.cs index 2170186e..08aca50d 100644 --- a/Dynamic/Runtime/OperationFailed.cs +++ b/Dynamic/Runtime/OperationFailed.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Singleton instance returned from an operator method when the operator method cannot provide a value. /// diff --git a/Dynamic/Runtime/OperatorSlotAttribute.cs b/Dynamic/Runtime/OperatorSlotAttribute.cs index d4f21779..2c2e8a5b 100644 --- a/Dynamic/Runtime/OperatorSlotAttribute.cs +++ b/Dynamic/Runtime/OperatorSlotAttribute.cs @@ -4,10 +4,10 @@ using System; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Represents an ops-extension method which is added as an operator. - /// + /// /// The name must be a well-formed name such as "Add" that matches the CLS /// naming conventions for adding overloads associated with op_* methods. /// diff --git a/Dynamic/Runtime/PositionTrackingWriter.cs b/Dynamic/Runtime/PositionTrackingWriter.cs index 3772b3df..fc57c330 100644 --- a/Dynamic/Runtime/PositionTrackingWriter.cs +++ b/Dynamic/Runtime/PositionTrackingWriter.cs @@ -9,7 +9,7 @@ using System.Collections.Generic; using System.IO; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Efficiently tracks (line,column) information as text is added, and /// collects line mappings between the original and generated source code @@ -28,7 +28,7 @@ public PositionTrackingWriter() { } /// Marks the current position of the writer as corresponding to the /// original location passed in /// - /// the line pragma corresponding to the + /// the line pragma corresponding to the /// current position in the generated code public void MapLocation(CodeLinePragma linePragma) { _lineMap.Add(new KeyValuePair(_line, linePragma.LineNumber)); diff --git a/Dynamic/Runtime/PropertyMethodAttribute.cs b/Dynamic/Runtime/PropertyMethodAttribute.cs index 190e59b8..03c43c78 100644 --- a/Dynamic/Runtime/PropertyMethodAttribute.cs +++ b/Dynamic/Runtime/PropertyMethodAttribute.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Represents an ops-extension method which is used to implement a property. /// diff --git a/Dynamic/Runtime/ReflectionCache.cs b/Dynamic/Runtime/ReflectionCache.cs index 1b715124..dd19c0ae 100644 --- a/Dynamic/Runtime/ReflectionCache.cs +++ b/Dynamic/Runtime/ReflectionCache.cs @@ -6,12 +6,12 @@ using System.Collections.Generic; using System.Reflection; -using Microsoft.Scripting.Actions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Actions; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// - /// Provides a cache of reflection members. Only one set of values is ever handed out per a + /// Provides a cache of reflection members. Only one set of values is ever handed out per a /// specific request. /// public static class ReflectionCache { @@ -95,7 +95,7 @@ private static int CompareMethods(MethodBase x, MethodBase y) { if (!PlatformAdaptationLayer.IsNativeModule && xModule == yModule) { return x.MetadataToken - y.MetadataToken; } - + return xModule.ModuleVersionId.CompareTo(yModule.ModuleVersionId); } diff --git a/Dynamic/Runtime/RestrictedMetaObject.cs b/Dynamic/Runtime/RestrictedMetaObject.cs index 0787c01a..b6d0517a 100644 --- a/Dynamic/Runtime/RestrictedMetaObject.cs +++ b/Dynamic/Runtime/RestrictedMetaObject.cs @@ -7,9 +7,9 @@ using System; using System.Dynamic; -using AstUtils = Microsoft.Scripting.Ast.Utils; +using AstUtils = Riverside.Scripting.Ast.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public class RestrictedMetaObject : DynamicMetaObject, IRestrictedMetaObject { public RestrictedMetaObject(Expression expression, BindingRestrictions restriction, object value) : base(expression, restriction, value) { } diff --git a/Dynamic/Runtime/ReturnFixer.cs b/Dynamic/Runtime/ReturnFixer.cs index a96d91d1..e65e5d66 100644 --- a/Dynamic/Runtime/ReturnFixer.cs +++ b/Dynamic/Runtime/ReturnFixer.cs @@ -9,9 +9,9 @@ using System.Reflection.Emit; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Generation { +namespace Riverside.Scripting.Generation { internal sealed class ReturnFixer { private readonly LocalBuilder _refSlot; private readonly int _argIndex; diff --git a/Dynamic/Runtime/SavableScriptCode.cs b/Dynamic/Runtime/SavableScriptCode.cs index 3f83745c..5ec381de 100644 --- a/Dynamic/Runtime/SavableScriptCode.cs +++ b/Dynamic/Runtime/SavableScriptCode.cs @@ -13,11 +13,11 @@ using System.Reflection; using System.Reflection.Emit; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// ScriptCode is an instance of compiled code that is bound to a specific LanguageContext /// but not a specific ScriptScope. The code can be re-executed multiple times in different @@ -28,7 +28,7 @@ public abstract class SavableScriptCode : ScriptCode { protected SavableScriptCode(SourceUnit sourceUnit) : base(sourceUnit) { } - + class CodeInfo { public readonly MethodBuilder Builder; public readonly ScriptCode Code; @@ -144,26 +144,26 @@ public static void SaveToAssembly(string assemblyName, IDictionary - /// This takes an assembly name including extension and saves the provided ScriptCode objects into the assembly. - /// - /// The provided script codes can constitute code from multiple languages. The assemblyName can be either a fully qualified - /// or a relative path. The DLR will simply save the assembly to the desired location. The assembly is created by the DLR and - /// if a file already exists than an exception is raised. - /// - /// The DLR determines the internal format of the ScriptCode and the DLR can feel free to rev this as appropriate. + /// This takes an assembly name including extension and saves the provided ScriptCode objects into the assembly. + /// + /// The provided script codes can constitute code from multiple languages. The assemblyName can be either a fully qualified + /// or a relative path. The DLR will simply save the assembly to the desired location. The assembly is created by the DLR and + /// if a file already exists than an exception is raised. + /// + /// The DLR determines the internal format of the ScriptCode and the DLR can feel free to rev this as appropriate. /// public static void SaveToAssembly(string assemblyName, params SavableScriptCode[] codes) { SaveToAssembly(assemblyName, null, codes); } /// - /// This will take an assembly object which the user has loaded and return a new set of ScriptCode’s which have - /// been loaded into the provided ScriptDomainManager. - /// - /// If the language associated with the ScriptCode’s has not already been loaded the DLR will load the - /// LanguageContext into the ScriptDomainManager based upon the saved LanguageContext type. - /// - /// If the LanguageContext or the version of the DLR the language was compiled against is unavailable a + /// This will take an assembly object which the user has loaded and return a new set of ScriptCode�s which have + /// been loaded into the provided ScriptDomainManager. + /// + /// If the language associated with the ScriptCode�s has not already been loaded the DLR will load the + /// LanguageContext into the ScriptDomainManager based upon the saved LanguageContext type. + /// + /// If the LanguageContext or the version of the DLR the language was compiled against is unavailable a /// TypeLoadException will be raised unless policy has been applied by the administrator to redirect bindings. /// public static ScriptCode[] LoadFromAssembly(ScriptDomainManager runtime, Assembly assembly) { diff --git a/Dynamic/Runtime/ScriptingRuntimeHelpers.cs b/Dynamic/Runtime/ScriptingRuntimeHelpers.cs index a71d91e6..743cd85f 100644 --- a/Dynamic/Runtime/ScriptingRuntimeHelpers.cs +++ b/Dynamic/Runtime/ScriptingRuntimeHelpers.cs @@ -7,11 +7,11 @@ using System.Collections.Generic; using System.Reflection; -using Microsoft.Scripting.Actions; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Actions; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// These are some generally useful helper methods. Currently the only methods are those to /// cached boxed representations of commonly used primitive types so that they can be shared. diff --git a/Dynamic/Runtime/SourceStringContentProvider.cs b/Dynamic/Runtime/SourceStringContentProvider.cs index e37cb7e1..534afbd3 100644 --- a/Dynamic/Runtime/SourceStringContentProvider.cs +++ b/Dynamic/Runtime/SourceStringContentProvider.cs @@ -5,9 +5,9 @@ using System; using System.IO; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { [Serializable] internal sealed class SourceStringContentProvider : TextContentProvider { diff --git a/Dynamic/Runtime/StaticExtensionMethodAttribute.cs b/Dynamic/Runtime/StaticExtensionMethodAttribute.cs index 35b1f14e..cb423543 100644 --- a/Dynamic/Runtime/StaticExtensionMethodAttribute.cs +++ b/Dynamic/Runtime/StaticExtensionMethodAttribute.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Indicates an extension method should be added as a static method, not a instance method. /// diff --git a/Dynamic/Runtime/TokenizerBuffer.cs b/Dynamic/Runtime/TokenizerBuffer.cs index 4a06e5f7..0fad3ac1 100644 --- a/Dynamic/Runtime/TokenizerBuffer.cs +++ b/Dynamic/Runtime/TokenizerBuffer.cs @@ -8,9 +8,9 @@ using System.Diagnostics; using System.IO; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public sealed class TokenizerBuffer { //private const char EndOfData = '\uFFFF'; @@ -18,7 +18,7 @@ public sealed class TokenizerBuffer { public const int EndOfFile = -1; public const int InvalidCharacter = -2; - // Whether to allow multiple forms of EOLN. + // Whether to allow multiple forms of EOLN. // If false only '\n' is treated as a line separator otherwise '\n', '\r\n' and '\r' are treated as separators. private bool _multiEolns; private char[] _buffer; @@ -99,7 +99,7 @@ public void Initialize(TextReader reader, SourceLocation initialLocation, int in _tokenEndLocation = SourceLocation.Invalid; _tokenStartLocation = initialLocation; - + _start = _end = 0; _position = 0; @@ -128,7 +128,7 @@ public bool Read(string str) { CheckInvariants(); int old_pos = _position; - + // ensure sufficient data loaded: SeekRelative(str.Length - 1); if (Read() == EndOfFile) { @@ -136,7 +136,7 @@ public bool Read(string str) { CheckInvariants(); return false; } - + Debug.Assert(_position + str.Length <= _buffer.Length); int i = 0; @@ -157,7 +157,7 @@ public int Peek() { if (_position >= _end) { RefillBuffer(); - + // eof: if (_position >= _end) { CheckInvariants(); @@ -166,7 +166,7 @@ public int Peek() { } Debug.Assert(_position < _end); - + int result = _buffer[_position]; CheckInvariants(); return result; @@ -198,7 +198,7 @@ public void Back() { /// public void Seek(int offset) { CheckInvariants(); - Debug.Assert(offset >= 0); + Debug.Assert(offset >= 0); // no upper limit, we can seek beyond end in which case we are reading EOFs _position = _start + offset; @@ -239,7 +239,7 @@ public void MarkSingleLineTokenEnd() { _tokenEnd = System.Math.Min(_position, _end); int token_length = _tokenEnd - _start; - + _tokenEndLocation = new SourceLocation( _tokenStartLocation.Index + token_length, _tokenStartLocation.Line, @@ -267,7 +267,7 @@ public void MarkTokenEnd(bool isMultiLine) { else MarkSingleLineTokenEnd(); } - + /// /// Marks token start. It means the buffer can drop the current token. /// Can be called even if no token has been read yet. @@ -296,7 +296,7 @@ public char GetChar(int offset) { public char GetCharRelative(int disp) { CheckInvariants(); Debug.Assert(disp >= _start - _position); - + return _buffer[_position + disp]; } @@ -311,7 +311,7 @@ public string GetTokenString() { public string GetTokenSubstring(int offset) { return GetTokenSubstring(offset, _tokenEnd - _start - offset); } - + public string GetTokenSubstring(int offset, int length) { CheckInvariants(); Debug.Assert(_tokenEnd != -1, "Token end not marked"); @@ -338,7 +338,7 @@ private SourceLocation GetTokenEndSingleEoln() { private SourceLocation GetTokenEndMultiEolns() { int end_line = _tokenStartLocation.Line; int end_column = _tokenStartLocation.Column; - + int i = _start; while (i < _tokenEnd - 1) { if (_buffer[i] == '\n') { @@ -438,10 +438,10 @@ private void CheckInvariants() { Debug.Assert(_buffer.Length >= 1); // _start == _end when discarding token and at beginning, when == 0 - Debug.Assert(_start >= 0 && _start <= _end); + Debug.Assert(_start >= 0 && _start <= _end); Debug.Assert(_end >= 0 && _end <= _buffer.Length); - + // position beyond _end means we are reading EOFs: Debug.Assert(_position >= _start); Debug.Assert(_tokenEnd >= -1 && _tokenEnd <= _end); diff --git a/Dynamic/Runtime/Uninitialized.cs b/Dynamic/Runtime/Uninitialized.cs index 0f9033f9..0da65c4c 100644 --- a/Dynamic/Runtime/Uninitialized.cs +++ b/Dynamic/Runtime/Uninitialized.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public sealed class Uninitialized { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public static readonly Uninitialized Instance = new Uninitialized(); diff --git a/Dynamic/SerializationStubs.cs b/Dynamic/SerializationStubs.cs index b460fbfb..c6b2dbdb 100644 --- a/Dynamic/SerializationStubs.cs +++ b/Dynamic/SerializationStubs.cs @@ -7,7 +7,7 @@ using System; using System.Diagnostics; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { [Conditional("STUB")] internal class SerializableAttribute : Attribute { } diff --git a/Dynamic/SourceFileContentProvider.cs b/Dynamic/SourceFileContentProvider.cs index 5e453cdb..7411d2d7 100644 --- a/Dynamic/SourceFileContentProvider.cs +++ b/Dynamic/SourceFileContentProvider.cs @@ -10,9 +10,9 @@ using System; using System.IO; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// Provides a StreamContentProvider for a stream of content backed by a file on disk. diff --git a/Dynamic/StringExtensions.cs b/Dynamic/StringExtensions.cs index a1963924..9c566201 100644 --- a/Dynamic/StringExtensions.cs +++ b/Dynamic/StringExtensions.cs @@ -1,6 +1,6 @@ using System; -namespace Microsoft.Scripting +namespace Riverside.Scripting { internal static class StringExtensions { diff --git a/Dynamic/Utils/ArrayUtils.cs b/Dynamic/Utils/ArrayUtils.cs index 71bb026f..ea34b21e 100644 --- a/Dynamic/Utils/ArrayUtils.cs +++ b/Dynamic/Utils/ArrayUtils.cs @@ -7,7 +7,7 @@ using System.Diagnostics; using System.Text; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { public static class ArrayUtils { internal sealed class FunctorComparer : IComparer { private readonly Comparison _comparison; @@ -74,8 +74,8 @@ public static T[] Copy(T[] array) { } /// - /// Converts a generic ICollection of T into an array of T. - /// + /// Converts a generic ICollection of T into an array of T. + /// /// If the collection is already an array of T the original collection is returned. /// public static T[] ToArray(ICollection list) { @@ -83,8 +83,8 @@ public static T[] ToArray(ICollection list) { } /// - /// Converts a generic ICollection of T into an array of R using a given conversion. - /// + /// Converts a generic ICollection of T into an array of R using a given conversion. + /// /// If the collection is already an array of R the original collection is returned. /// public static TResult[] ToArray(ICollection list, Func convertor) { @@ -319,7 +319,7 @@ public static int GetValueHashCode(this T[] array) { public static int GetValueHashCode(this T[] array, int start, int count) { ContractUtils.RequiresNotNull(array, nameof(array)); ContractUtils.RequiresArrayRange(array.Length, start, count, nameof(start), nameof(count)); - + if (count == 0) { return 0; } diff --git a/Dynamic/Utils/Assert.cs b/Dynamic/Utils/Assert.cs index acb5744e..73f5c31e 100644 --- a/Dynamic/Utils/Assert.cs +++ b/Dynamic/Utils/Assert.cs @@ -8,7 +8,7 @@ using System.Collections.Generic; using System.Diagnostics; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { public static class Assert { diff --git a/Dynamic/Utils/CacheDict.cs b/Dynamic/Utils/CacheDict.cs index c5993989..0a8043ed 100644 --- a/Dynamic/Utils/CacheDict.cs +++ b/Dynamic/Utils/CacheDict.cs @@ -7,11 +7,11 @@ using System.Text; using System.Diagnostics; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { /// /// Provides a dictionary-like object used for caches which holds onto a maximum /// number of elements specified at construction time. - /// + /// /// This class is not thread safe. /// public class CacheDict { @@ -63,7 +63,7 @@ public void Add(TKey key, TValue value) { bool res = _dict.Remove(node.Value); Debug.Assert(res); } - + // add the new entry to the head of the list and into the dictionary LinkedListNode listNode = new LinkedListNode(key); _list.AddFirst(listNode); diff --git a/Dynamic/Utils/CheckedDictionaryEnumerator.cs b/Dynamic/Utils/CheckedDictionaryEnumerator.cs index 73f6c599..60d08eb7 100644 --- a/Dynamic/Utils/CheckedDictionaryEnumerator.cs +++ b/Dynamic/Utils/CheckedDictionaryEnumerator.cs @@ -8,7 +8,7 @@ using System.Collections; using System.Collections.Generic; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { /// /// Not all .NET enumerators throw exceptions if accessed in an invalid state. This type /// can be used to throw exceptions from enumerators implemented in IronPython. @@ -88,7 +88,7 @@ public void Dispose() { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] // TODO: fix protected abstract object GetKey(); - + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] // TODO: fix protected abstract object GetValue(); diff --git a/Dynamic/Utils/CollectionExtensions.cs b/Dynamic/Utils/CollectionExtensions.cs index 25b6c52a..5d95ff20 100644 --- a/Dynamic/Utils/CollectionExtensions.cs +++ b/Dynamic/Utils/CollectionExtensions.cs @@ -7,11 +7,11 @@ using System.Collections.ObjectModel; using System.Diagnostics; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { internal static class CollectionExtensions { /// /// Wraps the provided enumerable into a ReadOnlyCollection{T} - /// + /// /// Copies all of the data into a new array, so the data can't be /// changed after creation. The exception is if the enumerable is /// already a ReadOnlyCollection{T}, in which case we just return it. diff --git a/Dynamic/Utils/CollectionUtils.cs b/Dynamic/Utils/CollectionUtils.cs index ec862b64..ad8db416 100644 --- a/Dynamic/Utils/CollectionUtils.cs +++ b/Dynamic/Utils/CollectionUtils.cs @@ -6,10 +6,10 @@ using System.Collections; using System.Collections.Generic; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { /// /// Allows wrapping of proxy types (like COM RCWs) to expose their IEnumerable functionality - /// which is supported after casting to IEnumerable, even though Reflection will not indicate + /// which is supported after casting to IEnumerable, even though Reflection will not indicate /// IEnumerable as a supported interface /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface")] // TODO diff --git a/Dynamic/Utils/ContractUtils.cs b/Dynamic/Utils/ContractUtils.cs index 6929938f..d7aaf8ec 100644 --- a/Dynamic/Utils/ContractUtils.cs +++ b/Dynamic/Utils/ContractUtils.cs @@ -9,7 +9,7 @@ using System.Collections.Generic; using System.Diagnostics; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { public static class ContractUtils { [Conditional("DEBUG")] public static void Assert(bool precondition) { @@ -165,7 +165,7 @@ public static void RequiresNotNullItems(IList array, string arrayName) { } } } - + /// /// Requires the enumerable collection and all its items to be non-null. /// @@ -202,17 +202,17 @@ public static void Ensures(bool condition, string message) { // nop } - public static T Result() { - return default(T); + public static T Result() { + return default(T); } - public static T Parameter(out T value) { - value = default(T); - return value; + public static T Parameter(out T value) { + value = default(T); + return value; } - public static T Old(T value) { - return value; + public static T Old(T value) { + return value; } } } diff --git a/Dynamic/Utils/CopyOnWriteList.cs b/Dynamic/Utils/CopyOnWriteList.cs index cd0c2921..eb736e9b 100644 --- a/Dynamic/Utils/CopyOnWriteList.cs +++ b/Dynamic/Utils/CopyOnWriteList.cs @@ -5,10 +5,10 @@ using System.Collections.Generic; using System.Threading; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { /// - /// List optimized for few writes and multiple reads. It provides thread-safe read and write access. - /// Iteration is not thread-safe by default, but GetCopyForRead allows for iteration + /// List optimized for few writes and multiple reads. It provides thread-safe read and write access. + /// Iteration is not thread-safe by default, but GetCopyForRead allows for iteration /// without taking a lock. /// public class CopyOnWriteList : IList { @@ -24,7 +24,7 @@ List GetNewListForWrite() { /// /// Gets a copy of the contents of the list. The copy will not change even if the original /// CopyOnWriteList object is modified. This method should be used to iterate the list in - /// a thread-safe way if no lock is taken. Iterating on the original list is not guaranteed + /// a thread-safe way if no lock is taken. Iterating on the original list is not guaranteed /// to be thread-safe. /// /// The returned copy should not be modified by the caller. diff --git a/Dynamic/Utils/DictionaryUnionEnumerator.cs b/Dynamic/Utils/DictionaryUnionEnumerator.cs index ecd9c914..57d9f599 100644 --- a/Dynamic/Utils/DictionaryUnionEnumerator.cs +++ b/Dynamic/Utils/DictionaryUnionEnumerator.cs @@ -5,7 +5,7 @@ using System.Collections; using System.Collections.Generic; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { /// /// Presents a flat enumerable view of multiple dictionaries /// diff --git a/Dynamic/Utils/DynamicUtils.cs b/Dynamic/Utils/DynamicUtils.cs index e641d534..7e915ba0 100644 --- a/Dynamic/Utils/DynamicUtils.cs +++ b/Dynamic/Utils/DynamicUtils.cs @@ -13,12 +13,12 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Threading; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Interpreter; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Interpreter; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Utils { - using AstUtils = Microsoft.Scripting.Ast.Utils; +namespace Riverside.Scripting.Utils { + using AstUtils = Riverside.Scripting.Ast.Utils; public static class DynamicUtils { /// diff --git a/Dynamic/Utils/EnumUtils.cs b/Dynamic/Utils/EnumUtils.cs index 04eb0c0e..024a7073 100644 --- a/Dynamic/Utils/EnumUtils.cs +++ b/Dynamic/Utils/EnumUtils.cs @@ -5,8 +5,8 @@ using System; using System.Runtime.CompilerServices; -namespace Microsoft.Scripting.Utils { - public static class EnumUtils { +namespace Riverside.Scripting.Utils { + public static class EnumUtils { public static object BitwiseOr(object self, object other) { if (self is Enum && other is Enum) { Type selfType = self.GetType(); diff --git a/Dynamic/Utils/ExceptionFactory.Generated.cs b/Dynamic/Utils/ExceptionFactory.Generated.cs index 541c563a..00d3f7b7 100644 --- a/Dynamic/Utils/ExceptionFactory.Generated.cs +++ b/Dynamic/Utils/ExceptionFactory.Generated.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { internal static partial class Strings { private static string FormatString(string format, params object[] args) { @@ -12,7 +12,7 @@ private static string FormatString(string format, params object[] args) { } } - #region Generated Microsoft.Scripting Exception Factory + #region Generated Riverside.Scripting Exception Factory // *** BEGIN GENERATED CODE *** // generated by function: gen_expr_factory_scripting from: generate_exception_factory.py diff --git a/Dynamic/Utils/ExceptionUtils.cs b/Dynamic/Utils/ExceptionUtils.cs index 9a4b555e..6f7eef61 100644 --- a/Dynamic/Utils/ExceptionUtils.cs +++ b/Dynamic/Utils/ExceptionUtils.cs @@ -8,7 +8,7 @@ using System.Collections.Generic; using System.Threading; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { public static class ExceptionUtils { public static ArgumentOutOfRangeException MakeArgumentOutOfRangeException(string paramName, object actualValue, string message) { return new ArgumentOutOfRangeException(paramName, actualValue, message); @@ -40,7 +40,7 @@ public static void SetData(this Exception e, object key, object value) { lock (_exceptionData) { var data = _exceptionData.GetOrCreateValue(e); - + int index = data.FindIndex(entry => entry.Key == key); if (index >= 0) { data[index] = new KeyValuePair(key, value); diff --git a/Dynamic/Utils/HybridReferenceDictionary.cs b/Dynamic/Utils/HybridReferenceDictionary.cs index e4a5f5b1..29ee8f90 100644 --- a/Dynamic/Utils/HybridReferenceDictionary.cs +++ b/Dynamic/Utils/HybridReferenceDictionary.cs @@ -7,7 +7,7 @@ using System.Text; using System.Diagnostics; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { /// /// A hybrid dictionary which compares based upon object identity. /// diff --git a/Dynamic/Utils/IOUtils.cs b/Dynamic/Utils/IOUtils.cs index 8ee2bd87..2f77e137 100644 --- a/Dynamic/Utils/IOUtils.cs +++ b/Dynamic/Utils/IOUtils.cs @@ -7,7 +7,7 @@ using System.IO; using System.Text; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { public static class IOUtils { /// /// Seeks the first character of a specified line in the text stream. @@ -45,7 +45,7 @@ public static bool SeekLine(TextReader reader, int line) { } /// - /// Reads characters to a string until end position or a terminator is reached. + /// Reads characters to a string until end position or a terminator is reached. /// Doesn't include the terminator into the resulting string. /// Returns null, if the reader is at the end position. /// @@ -67,7 +67,7 @@ public static string ReadTo(TextReader reader, char terminator) { /// /// Reads characters until end position or a terminator is reached. - /// Returns true if the character has been found (the reader is positioned right behind the character), + /// Returns true if the character has been found (the reader is positioned right behind the character), /// false otherwise. /// public static bool SeekTo(TextReader reader, char c) { diff --git a/Dynamic/Utils/ListEqualityComparer.cs b/Dynamic/Utils/ListEqualityComparer.cs index aa30a59d..7560b177 100644 --- a/Dynamic/Utils/ListEqualityComparer.cs +++ b/Dynamic/Utils/ListEqualityComparer.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { // Compares two ICollection's using element equality internal sealed class ListEqualityComparer : EqualityComparer> { internal static readonly ListEqualityComparer Instance = new ListEqualityComparer(); diff --git a/Dynamic/Utils/MathUtils.cs b/Dynamic/Utils/MathUtils.cs index 18036db8..926b3088 100644 --- a/Dynamic/Utils/MathUtils.cs +++ b/Dynamic/Utils/MathUtils.cs @@ -9,7 +9,7 @@ using System.Collections.Generic; using System.Numerics; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { using Math = System.Math; public static class MathUtils { @@ -42,7 +42,7 @@ public static int FloorDivideUnchecked(int x, int y) { } return q - 1; - } + } return q; } @@ -65,7 +65,7 @@ public static long FloorDivideUnchecked(long x, long y) { if (x % y == 0) { return q; - } + } return q - 1; } @@ -164,7 +164,7 @@ private static double GetPowerOf10(int precision) { /// Behaves like Math.Round(value, precision, MidpointRounding.AwayFromZero) /// However, it works correctly on negative precisions and cases where precision is /// outside of the [-15, 15] range. - /// + /// /// (This function is also needed because CoreCLR lacks this overload.) /// [Obsolete("The method has been deprecated. Call MathUtils.Round(value, precision, MidpointRounding.AwayFromZero) instead.")] @@ -211,7 +211,7 @@ public static double Erf(double v0) { if (v0 >= 10.0) { return 1.0; } - + if (v0 <= -10.0) { return -1.0; } @@ -692,7 +692,7 @@ public static BigInteger GetRandBits(Action NextBytes, int bits) { ulong b = GetWord(bytes, 32, bits); return (a | (b << 32)); } - + return new BigInteger(bytes); } @@ -760,7 +760,7 @@ public static double ToFloat64(this BigInteger self) { } throw new OverflowException("Value was either too large or too small for a Double."); } - + public static int BitLength(BigInteger x) { if (x.IsZero) { return 0; @@ -957,7 +957,7 @@ public static BigInteger Power(this BigInteger self, long exp) { if (self == BigInteger.MinusOne) { if (exp % 2 == 0) { return BigInteger.One; - } + } return BigInteger.MinusOne; } diff --git a/Dynamic/Utils/MonitorUtils.cs b/Dynamic/Utils/MonitorUtils.cs index 854230f4..87fc3db0 100644 --- a/Dynamic/Utils/MonitorUtils.cs +++ b/Dynamic/Utils/MonitorUtils.cs @@ -7,7 +7,7 @@ using System.Threading; using System.Diagnostics; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { public static class MonitorUtils { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")] public static void Enter(object obj, ref bool lockTaken) { diff --git a/Dynamic/Utils/Publisher.cs b/Dynamic/Utils/Publisher.cs index 8d509223..6a8f8ce1 100644 --- a/Dynamic/Utils/Publisher.cs +++ b/Dynamic/Utils/Publisher.cs @@ -8,13 +8,13 @@ using System.Dynamic; using System.Threading; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { /// /// Thread safe dictionary that allows lazy-creation where readers will block for /// the creation of the lazily created value. Call GetOrCreateValue w/ a key /// and a callback function. If the value exists it is returned, if not the create /// callback is called (w/o any locks held). The create call back will only be called - /// once for each key. + /// once for each key. /// public class Publisher { private readonly Dictionary> data = new Dictionary>(); diff --git a/Dynamic/Utils/ReferenceEqualityComparer.cs b/Dynamic/Utils/ReferenceEqualityComparer.cs index 67bf5356..10dba29f 100644 --- a/Dynamic/Utils/ReferenceEqualityComparer.cs +++ b/Dynamic/Utils/ReferenceEqualityComparer.cs @@ -7,7 +7,7 @@ using System.Linq.Expressions; using System.Dynamic; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { public sealed class ReferenceEqualityComparer : IEqualityComparer where T : class { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public static readonly ReferenceEqualityComparer Instance = new ReferenceEqualityComparer(); diff --git a/Dynamic/Utils/ReflectionUtils.cs b/Dynamic/Utils/ReflectionUtils.cs index 393aa6fa..32dc04e4 100644 --- a/Dynamic/Utils/ReflectionUtils.cs +++ b/Dynamic/Utils/ReflectionUtils.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. #if FEATURE_METADATA_READER -using Microsoft.Scripting.Metadata; +using Riverside.Scripting.Metadata; #endif using TypeInfo = System.Type; @@ -19,10 +19,10 @@ using System.Security; using System.Text; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { public static class ReflectionUtils { #region Accessibility @@ -242,19 +242,19 @@ public static IEnumerable WithSignature(this IEnumerable GetInheritedProperties(this Type type, s // CLI spec 22.34 Properties // ------------------------- - // [Note: The CLS (see Partition I) refers to instance, virtual, and static properties. - // The signature of a property (from the Type column) can be used to distinguish a static property, + // [Note: The CLS (see Partition I) refers to instance, virtual, and static properties. + // The signature of a property (from the Type column) can be used to distinguish a static property, // since instance and virtual properties will have the "HASTHIS" bit set in the signature (§23.2.1) - // while a static property will not. The distinction between an instance and a virtual property - // depends on the signature of the getter and setter methods, which the CLS requires to be either + // while a static property will not. The distinction between an instance and a virtual property + // depends on the signature of the getter and setter methods, which the CLS requires to be either // both virtual or both instance. end note] private static bool IncludeProperty(PropertyInfo member, Type reflectedType, HashSet baseDefinitions, bool flattenHierarchy) { var getter = member.GetGetMethod(nonPublic: true); @@ -684,8 +684,8 @@ public static ModuleBuilder DefineDynamicModule(this AssemblyBuilder assembly, s #region Signature and Type Formatting - // Generic type names have the arity (number of generic type paramters) appended at the end. - // For eg. the mangled name of System.List is "List`1". This mangling is done to enable multiple + // Generic type names have the arity (number of generic type paramters) appended at the end. + // For eg. the mangled name of System.List is "List`1". This mangling is done to enable multiple // generic types to exist as long as they have different arities. public const char GenericArityDelimiter = '`'; @@ -1496,7 +1496,7 @@ public override int GetHashCode() { } /// - /// Determines if a given type matches the type that the method extends. + /// Determines if a given type matches the type that the method extends. /// The match might be non-trivial if the extended type is an open generic type with constraints. /// public bool IsExtensionOf(Type/*!*/ type) { @@ -1517,10 +1517,10 @@ public bool IsExtensionOf(Type/*!*/ type) { // // Ignores constraints that can't be instantiated given the information we have (type of the first parameter). // - // For example, + // For example, // void Foo(this S x, T y) where S : T; // - // We make such methods available on all types. + // We make such methods available on all types. // If they are not called with arguments that satisfy the constraint the overload resolver might fail. // return ReflectionUtils.BindGenericParameters(_extendedType, type, true) != null; diff --git a/Dynamic/Utils/StringUtils.cs b/Dynamic/Utils/StringUtils.cs index acf14c86..f6a49e76 100644 --- a/Dynamic/Utils/StringUtils.cs +++ b/Dynamic/Utils/StringUtils.cs @@ -7,7 +7,7 @@ using System.Globalization; using System.Text; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { public static class StringUtils { [Obsolete("Use Encoding.Default")] diff --git a/Dynamic/Utils/SynchronizedDictionary.cs b/Dynamic/Utils/SynchronizedDictionary.cs index 76efae23..6cbe1dd0 100644 --- a/Dynamic/Utils/SynchronizedDictionary.cs +++ b/Dynamic/Utils/SynchronizedDictionary.cs @@ -5,7 +5,7 @@ using System.Collections; using System.Collections.Generic; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { /// /// Dictionary[TKey, TValue] is not thread-safe in the face of concurrent reads and writes. SynchronizedDictionary @@ -28,7 +28,7 @@ public Dictionary UnderlyingDictionary { get { return _dictionary; } } - public SynchronizedDictionary() + public SynchronizedDictionary() : this(new Dictionary()) { } diff --git a/Dynamic/Utils/ThreadLocal.cs b/Dynamic/Utils/ThreadLocal.cs index ba7b55a7..d9d3f76b 100644 --- a/Dynamic/Utils/ThreadLocal.cs +++ b/Dynamic/Utils/ThreadLocal.cs @@ -6,7 +6,7 @@ using System.Threading; using System.Diagnostics; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { /// /// Provides fast strongly typed thread local storage. This is significantly faster than /// Thread.GetData/SetData. @@ -22,7 +22,7 @@ public ThreadLocal() { /// /// True if the caller will guarantee that all cleanup happens as the thread /// unwinds. - /// + /// /// This is typically used in a case where the thread local is surrounded by /// a try/finally block. The try block pushes some state, the finally block /// restores the previous state. Therefore when the thread exits the thread @@ -115,8 +115,8 @@ private StorageInfo GetStorageInfo(StorageInfo[] curStorage) { } /// - /// Called when the fast path storage lookup fails. if we encountered the Empty storage - /// during the initial fast check then spin until we hit non-empty storage and try the fast + /// Called when the fast path storage lookup fails. if we encountered the Empty storage + /// during the initial fast check then spin until we hit non-empty storage and try the fast /// path again. /// private StorageInfo RetryOrCreateStorageInfo(StorageInfo[] curStorage) { @@ -146,7 +146,7 @@ private StorageInfo CreateStorageInfo() { StorageInfo newInfo = new StorageInfo(Thread.CurrentThread); // set to updating while potentially resizing/mutating, then we'll - // set back to the current value. + // set back to the current value. while ((curStorage = Interlocked.Exchange(ref _stores, Updating)) == Updating) { // another thread is already updating... Thread.Sleep(0); diff --git a/Dynamic/Utils/ThreadingUtils.cs b/Dynamic/Utils/ThreadingUtils.cs index 1622ad44..64253ebc 100644 --- a/Dynamic/Utils/ThreadingUtils.cs +++ b/Dynamic/Utils/ThreadingUtils.cs @@ -4,11 +4,11 @@ using System.Threading; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { public static class ThreadingUtils { private static int id; private static System.Threading.ThreadLocal threadIds = new System.Threading.ThreadLocal(() => Interlocked.Increment(ref id)); - + public static int GetCurrentThreadId() { return threadIds.Value; } diff --git a/Dynamic/Utils/TypeMemberCache.cs b/Dynamic/Utils/TypeMemberCache.cs index 170b43e6..5b1417b0 100644 --- a/Dynamic/Utils/TypeMemberCache.cs +++ b/Dynamic/Utils/TypeMemberCache.cs @@ -9,7 +9,7 @@ using System.Runtime.CompilerServices; using System.Collections.ObjectModel; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { /// /// Caches type member lookup. /// @@ -25,7 +25,7 @@ public sealed class TypeMemberCache // TODO: some memory can be saved here // { queried-type -> immutable { member-name, members } } - private readonly ConditionalWeakTable>> _typeMembersByName = + private readonly ConditionalWeakTable>> _typeMembersByName = new ConditionalWeakTable>>(); private Dictionary> GetMembers(Type type) { @@ -63,7 +63,7 @@ public IEnumerable GetMembers(Type type, string name = null, bool inherited = private Dictionary> ReflectMembers(Type type) { var result = new Dictionary>(); - + foreach (T member in _reflector(type)) { if (!result.TryGetValue(member.Name, out List overloads)) { result.Add(member.Name, overloads = new List()); diff --git a/Dynamic/Utils/TypeUtils.cs b/Dynamic/Utils/TypeUtils.cs index 90cd8067..8c7cb156 100644 --- a/Dynamic/Utils/TypeUtils.cs +++ b/Dynamic/Utils/TypeUtils.cs @@ -8,10 +8,10 @@ using System.Reflection; using System.Runtime.InteropServices; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { public static class TypeUtils { public static bool IsNested(this Type t) { return t.DeclaringType != null; @@ -115,9 +115,9 @@ internal static bool IsIntegerOrBool(this Type type) { internal static bool CanAssign(Type to, Expression from) { if (CanAssign(to, from.Type)) return true; - if (to.IsValueType && - to.IsGenericType && - to.GetGenericTypeDefinition() == typeof(Nullable<>) && + if (to.IsValueType && + to.IsGenericType && + to.GetGenericTypeDefinition() == typeof(Nullable<>) && ConstantCheck.Check(from, null)) { return true; } @@ -140,7 +140,7 @@ internal static bool CanAssign(Type to, Type from) { CanAssign(to.GetElementType(), from.GetElementType())) { return true; } - } + } return false; } @@ -165,8 +165,8 @@ internal static bool GetNumericConversionOrder(TypeCode code, out int x, out int // | | | // v v v // 1: I1 -> I2 -> I4 -> I8 - // | | - // v v + // | | + // v v // 2: R4 -> R8 switch (code) { diff --git a/Dynamic/Utils/ValueArray.cs b/Dynamic/Utils/ValueArray.cs index 0a5ed9a3..92a0b8f9 100644 --- a/Dynamic/Utils/ValueArray.cs +++ b/Dynamic/Utils/ValueArray.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { /// /// Represents an array that has value equality. diff --git a/Dynamic/Utils/WeakCollection.cs b/Dynamic/Utils/WeakCollection.cs index bbe8e3ad..0c7b0d28 100644 --- a/Dynamic/Utils/WeakCollection.cs +++ b/Dynamic/Utils/WeakCollection.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { /// /// Simple class for tracking a list of items and enumerating over them. /// The items are stored in weak references; if the objects are collected, diff --git a/Dynamic/Utils/WeakDictionary.cs b/Dynamic/Utils/WeakDictionary.cs index 3f477dff..b58296f6 100644 --- a/Dynamic/Utils/WeakDictionary.cs +++ b/Dynamic/Utils/WeakDictionary.cs @@ -8,17 +8,17 @@ using System.Reflection; using System.Runtime.CompilerServices; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { /// /// Similar to Dictionary[TKey,TValue], but it also ensures that the keys will not be kept alive /// if the only reference is from this collection. The value will be kept alive as long as the key /// is alive. - /// - /// This currently has a limitation that the caller is responsible for ensuring that an object used as + /// + /// This currently has a limitation that the caller is responsible for ensuring that an object used as /// a key is not also used as a value in *any* instance of a WeakHash. Otherwise, it will result in the /// object being kept alive forever. This effectively means that the owner of the WeakHash should be the /// only one who has access to the object used as a value. - /// + /// /// Currently, there is also no guarantee of how long the values will be kept alive even after the keys /// get collected. This could be fixed by triggerring CheckCleanup() to be called on every garbage-collection /// by having a dummy watch-dog object with a finalizer which calls CheckCleanup(). @@ -77,7 +77,7 @@ public TValue GetOrCreateValue(TKey key) { if (valueConstructor == null) { throw new InvalidOperationException($"{typeof(TValue).Name} does not have a default constructor."); } - + value = (TValue)valueConstructor.Invoke(Array.Empty()); Add(key, value); } @@ -110,7 +110,7 @@ public TValue this[TKey key] { /// /// Check if any of the keys have gotten collected - /// + /// /// Currently, there is also no guarantee of how long the values will be kept alive even after the keys /// get collected. This could be fixed by triggerring CheckCleanup() to be called on every garbage-collection /// by having a dummy watch-dog object with a finalizer which calls CheckCleanup(). diff --git a/Dynamic/Utils/WeakHandle.cs b/Dynamic/Utils/WeakHandle.cs index 8156219b..ea80b7c5 100644 --- a/Dynamic/Utils/WeakHandle.cs +++ b/Dynamic/Utils/WeakHandle.cs @@ -5,7 +5,7 @@ using System; using System.Runtime.InteropServices; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { /// /// Changes the semantics of GC handle to return null instead of throwing diff --git a/Dynamic/Xaml/DynamicXamlReader.cs b/Dynamic/Xaml/DynamicXamlReader.cs index a212a591..e81c66f1 100644 --- a/Dynamic/Xaml/DynamicXamlReader.cs +++ b/Dynamic/Xaml/DynamicXamlReader.cs @@ -11,7 +11,7 @@ using System.Reflection; using System.Collections.Generic; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Provides services for loading XAML and binding events to dynamic language code definitions. /// @@ -74,7 +74,7 @@ public static object LoadComponent(dynamic scope, DynamicOperations operations, operations.SetMember((object)scope, name, value); } } - + return myWriter.Result; } @@ -138,14 +138,14 @@ public override void WriteValue(object value) { } base.WriteValue(value); } - + public override void WriteEndMember() { _nameStack.Pop(); base.WriteEndMember(); } public override void WriteStartMember(XamlMember property) { - // we don't check the namespace for the property here - it can be x:Name or it can be Name + // we don't check the namespace for the property here - it can be x:Name or it can be Name // on the underlying type. WPF supports either one and so do we. if (property.Name == "Name" && property.Type.UnderlyingType == typeof(string)) { _nameStack.Push(true); @@ -158,7 +158,7 @@ public override void WriteStartMember(XamlMember property) { } else { base.WriteStartMember(property); } - } + } } } } diff --git a/Metadata/ClrStubs.cs b/Metadata/ClrStubs.cs index 02b7df7a..32016ec8 100644 --- a/Metadata/ClrStubs.cs +++ b/Metadata/ClrStubs.cs @@ -6,7 +6,7 @@ using System; using System.Diagnostics; -namespace Microsoft.Scripting.Metadata { +namespace Riverside.Scripting.Metadata { internal static class ClrStubs { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal unsafe static int GetCharCount(this Encoding encoding, byte* bytes, int byteCount, object nls) { @@ -18,4 +18,4 @@ internal unsafe static void GetChars(this Encoding encoding, byte* bytes, int by encoding.GetChars(bytes, byteCount, chars, charCount); } } -} \ No newline at end of file +} diff --git a/Metadata/MemoryBlock.cs b/Metadata/MemoryBlock.cs index 94c35c26..780d3f87 100644 --- a/Metadata/MemoryBlock.cs +++ b/Metadata/MemoryBlock.cs @@ -7,7 +7,7 @@ using System.Runtime.InteropServices; using System.Text; -namespace Microsoft.Scripting.Metadata { +namespace Riverside.Scripting.Metadata { /// /// Represents a block in memory. /// @@ -133,7 +133,7 @@ public string ReadAscii(int offset, int maxByteCount) { if (offset < 0 || offset > _length - maxByteCount) { throw new ArgumentOutOfRangeException(nameof(offset)); } - + sbyte* pStart = (sbyte*)_pointer + offset; sbyte* pEnd = pStart + maxByteCount; sbyte* pIter = pStart; @@ -219,8 +219,8 @@ internal MetadataName ReadName(uint offset) { // Returns RowNumber internal int BinarySearchForSlot(int numberOfRows, int numberOfChildren, int rowSize, int referenceOffset, uint childRid, bool isReferenceSmall) { - int startRowNumber = 0; // inclusive - int endRowNumber = numberOfRows; // exclusive + int startRowNumber = 0; // inclusive + int endRowNumber = numberOfRows; // exclusive uint startRid = ReadReference(startRowNumber * rowSize + referenceOffset, isReferenceSmall); uint endRid = (uint)numberOfChildren + 1; diff --git a/Metadata/MemoryMapping.V4.cs b/Metadata/MemoryMapping.V4.cs index 404b8e63..a9136cce 100644 --- a/Metadata/MemoryMapping.V4.cs +++ b/Metadata/MemoryMapping.V4.cs @@ -12,7 +12,7 @@ using System.Security; using Microsoft.Win32.SafeHandles; -namespace Microsoft.Scripting.Metadata { +namespace Riverside.Scripting.Metadata { [SecurityCritical] public unsafe sealed class MemoryMapping : CriticalFinalizerObject { [SecurityCritical] diff --git a/Metadata/MemoryReader.cs b/Metadata/MemoryReader.cs index f977afd6..37b7ea76 100644 --- a/Metadata/MemoryReader.cs +++ b/Metadata/MemoryReader.cs @@ -5,7 +5,7 @@ using System; using System.Diagnostics; -namespace Microsoft.Scripting.Metadata { +namespace Riverside.Scripting.Metadata { /// /// Reads data from a memory block. Maintains a position. /// diff --git a/Metadata/MetadataExtensions.cs b/Metadata/MetadataExtensions.cs index 6cf19848..8e8c67bb 100644 --- a/Metadata/MetadataExtensions.cs +++ b/Metadata/MetadataExtensions.cs @@ -9,7 +9,7 @@ using System.Text; using System.Security; -namespace Microsoft.Scripting.Metadata { +namespace Riverside.Scripting.Metadata { public static class MetadataExtensions { public static bool IsNested(this TypeAttributes attrs) { switch (attrs & TypeAttributes.VisibilityMask) { diff --git a/Metadata/MetadataImport.cs b/Metadata/MetadataImport.cs index 9452f325..17896455 100644 --- a/Metadata/MetadataImport.cs +++ b/Metadata/MetadataImport.cs @@ -7,7 +7,7 @@ using System.Reflection; using System.IO; -namespace Microsoft.Scripting.Metadata { +namespace Riverside.Scripting.Metadata { internal sealed class MetadataImport { private readonly MemoryBlock _image; private const int TableCount = (int)MetadataRecordType.GenericParamConstraint + 1; @@ -189,7 +189,7 @@ private void ReadCOR20Header() { _cor20Header.MetaDataDirectory.RelativeVirtualAddress = memReader.ReadUInt32(); _cor20Header.MetaDataDirectory.Size = memReader.ReadUInt32(); - + // COR20Header.COR20Flags = (COR20Flags)memReader.ReadUInt32(); // COR20Header.EntryPointTokenOrRVA = memReader.ReadUInt32(); memReader.SeekRelative(2 * sizeof(uint)); @@ -215,7 +215,7 @@ private void ReadMetadataHeader(MemoryReader memReader) { // MajorVersion = memReader.ReadUInt16(); // MinorVersion = memReader.ReadUInt16(); memReader.SeekRelative(2 * sizeof(ushort)); - + uint reserved = memReader.ReadUInt32(); if (reserved != 0) { throw new BadImageFormatException(); @@ -403,7 +403,7 @@ internal bool UseParamPtrTable { get { return ParamPtrTable.NumberOfRows > 0; } } - internal bool UseEventPtrTable { + internal bool UseEventPtrTable { get { return EventPtrTable.NumberOfRows > 0; } } @@ -422,7 +422,7 @@ private void ReadMetadataTableInformation(MemoryReader memReader) { _metadataTableHeader.MajorVersion = memReader.ReadByte(); _metadataTableHeader.MinorVersion = memReader.ReadByte(); _metadataTableHeader.HeapSizeFlags = (HeapSizeFlag)memReader.ReadByte(); - + // Rid memReader.SeekRelative(sizeof(byte)); @@ -533,7 +533,7 @@ private void ProcessAndCacheMetadataTableBlocks(MemoryBlock metadataTablesMemory int stringHeapRefSize = (_metadataTableHeader.HeapSizeFlags & HeapSizeFlag.StringHeapLarge) == HeapSizeFlag.StringHeapLarge ? 4 : 2; int guidHeapRefSize = (_metadataTableHeader.HeapSizeFlags & HeapSizeFlag.GUIDHeapLarge) == HeapSizeFlag.GUIDHeapLarge ? 4 : 2; int blobHeapRefSize = (_metadataTableHeader.HeapSizeFlags & HeapSizeFlag.BlobHeapLarge) == HeapSizeFlag.BlobHeapLarge ? 4 : 2; - + // Populate the Table blocks int totalRequiredSize = 0; int currentTableSize = 0; @@ -1132,7 +1132,7 @@ public unsafe void Dump(TextWriter output) { output.WriteLine("UserStringStream: +{0:X8}", _userStringStream != null ? (_userStringStream.Pointer - _image.Pointer) : 0); output.WriteLine("MetadataTableStream: +{0:X8}", _metadataTableStream.Pointer - _image.Pointer); //output.WriteLine("ResourceMemoryReader: +{0:X8}", _resourceMemoryBlock != null ? (_resourceMemoryBlock.Pointer - _image.Pointer) : 0); - + output.WriteLine(); output.WriteLine("Misc:"); output.WriteLine(" MetadataStreamKind {0}", _metadataStreamKind); diff --git a/Metadata/MetadataName.cs b/Metadata/MetadataName.cs index 64551cf6..20beeef7 100644 --- a/Metadata/MetadataName.cs +++ b/Metadata/MetadataName.cs @@ -8,7 +8,7 @@ using System.Security; using System.Text; -namespace Microsoft.Scripting.Metadata { +namespace Riverside.Scripting.Metadata { /// /// Zero terminated, UTF8 encoded sequence of bytes representing a name in metadata (a type name, a member name, etc). /// The name is bound to the module it was retrieved from. The module is kept alive until all its metadata names are collected. @@ -211,7 +211,7 @@ internal static int IndexOf(byte* bytes, byte b, int start, int count) { } return -1; } - + internal static byte* FindPrevious(byte* start, byte* last, byte b) { Contract.Assert(start != null && last != null); byte* ptr = start - 1; diff --git a/Metadata/MetadataServices.cs b/Metadata/MetadataServices.cs index 5822d2c6..0c4ae737 100644 --- a/Metadata/MetadataServices.cs +++ b/Metadata/MetadataServices.cs @@ -7,7 +7,7 @@ using System.Text; using System.Reflection; -namespace Microsoft.Scripting.Metadata { +namespace Riverside.Scripting.Metadata { public static class MetadataServices { // Stores metadata tables for each loaded non-dynamic assemblies. // The first module in the array is always a manifest module. @@ -31,7 +31,7 @@ private static MetadataTables[] GetAsseblyMetadata(Assembly assembly) { metadata[0] = tables; } } - + _metadataCache.Add(assembly, metadata); } return metadata; @@ -109,7 +109,7 @@ public static List> GetVisibleExtensionMethods(Assembl public static List GetVisibleExtensionMethodInfos(Assembly assembly) { var tokens = GetVisibleExtensionMethods(assembly); - + List result = new List(tokens.Count); foreach (var moduleAndToken in tokens) { result.Add((MethodInfo)moduleAndToken.Key.ResolveMethod(moduleAndToken.Value)); diff --git a/Metadata/MetadataTableEnumerator.CCI.cs b/Metadata/MetadataTableEnumerator.CCI.cs index 07b3dc9b..55efa80e 100644 --- a/Metadata/MetadataTableEnumerator.CCI.cs +++ b/Metadata/MetadataTableEnumerator.CCI.cs @@ -5,7 +5,7 @@ using System; using System.Diagnostics; -namespace Microsoft.Scripting.Metadata { +namespace Riverside.Scripting.Metadata { internal enum EnumerationIndirection { None = 0, Method = 1, @@ -35,7 +35,7 @@ internal MetadataTableEnumerator(MetadataRecord parent, MetadataTokenType type) parent.Token, out int start, out int count); - + m_startRid = start; m_endRid = start + count; m_currentRid = start - 1; @@ -92,8 +92,8 @@ public bool MoveNext() { } public MetadataRecord Current { - get { - return new MetadataRecord(m_currentToken, m_tables); + get { + return new MetadataRecord(m_currentToken, m_tables); } } } diff --git a/Metadata/MetadataTableImplementations.cs b/Metadata/MetadataTableImplementations.cs index ab3b53f9..e601ed7b 100644 --- a/Metadata/MetadataTableImplementations.cs +++ b/Metadata/MetadataTableImplementations.cs @@ -5,7 +5,7 @@ using System; using System.Reflection; -namespace Microsoft.Scripting.Metadata { +namespace Riverside.Scripting.Metadata { internal sealed class ModuleTable { internal const int TableIndex = 0; internal readonly int NumberOfRows; @@ -427,7 +427,7 @@ internal int FindInterfaceImplForType(int typeDefRowId, out int interfaceCount) int startRowNumber = foundRowNumber; while ( - startRowNumber > 0 && + startRowNumber > 0 && Table.ReadReference((startRowNumber - 1) * RowSize + ClassOffset, IsTypeDefOrRefRefSizeSmall) == typeDefRowId ) { startRowNumber--; @@ -597,7 +597,7 @@ private int BinarySearchTag(uint searchCodedTag, out int customAttributeCount) { int startRowNumber = foundRowNumber; while ( - startRowNumber > 0 && + startRowNumber > 0 && Table.ReadReference((startRowNumber - 1) * RowSize + ParentOffset, IsHasCustomAttributeRefSizeSmall) == searchCodedTag ) { startRowNumber--; @@ -692,7 +692,7 @@ private int BinarySearchTag(uint searchCodedTag, out int securityAttributeCount) int startRowNumber = foundRowNumber; while ( - startRowNumber > 0 && + startRowNumber > 0 && Table.ReadReference((startRowNumber - 1) * RowSize + ParentOffset, IsHasDeclSecurityRefSizeSmall) == searchCodedTag ) { startRowNumber--; @@ -700,12 +700,12 @@ private int BinarySearchTag(uint searchCodedTag, out int securityAttributeCount) int endRowNumber = foundRowNumber; while ( - endRowNumber + 1 < NumberOfRows && + endRowNumber + 1 < NumberOfRows && Table.ReadReference((endRowNumber + 1) * RowSize + ParentOffset, IsHasDeclSecurityRefSizeSmall) == searchCodedTag ) { endRowNumber++; } - + securityAttributeCount = endRowNumber - startRowNumber + 1; return startRowNumber + 1; } @@ -1120,7 +1120,7 @@ private int BinarySearchTag(uint searchCodedTag, out int methodCount) { int startRowNumber = foundRowNumber; while ( - startRowNumber > 0 && + startRowNumber > 0 && Table.ReadReference((startRowNumber - 1) * RowSize + AssociationOffset, IsHasSemanticRefSizeSmall) == searchCodedTag ) { startRowNumber--; @@ -1177,7 +1177,7 @@ internal int FindMethodsImplForClass(int typeDefRowId, out ushort methodImplCoun int startRowNumber = foundRowNumber; while ( - startRowNumber > 0 && + startRowNumber > 0 && Table.ReadReference((startRowNumber - 1) * RowSize + ClassOffset, IsTypeDefTableRowRefSizeSmall) == typeDefRowId ) { startRowNumber--; @@ -1185,7 +1185,7 @@ internal int FindMethodsImplForClass(int typeDefRowId, out ushort methodImplCoun int endRowNumber = foundRowNumber; while ( - endRowNumber + 1 < NumberOfRows && + endRowNumber + 1 < NumberOfRows && Table.ReadReference((endRowNumber + 1) * RowSize + ClassOffset, IsTypeDefTableRowRefSizeSmall) == typeDefRowId ) { endRowNumber++; @@ -1815,7 +1815,7 @@ private int BinarySearchTag(uint searchCodedTag, out int genericParamCount) { int startRowNumber = foundRowNumber; while ( - startRowNumber > 0 && + startRowNumber > 0 && Table.ReadReference((startRowNumber - 1) * RowSize + OwnerOffset, IsTypeOrMethodDefRefSizeSmall) == searchCodedTag ) { startRowNumber--; @@ -1823,7 +1823,7 @@ private int BinarySearchTag(uint searchCodedTag, out int genericParamCount) { int endRowNumber = foundRowNumber; while ( - endRowNumber + 1 < NumberOfRows && + endRowNumber + 1 < NumberOfRows && Table.ReadReference((endRowNumber + 1) * RowSize + OwnerOffset, IsTypeOrMethodDefRefSizeSmall) == searchCodedTag ) { endRowNumber++; @@ -1912,7 +1912,7 @@ internal int FindConstraintForGenericParam(int genericParamRowId, out int generi int startRowNumber = foundRowNumber; while ( - startRowNumber > 0 && + startRowNumber > 0 && Table.ReadReference((startRowNumber - 1) * RowSize + OwnerOffset, IsGenericParamTableRowRefSizeSmall) == genericParamRowId ) { startRowNumber--; @@ -1920,7 +1920,7 @@ internal int FindConstraintForGenericParam(int genericParamRowId, out int generi int endRowNumber = foundRowNumber; while ( - endRowNumber + 1 < NumberOfRows && + endRowNumber + 1 < NumberOfRows && Table.ReadReference((endRowNumber + 1) * RowSize + OwnerOffset, IsGenericParamTableRowRefSizeSmall) == genericParamRowId ) { endRowNumber++; diff --git a/Metadata/MetadataTables.CCI.cs b/Metadata/MetadataTables.CCI.cs index a1dc3067..94b980ba 100644 --- a/Metadata/MetadataTables.CCI.cs +++ b/Metadata/MetadataTables.CCI.cs @@ -8,7 +8,7 @@ using System.IO; using System.Diagnostics.Contracts; -namespace Microsoft.Scripting.Metadata { +namespace Riverside.Scripting.Metadata { [Serializable] public enum MetadataRecordType { ModuleDef = ModuleTable.TableIndex, @@ -62,7 +62,7 @@ public static MetadataTables OpenFile(string path) { if (path == null) { throw new ArgumentNullException(nameof(path)); } - + return new MetadataTables(CreateImport(path), path, null); } @@ -110,7 +110,7 @@ internal MetadataImport Import { public partial struct MetadataTableView { /// /// Gets the number of records in the view. - /// If the view is over an entire table this operation is O(1), + /// If the view is over an entire table this operation is O(1), /// otherwise it might take up to O(log(#records in the table)). /// public int GetCount() { @@ -162,7 +162,7 @@ internal TypeRef(MetadataRecord record) { /// ModuleDef: /// If the target type is defined in the current module (this should not occur in a CLI "compressed metadata" module). /// Null token: - /// There shall be a row in the ExportedType table for this Type - its Implementation field shall contain + /// There shall be a row in the ExportedType table for this Type - its Implementation field shall contain /// a File token or an AssemblyRef token that says where the type is defined. /// public MetadataRecord ResolutionScope { @@ -189,7 +189,7 @@ internal TypeDef(MetadataRecord record) { Contract.Requires(record.IsTypeDef && record.Tables.IsValidToken(record.Token)); m_record = record; } - + public MetadataName Name { get { return m_record.Tables.ToMetadataName(m_record.Import.TypeDefTable.GetName(m_record.Rid)); @@ -223,7 +223,7 @@ public MetadataRecord BaseType { /// public TypeDef FindDeclaringType() { return new MetadataRecord( - new MetadataToken(MetadataTokenType.TypeDef, m_record.Import.NestedClassTable.FindParentTypeDefRowId(m_record.Rid)), + new MetadataToken(MetadataTokenType.TypeDef, m_record.Import.NestedClassTable.FindParentTypeDefRowId(m_record.Rid)), m_record.Tables ).TypeDef; } @@ -236,13 +236,13 @@ public int GetGenericParameterCount() { return count; } } - + public partial struct FieldDef { internal FieldDef(MetadataRecord record) { Contract.Requires(record.IsFieldDef && record.Tables.IsValidToken(record.Token)); m_record = record; } - + /// /// Flags field in the Field table. /// @@ -290,7 +290,7 @@ public MemoryBlock GetData(int size) { /// public TypeDef FindDeclaringType() { return new MetadataRecord( - new MetadataToken(MetadataTokenType.TypeDef, m_record.Import.TypeDefTable.FindTypeContainingField(m_record.Rid, m_record.Import.FieldTable.NumberOfRows)), + new MetadataToken(MetadataTokenType.TypeDef, m_record.Import.TypeDefTable.FindTypeContainingField(m_record.Rid, m_record.Import.FieldTable.NumberOfRows)), m_record.Tables ).TypeDef; } @@ -347,7 +347,7 @@ public MemoryBlock GetBody() { /// public TypeDef FindDeclaringType() { return new MetadataRecord( - new MetadataToken(MetadataTokenType.TypeDef, m_record.Import.TypeDefTable.FindTypeContainingMethod(m_record.Rid, m_record.Import.MethodTable.NumberOfRows)), + new MetadataToken(MetadataTokenType.TypeDef, m_record.Import.TypeDefTable.FindTypeContainingMethod(m_record.Rid, m_record.Import.MethodTable.NumberOfRows)), m_record.Tables ).TypeDef; } @@ -368,7 +368,7 @@ internal ParamDef(MetadataRecord record) { Contract.Requires(record.IsParamDef && record.Tables.IsValidToken(record.Token)); m_record = record; } - + public ParameterAttributes Attributes { get { return m_record.Import.ParamTable.GetFlags(m_record.Rid); @@ -376,7 +376,7 @@ public ParameterAttributes Attributes { } /// - /// Value greater or equal to zero and less than or equal to the number of parameters in owner method. + /// Value greater or equal to zero and less than or equal to the number of parameters in owner method. /// A value of 0 refers to the owner method's return type; its parameters are then numbered from 1 onwards. /// Not all parameters need to have a corresponding ParamDef entry. /// @@ -416,14 +416,14 @@ internal InterfaceImpl(MetadataRecord record) { Contract.Requires(record.IsInterfaceImpl && record.Tables.IsValidToken(record.Token)); m_record = record; } - + /// /// Could be a null token in EnC scenarios. /// public TypeDef ImplementingType { get { return new MetadataRecord( - new MetadataToken(MetadataTokenType.TypeDef, m_record.Import.InterfaceImplTable.GetClass(m_record.Rid)), + new MetadataToken(MetadataTokenType.TypeDef, m_record.Import.InterfaceImplTable.GetClass(m_record.Rid)), m_record.Tables ).TypeDef; } @@ -447,14 +447,14 @@ internal MemberRef(MetadataRecord record) { /// /// TypeRef or TypeDef: - /// If the class that defines the member is defined in another module. - /// Note that it is unusual, but valid, to use a TypeRef token when the member is defined in this same module, + /// If the class that defines the member is defined in another module. + /// Note that it is unusual, but valid, to use a TypeRef token when the member is defined in this same module, /// in which case, its TypeDef token can be used instead. /// ModuleRef: /// If the member is defined, in another module of the same assembly, as a global function or variable. - /// MethodDef: - /// When used to supply a call-site signature for a vararg method that is defined in this module. - /// The Name shall match the Name in the corresponding MethodDef row. + /// MethodDef: + /// When used to supply a call-site signature for a vararg method that is defined in this module. + /// The Name shall match the Name in the corresponding MethodDef row. /// The Signature shall match the Signature in the target method definition /// TypeSpec: /// If the member is a member of a generic type @@ -483,7 +483,7 @@ internal CustomAttributeDef(MetadataRecord record) { Contract.Requires(record.IsCustomAttributeDef && record.Tables.IsValidToken(record.Token)); m_record = record; } - + /// /// Any token except the CustomAttribute. /// @@ -506,10 +506,10 @@ public MetadataRecord Constructor { /// /// Value blob. /// - public MemoryBlock Value { + public MemoryBlock Value { get { return m_record.Import.GetBlobBlock(m_record.Import.CustomAttributeTable.GetValue(m_record.Rid)); - } + } } } @@ -531,7 +531,7 @@ internal PropertyDef(MetadataRecord record) { Contract.Requires(record.IsProperty && record.Tables.IsValidToken(record.Token)); m_record = record; } - + public PropertyAttributes Attributes { get { return m_record.Import.PropertyTable.GetFlags(m_record.Rid); @@ -553,7 +553,7 @@ public MemoryBlock Signature { public PropertyAccessors GetAccessors() { var import = m_record.Import; int semanticsRow = import.MethodSemanticsTable.FindSemanticMethodsForProperty(m_record.Rid, out int methodCount); - + uint getter = 0, setter = 0; for (ushort i = 0; i < methodCount; i++) { switch (import.MethodSemanticsTable.GetFlags(semanticsRow)) { @@ -623,7 +623,7 @@ public EventAccessors GetAccessors() { semanticsRow++; } - return new EventAccessors(this, + return new EventAccessors(this, new MetadataToken(MetadataTokenType.MethodDef, add), new MetadataToken(MetadataTokenType.MethodDef, remove), new MetadataToken(MetadataTokenType.MethodDef, fire) @@ -825,7 +825,7 @@ public uint Offset { } public ManifestResourceAttributes Attributes { - get { + get { return m_record.Import.ManifestResourceTable.GetFlags(m_record.Rid); } } @@ -875,7 +875,7 @@ public GenericParameterAttributes Attributes { } /// - /// Value greater or equal to zero and less than or equal to the number of parameters in owner method/type. + /// Value greater or equal to zero and less than or equal to the number of parameters in owner method/type. /// All generic parameters are listed in the table. /// public int Index { diff --git a/Metadata/MetadataTables.cs b/Metadata/MetadataTables.cs index 47ff7eaf..7123b8e9 100644 --- a/Metadata/MetadataTables.cs +++ b/Metadata/MetadataTables.cs @@ -33,10 +33,10 @@ // #if CCI -namespace Microsoft.Scripting.Metadata { +namespace Riverside.Scripting.Metadata { #else namespace System.Reflection { - using Microsoft.Scripting.Metadata; + using Riverside.Scripting.Metadata; #endif [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1717:OnlyFlagsEnumsShouldHavePluralNames")] public enum AssemblyFileAttributes { @@ -135,12 +135,12 @@ internal string DebugView { } } -namespace Microsoft.Scripting.Metadata { +namespace Riverside.Scripting.Metadata { [DebuggerDisplay("{DebugView}")] public partial struct MetadataRecord : IEquatable { internal readonly MetadataToken m_token; internal readonly MetadataTables m_tables; - + internal MetadataRecord(MetadataToken token, MetadataTables tables) { Contract.Assert(tables != null); m_token = token; @@ -600,7 +600,7 @@ public MetadataRecord Record { } } - // Constant (0x0B) - Param, Field, Property + // Constant (0x0B) - Param, Field, Property /// /// CustomAttribute table entry (0x0C tokens). @@ -705,7 +705,7 @@ public bool HasSetter { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")] public IEnumerable Others { get { - // TODO: + // TODO: throw new NotImplementedException(); } } @@ -768,7 +768,7 @@ public EventDef DeclaringEvent { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")] public IEnumerable Others { get { - // TODO: + // TODO: throw new NotImplementedException(); } } @@ -844,7 +844,7 @@ public MetadataTableView CustomAttributes { /// /// Assembly table entry (0x23 tokens). /// - public partial struct AssemblyRef { // TODO: AssemblyRef name is already an internal class + public partial struct AssemblyRef { // TODO: AssemblyRef name is already an internal class private readonly MetadataRecord m_record; public static implicit operator MetadataRecord(AssemblyRef assemblyRef) { diff --git a/Metadata/PEFileStructures.cs b/Metadata/PEFileStructures.cs index 7e587a7b..360dbe9a 100644 --- a/Metadata/PEFileStructures.cs +++ b/Metadata/PEFileStructures.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Metadata { +namespace Riverside.Scripting.Metadata { internal enum PEMagic : ushort { PEMagic32 = 0x010B, PEMagic64 = 0x020B, @@ -275,32 +275,32 @@ public enum ElementType : byte { Single = 0x0c, Double = 0x0d, String = 0x0e, - + Pointer = 0x0f, ByReference = 0x10, - + ValueType = 0x11, Class = 0x12, GenericTypeParameter = 0x13, Array = 0x14, GenericTypeInstance = 0x15, TypedReference = 0x16, - + IntPtr = 0x18, UIntPtr = 0x19, FunctionPointer = 0x1b, Object = 0x1c, Vector = 0x1d, - + GenericMethodParameter = 0x1e, - + RequiredModifier = 0x1f, OptionalModifier = 0x20, - + Internal = 0x21, - + Max = 0x22, - + Modifier = 0x40, Sentinel = 0x41, Pinned = 0x45, @@ -361,7 +361,7 @@ public static bool IsGeneric(byte signatureHeader) { return (signatureHeader & SignatureHeader.Generic) == SignatureHeader.Generic; } } - + #region PEFile specific data internal static class PEFileConstants { @@ -822,7 +822,7 @@ internal static class ImplementationTag { internal const uint AssemblyRef = 0x00000001; internal const uint ExportedType = 0x00000002; internal const uint TagMask = 0x00000003; - + internal const TableMask TablesReferenced = TableMask.File | TableMask.AssemblyRef | TableMask.ExportedType; internal static MetadataToken ConvertToToken(uint implementation) { @@ -906,5 +906,5 @@ internal static uint ConvertMethodDefRowIdToTag(int methodDefRowId) { } } - #endregion + #endregion } diff --git a/Metadata/Properties/AssemblyInfo.cs b/Metadata/Properties/AssemblyInfo.cs index 14d3c1d9..1933be46 100644 --- a/Metadata/Properties/AssemblyInfo.cs +++ b/Metadata/Properties/AssemblyInfo.cs @@ -9,13 +9,13 @@ using System.Runtime.InteropServices; using System.Security; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Microsoft.Scripting.Metadata")] +[assembly: AssemblyTitle("Riverside.Scripting.Metadata")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] diff --git a/Metadata/Microsoft.Scripting.Metadata.csproj b/Metadata/Riverside.Scripting.Metadata.csproj similarity index 91% rename from Metadata/Microsoft.Scripting.Metadata.csproj rename to Metadata/Riverside.Scripting.Metadata.csproj index 06dd6e55..d3b10b5c 100644 --- a/Metadata/Microsoft.Scripting.Metadata.csproj +++ b/Metadata/Riverside.Scripting.Metadata.csproj @@ -9,7 +9,7 @@ - + diff --git a/Microsoft/Samples/Hosting/Scenarios/Hosting Scenarios.csproj b/Microsoft/Samples/Hosting/Scenarios/Hosting Scenarios.csproj index bad0001c..86072a39 100644 --- a/Microsoft/Samples/Hosting/Scenarios/Hosting Scenarios.csproj +++ b/Microsoft/Samples/Hosting/Scenarios/Hosting Scenarios.csproj @@ -19,13 +19,13 @@ - + {02FF0909-F5AD-48CF-A86A-345E721B7E40} - Microsoft.Scripting + Riverside.Scripting - + {EB66B766-6354-4208-A3D4-AACBDCB5C3B3} - Microsoft.Dynamic + Riverside.Dynamic {155CE436-1669-4A48-8095-410F2430237F} @@ -60,4 +60,4 @@ - \ No newline at end of file + diff --git a/Microsoft/Samples/Hosting/Scenarios/Program.cs b/Microsoft/Samples/Hosting/Scenarios/Program.cs index 7b53b576..e66f4f71 100644 --- a/Microsoft/Samples/Hosting/Scenarios/Program.cs +++ b/Microsoft/Samples/Hosting/Scenarios/Program.cs @@ -8,8 +8,8 @@ using System.Security.Policy; using System.Security; using Microsoft.CSharp.RuntimeBinder; -using Microsoft.Scripting; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting; +using Riverside.Scripting.Hosting; // TODO: //if (ops.IsInvokable(obj, memberName)) { @@ -82,7 +82,7 @@ public static void Scenario_ExecuteFile_Push() { runtime.Globals.SetVariable("App", hostOM); runtime.ExecuteFile("register_user_commands.py"); - + hostOM.UserCommands["foo"](); } @@ -154,7 +154,7 @@ public static void Scenario_CompiledCode() { // 5 requests for same page: for (int i = 0; i < 5; i++) { - // on each request, create new scope with a custom dictionary for latebound look up of elements on page. + // on each request, create new scope with a custom dictionary for latebound look up of elements on page. // This uses a derived type of DynamicObject for convenience. var page = new DynamicPage(); @@ -216,7 +216,7 @@ public static void Scenario_Introspection() { var ops = engine.GetService(); foreach (MemberDoc doc in ops.GetMembers(obj)) { Console.WriteLine(doc.Name); - + object member = engine.Operations.GetMember(obj, doc.Name); PrintSignatures(ops.GetOverloads(member)); } @@ -281,7 +281,7 @@ public static void Scenario_RemoteEvaluation() { class C(object): def __init__(self, value): self.value = value - + def __int__(self): return self.value diff --git a/Microsoft/Samples/sympl/csharp/DlrHosting.cs b/Microsoft/Samples/sympl/csharp/DlrHosting.cs index c2486df0..5eb7e48f 100644 --- a/Microsoft/Samples/sympl/csharp/DlrHosting.cs +++ b/Microsoft/Samples/sympl/csharp/DlrHosting.cs @@ -2,13 +2,13 @@ using System.Collections.Generic; using System.Dynamic; using System.Text; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Runtime; using System.Linq; using System.Linq.Expressions; -using Microsoft.Scripting; +using Riverside.Scripting; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; using Path = System.IO.Path; @@ -88,8 +88,8 @@ public override TService GetService(params object[] args) { } //SymplLangContext - - + + // This class represents Sympl compiled code for the language implementation // support the DLR Hosting APIs require. The DLR Hosting APIs call on // this class to run code in a new ScriptScope (represented as Scope at the @@ -103,7 +103,7 @@ public sealed class SymplScriptCode : ScriptCode { private Func _compiledLambda; public SymplScriptCode( - Sympl sympl, + Sympl sympl, Expression> lambda, SourceUnit sourceUnit) : base(sourceUnit) { diff --git a/Microsoft/Samples/sympl/csharp/Program.cs b/Microsoft/Samples/sympl/csharp/Program.cs index b03b0f4e..23219371 100644 --- a/Microsoft/Samples/sympl/csharp/Program.cs +++ b/Microsoft/Samples/sympl/csharp/Program.cs @@ -3,8 +3,8 @@ using System.IO; using System.Reflection; using System.Linq.Expressions; -using Microsoft.Scripting; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting; +using Riverside.Scripting.Hosting; namespace SymplSample { @@ -28,12 +28,12 @@ static void Main(string[] args) // Sympl constructor, because the DLR loads mscorlib and System by // default. //dlrRuntime.LoadAssembly(typeof(object).Assembly); - + // Get a Sympl engine and run stuff ... var engine = dlrRuntime.GetEngine("sympl"); string filename = Path.GetFullPath( Path.Combine( - Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), + Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), @"..\..\Runtime\Samples\sympl\examples\test.sympl" ) ); @@ -49,7 +49,7 @@ static void Main(string[] args) pyeng.Execute("def pyfoo(): return 1", feo); rbeng.Execute("def rbbar; 2; end", feo); // Call those objects from Sympl. - Console.WriteLine("pyfoo returns " + + Console.WriteLine("pyfoo returns " + (engine.Execute("(pyfoo)", feo)).ToString()); Console.WriteLine("rbbar returns " + (engine.Execute("(rbbar)", feo)).ToString()); diff --git a/Microsoft/Samples/sympl/csharp/Runtime.cs b/Microsoft/Samples/sympl/csharp/Runtime.cs index 01763e52..9b9cc765 100644 --- a/Microsoft/Samples/sympl/csharp/Runtime.cs +++ b/Microsoft/Samples/sympl/csharp/Runtime.cs @@ -3,8 +3,8 @@ using System.Dynamic; using System.Reflection; using System.Linq.Expressions; -using Microsoft.Scripting.ComInterop; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.ComInterop; +using Riverside.Scripting.Utils; using System.Linq; using System.Runtime.CompilerServices; using Path = System.IO.Path; @@ -172,8 +172,8 @@ public static T[] RemoveLast(T[] array) { System.Array.Resize(ref array, array.Length - 1); return array; } - - + + /////////////////////////////////////// // Utilities used by binders at runtime /////////////////////////////////////// @@ -254,7 +254,7 @@ public static Expression[] ConvertArguments( Expression[] callArgs = new Expression[args.Length]; for (int i = 0; i < args.Length; i++) { Expression argExpr = args[i].Expression; - if (args[i].LimitType == typeof(TypeModel) && + if (args[i].LimitType == typeof(TypeModel) && ps[i].ParameterType == typeof(Type)) { // Get arg.ReflType argExpr = GetRuntimeTypeMoFromModel(args[i]).Expression; @@ -330,7 +330,7 @@ public static Expression GetIndexingExpression( // The first argument is the list args.Add( Expression.Convert( - target.Expression, + target.Expression, target.LimitType) ); args.AddRange(indexExpressions); @@ -352,7 +352,7 @@ public static Expression GetIndexingExpression( var indexers = props. Where(p => p.GetIndexParameters().Length > 0).ToArray(); indexers = indexers. - Where(idx => idx.GetIndexParameters().Length == + Where(idx => idx.GetIndexParameters().Length == indexes.Length).ToArray(); var res = new List(); @@ -384,12 +384,12 @@ public static Expression GetIndexingExpression( // that throws. Binders never just throw due to the protocol since // a binder or MO down the line may provide an implementation. // - // It returns a DynamicMetaObject whose expr throws the exception, and + // It returns a DynamicMetaObject whose expr throws the exception, and // ensures the expr's type is object to satisfy the CallSite return type // constraint. // // A couple of calls to CreateThrow already have the args and target - // restrictions merged in, but BindingRestrictions.Merge doesn't add + // restrictions merged in, but BindingRestrictions.Merge doesn't add // duplicates. // public static DynamicMetaObject CreateThrow @@ -512,7 +512,7 @@ internal DoHelpersGetMemberBinder(string name) : base(name, true) { } public override DynamicMetaObject FallbackGetMember( DynamicMetaObject target, DynamicMetaObject errorSuggestion) { - return errorSuggestion ?? + return errorSuggestion ?? new DynamicMetaObject( Expression.Constant(DynamicObjectHelpers.Sentinel), target.Restrictions.Merge( @@ -532,13 +532,13 @@ public override DynamicMetaObject FallbackSetMember( RuntimeHelpers.CreateThrow( target, null, BindingRestrictions.Empty, typeof(MissingMemberException), - "If IDynObj doesn't support setting members, " + + "If IDynObj doesn't support setting members, " + "DOHelpers can't do it for the IDO."); } } - + //######################## // General Runtime Binders //######################## @@ -561,7 +561,7 @@ public override DynamicMetaObject FallbackGetMember( // Expressions and nest a CallSite for the InvokeMember. if (!targetMO.HasValue) return Defer(targetMO); // Find our own binding. - var flags = BindingFlags.IgnoreCase | BindingFlags.Static | + var flags = BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public; var members = targetMO.LimitType.GetMember(this.Name, flags); if (members.Length == 1) { @@ -579,7 +579,7 @@ public override DynamicMetaObject FallbackGetMember( } else { return errorSuggestion ?? RuntimeHelpers.CreateThrow( - targetMO, null, + targetMO, null, BindingRestrictions.GetTypeRestriction(targetMO.Expression, targetMO.LimitType), typeof(MissingMemberException), @@ -609,7 +609,7 @@ public override DynamicMetaObject FallbackSetMember( // Expressions and nest a CallSite for the InvokeMember. if (!targetMO.HasValue) return Defer(targetMO); // Find our own binding. - var flags = BindingFlags.IgnoreCase | BindingFlags.Static | + var flags = BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public; var members = targetMO.LimitType.GetMember(this.Name, flags); if (members.Length == 1) { @@ -645,13 +645,13 @@ public override DynamicMetaObject FallbackSetMember( val)), // Don't need restriction test for name since this // rule is only used where binder is used, which is - // only used in sites with this binder.Name. + // only used in sites with this binder.Name. BindingRestrictions.GetTypeRestriction(targetMO.Expression, targetMO.LimitType)); } else { return errorSuggestion ?? RuntimeHelpers.CreateThrow( - targetMO, null, + targetMO, null, BindingRestrictions.GetTypeRestriction(targetMO.Expression, targetMO.LimitType), typeof(MissingMemberException), @@ -664,7 +664,7 @@ public override DynamicMetaObject FallbackSetMember( // calls for invoking members. // public class SymplInvokeMemberBinder : InvokeMemberBinder { - public SymplInvokeMemberBinder(string name, CallInfo callinfo) + public SymplInvokeMemberBinder(string name, CallInfo callinfo) : base(name, true, callinfo) { // true = ignoreCase } @@ -710,7 +710,7 @@ public override DynamicMetaObject FallbackInvokeMember( Where(m => m.MemberType == MemberTypes.Method && ((MethodInfo)m).GetParameters().Length == args.Length); // Get MethodInfos with param types that work for args. This works - // except for value args that need to pass to reftype params. + // except for value args that need to pass to reftype params. // We could detect that to be smarter and then explicitly StrongBox // the args. List res = new List(); @@ -737,8 +737,8 @@ public override DynamicMetaObject FallbackInvokeMember( return new DynamicMetaObject( RuntimeHelpers.EnsureObjectResult( Expression.Call( - Expression.Convert(targetMO.Expression, - targetMO.LimitType), + Expression.Convert(targetMO.Expression, + targetMO.LimitType), res[0], callArgs)), restrictions); // Could hve tried just letting Expr.Call factory do the work, @@ -813,7 +813,7 @@ public override DynamicMetaObject FallbackInvoke( } return errorSuggestion ?? RuntimeHelpers.CreateThrow( - targetMO, argMOs, + targetMO, argMOs, BindingRestrictions.GetTypeRestriction(targetMO.Expression, targetMO.LimitType), typeof(InvalidOperationException), @@ -849,7 +849,7 @@ public override DynamicMetaObject FallbackCreateInstance( RuntimeHelpers.CreateThrow( target, args, BindingRestrictions.Empty, typeof(InvalidOperationException), - "Type object must be used when creating instance -- " + + "Type object must be used when creating instance -- " + args.ToString()); } var type = target.Value as Type; @@ -917,7 +917,7 @@ public override DynamicMetaObject FallbackGetIndex( RuntimeHelpers.CreateThrow( target, indexes, BindingRestrictions.Empty, typeof(InvalidOperationException), - "Indexing list takes single index. " + "Got " + + "Indexing list takes single index. " + "Got " + indexes.Length.ToString()); } // Find our own binding. @@ -1009,7 +1009,7 @@ public override DynamicMetaObject FallbackSetIndex( } } - + public class SymplBinaryOperationBinder : BinaryOperationBinder { public SymplBinaryOperationBinder(ExpressionType operation) : base(operation) { @@ -1090,7 +1090,7 @@ public override string ToString() public string Name { get { return _name; } - // C# forces property set and assignments to return void, + // C# forces property set and assignments to return void, // so need to code gen explicit value return. set { _name = value; } } @@ -1098,7 +1098,7 @@ public string Name public object Value { get { return _value; } - // C# forces property set and assignments to return void, + // C# forces property set and assignments to return void, // so need to code gen explicit value return. set { _value = value; } } @@ -1146,14 +1146,14 @@ public override string ToString() { public object First { get { return _first; } - // C# forces property set and assignments to return void, + // C# forces property set and assignments to return void, // so need to code gen explicit value return. set { _first = value; } } public object Rest { get { return _rest; } - // C# forces property set and assignments to return void, + // C# forces property set and assignments to return void, // so need to code gen explicit value return. set { _rest = value; } } diff --git a/Microsoft/Samples/sympl/csharp/Sympl.cs b/Microsoft/Samples/sympl/csharp/Sympl.cs index 1edc3f57..eaa4e1fc 100644 --- a/Microsoft/Samples/sympl/csharp/Sympl.cs +++ b/Microsoft/Samples/sympl/csharp/Sympl.cs @@ -4,7 +4,7 @@ using System.Linq.Expressions; using System.Linq; -using Scope = Microsoft.Scripting.Runtime.Scope; +using Scope = Riverside.Scripting.Runtime.Scope; using System.Reflection; using System.IO; @@ -18,7 +18,7 @@ public class Sympl { private IList _assemblies; private ExpandoObject _globals = new ExpandoObject(); private Scope _dlrGlobals; - private Dictionary Symbols = + private Dictionary Symbols = new Dictionary(); public Sympl(IList assms, Scope dlrGlobals) { @@ -87,7 +87,7 @@ public void ExecuteFileInScope(string filename, var f = new StreamReader(filename); // Simple way to convey script rundir for RuntimeHelpes.SymplImport // to load .sympl files. - DynamicObjectHelpers.SetMember(moduleEO, "__file__", + DynamicObjectHelpers.SetMember(moduleEO, "__file__", Path.GetFullPath(filename)); try { var moduleFun = ParseFileToLambda(filename, f); @@ -160,7 +160,7 @@ internal Expression> public static ExpandoObject CreateScope() { return new ExpandoObject(); } - + // Symbol returns the Symbol interned in this runtime if it is already // there. If not, this makes the Symbol and interns it. // @@ -248,7 +248,7 @@ public SymplInvokeMemberBinder GetInvokeMemberBinder } } - private Dictionary + private Dictionary _createInstanceBinders = new Dictionary(); public SymplCreateInstanceBinder GetCreateInstanceBinder(CallInfo info) { @@ -322,7 +322,7 @@ public SymplUnaryOperationBinder GetUnaryOperationBinder public class InvokeMemberBinderKey { string _name; CallInfo _info; - + public InvokeMemberBinderKey(string name, CallInfo info) { _name = name; _info = info; @@ -388,7 +388,7 @@ public TypeModelMetaObject(Expression objParam, TypeModel typeModel) } public override DynamicMetaObject BindGetMember(GetMemberBinder binder) { - var flags = BindingFlags.IgnoreCase | BindingFlags.Static | + var flags = BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.Public; // consider BindingFlags.Instance if want to return wrapper for // inst members that is callable. @@ -425,7 +425,7 @@ public override DynamicMetaObject BindInvokeMember( var flags = BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.Public; var members = ReflType.GetMember(binder.Name, flags); - if ((members.Length == 1) && (members[0] is PropertyInfo || + if ((members.Length == 1) && (members[0] is PropertyInfo || members[0] is FieldInfo)){ // NEED TO TEST, should check for delegate value too var mem = members[0]; @@ -446,7 +446,7 @@ public override DynamicMetaObject BindInvokeMember( ((MethodInfo)m).GetParameters().Length == args.Length); // Get MethodInfos with param types that work for args. This works - // for except for value args that need to pass to reftype params. + // for except for value args that need to pass to reftype params. // We could detect that to be smarter and then explicitly StrongBox // the args. List res = new List(); @@ -470,7 +470,7 @@ public override DynamicMetaObject BindInvokeMember( var restrictions = RuntimeHelpers.GetTargetArgsRestrictions( this, args, true); // restrictions and conversion must be done consistently. - var callArgs = + var callArgs = RuntimeHelpers.ConvertArguments( args, res[0].GetParameters()); return new DynamicMetaObject( @@ -504,7 +504,7 @@ public override DynamicMetaObject BindCreateInstance( RuntimeHelpers.GetRuntimeTypeMoFromModel(this), args); } - // For create instance of a TypeModel, we can create a instance + // For create instance of a TypeModel, we can create a instance // restriction on the MO, hence the true arg. var restrictions = RuntimeHelpers.GetTargetArgsRestrictions( this, args, true); @@ -517,4 +517,4 @@ public override DynamicMetaObject BindCreateInstance( restrictions); } }//TypeModelMetaObject -} \ No newline at end of file +} diff --git a/Microsoft/Samples/sympl/csharp/sympl.csproj b/Microsoft/Samples/sympl/csharp/sympl.csproj index 77bd3797..5db57512 100644 --- a/Microsoft/Samples/sympl/csharp/sympl.csproj +++ b/Microsoft/Samples/sympl/csharp/sympl.csproj @@ -68,14 +68,14 @@ {7F6984B4-EE6D-4E6F-ABB1-E210D7DC4FDD} Ruby %28Languages\Ruby\Ruby%29 - + {EB66B766-6354-4208-A3D4-AACBDCB5C3B3} - Microsoft.Dynamic + Riverside.Dynamic - + {02FF0909-F5AD-48CF-A86A-345E721B7E40} - Microsoft.Scripting + Riverside.Scripting - \ No newline at end of file + diff --git a/Microsoft/Samples/sympl/python/etgen.py b/Microsoft/Samples/sympl/python/etgen.py index 6ea7c625..d1e55e70 100644 --- a/Microsoft/Samples/sympl/python/etgen.py +++ b/Microsoft/Samples/sympl/python/etgen.py @@ -1,8 +1,8 @@ import clr if clr.use35: - clr.AddReference("Microsoft.Scripting.Core") - import Microsoft.Scripting.Ast as Exprs + clr.AddReference("Riverside.Scripting.Core") + import Riverside.Scripting.Ast as Exprs else: clr.AddReference("System.Core") import System.Linq.Expressions as Exprs @@ -96,9 +96,9 @@ def AnalyzeDefunExpr (expr, scope): raise Exception("Use Defmethod or Lambda when not defining " + "top-level function.") return Exprs.Expression.Dynamic( - scope.GetRuntime().GetSetMemberBinder(expr.Name.Name), + scope.GetRuntime().GetSetMemberBinder(expr.Name.Name), object, - [scope.ModuleExpr, + [scope.ModuleExpr, AnalyzeLambdaDef(expr, scope, "defun " + expr.Name.Name)]) def AnalyzeLambdaExpr (expr, scope): @@ -217,7 +217,7 @@ def AnalyzeAssignExpr (expr, scope): Exprs.Expression.Convert(val, object)), Exprs.Expression.Dynamic( scope.GetRuntime().GetSetMemberBinder( - expr.Location.IdToken.Name), + expr.Location.IdToken.Name), object, [scope.GetModuleExpr(), tmp]), tmp]) @@ -227,7 +227,7 @@ def AnalyzeAssignExpr (expr, scope): args.append(AnalyzeExpr(expr.Value, scope)) return Exprs.Expression.Dynamic( scope.GetRuntime().GetSetIndexBinder( - CallInfo(len(expr.Location.Indexes))), + CallInfo(len(expr.Location.Indexes))), object, [obj] + args) elif loctype is parser.SymplDottedExpr: @@ -269,7 +269,7 @@ def AnalyzeIdExpr (expr, scope): return param else: return Exprs.Expression.Dynamic( - scope.GetRuntime().GetGetMemberBinder(expr.IdToken.Name), + scope.GetRuntime().GetGetMemberBinder(expr.IdToken.Name), object, scope.GetModuleExpr()) @@ -305,7 +305,7 @@ def AnalyzeLetStarExpr (expr, scope): var = Exprs.Expression.Parameter(object, b[0].Name) varsInOrder.append(var) inits.append(Exprs.Expression.Assign( - var, + var, Exprs.Expression.Convert(AnalyzeExpr(b[1], letscope), var.Type))) ## Add var to scope after analyzing init value so that init value @@ -363,14 +363,14 @@ def AnalyzeEqExpr (expr, scope): raise Exception("Internal: need eq expr to analyze.") return runtime.MakeSymplEqCall(AnalyzeExpr(expr.Left, scope), AnalyzeExpr(expr.Right, scope)) - + def AnalyzeConsExpr (expr, scope): debugprint("analyze cons ...") if type(expr) is not parser.SymplConsExpr: raise Exception("Internal: need cons expr to analyze.") return runtime.MakeSymplConsCall(AnalyzeExpr(expr.Left, scope), AnalyzeExpr(expr.Right, scope)) - + def AnalyzeListCallExpr (expr, scope): debugprint("analyze List call ...") if type(expr) is not parser.SymplListCallExpr: @@ -391,14 +391,14 @@ def AnalyzeIfExpr (expr, scope): Exprs.Expression.Convert(AnalyzeExpr(expr.Consequent, scope), object), Exprs.Expression.Convert(alt, object)) - + def WrapBooleanTest (expr): tmp = Exprs.Expression.Parameter(object, "testtmp") return Exprs.Expression.Block( [tmp], [Exprs.Expression.Assign(tmp, Exprs.Expression.Convert(expr, object)), Exprs.Expression.Condition( - Exprs.Expression.TypeIs(tmp, bool), + Exprs.Expression.TypeIs(tmp, bool), Exprs.Expression.Convert(tmp, bool), Exprs.Expression.NotEqual(tmp, Exprs.Expression.Constant(None)))]) @@ -417,7 +417,7 @@ def AnalyzeLoopExpr (expr, scope): ## with Type and IEnumerable, so pick it explicitly. return Exprs.Expression.Loop(Exprs.Expression.Block.Overloads [System.Type, IEnumerable[Exprs.Expression]] - (object, body), + (object, body), loopscope.LoopBreak) def AnalyzeBreakExpr (expr, scope): @@ -509,7 +509,7 @@ def AnalyzeBinaryExpr (expr, scope): object, AnalyzeExpr(expr.Left, scope), AnalyzeExpr(expr.Right, scope)) - + def AnalyzeUnaryExpr (expr, scope): if type(expr) is not parser.SymplUnaryExpr: @@ -525,7 +525,7 @@ def AnalyzeUnaryExpr (expr, scope): scope.GetRuntime().GetUnaryOperationBinder(expr.Op), object, AnalyzeExpr(expr.Operand, scope)) - + @@ -552,7 +552,7 @@ def __init__ (self, parent, nam = "", runtime = None, runtimeParam = None, self.IsLoop = False self.LoopBreak = None self.LoopContinue = None - + def IsModule (self): return self.ModuleExpr is not None diff --git a/Microsoft/Samples/sympl/python/parser.py b/Microsoft/Samples/sympl/python/parser.py index 6271ed62..216686aa 100644 --- a/Microsoft/Samples/sympl/python/parser.py +++ b/Microsoft/Samples/sympl/python/parser.py @@ -4,8 +4,8 @@ ### Only needed for _getOpKind import clr if clr.use35: - clr.AddReference("Microsoft.Scripting.Core") - from Microsoft.Scripting.Ast import ExpressionType + clr.AddReference("Riverside.Scripting.Core") + from Riverside.Scripting.Ast import ExpressionType else: clr.AddReference("System.Core") from System.Linq.Expressions import ExpressionType @@ -52,7 +52,7 @@ def _parseExpr (lexr): if (token.IsKeywordToken and token not in [lexer.KeywordToken.Nil, lexer.KeywordToken.True, lexer.KeywordToken.False]): - raise Exception("Keyword cannot be an expression: " + + raise Exception("Keyword cannot be an expression: " + token.Name) else: res = SymplIdExpr(token) @@ -66,7 +66,7 @@ def _parseExpr (lexr): return _parseDottedExpr(lexr, res) else: return res - raise Exception("Unexpected token when expecting "+ + raise Exception("Unexpected token when expecting "+ "beginning of expression -- " + str(token) + " ... " + repr([lexr.GetToken(), lexr.GetToken(), lexr.GetToken(), lexr.GetToken(), @@ -98,7 +98,7 @@ def _parseForm (lexr): else: lexr.PutToken(token) return _parseFunctionCall(lexr) - + ## What else could start a function call? Any Expr? #raise Exception("Sympl form must have ID or keyword as first element." + # " Got " + str(token)) @@ -143,7 +143,7 @@ def _parseKeywordForm (lexr): elif (name is lexer.KeywordToken.Add or name is lexer.KeywordToken.Subtract or name is lexer.KeywordToken.Multiply or name is lexer.KeywordToken.Divide or name is lexer.KeywordToken.Equal or name is lexer.KeywordToken.NotEqual or - name is lexer.KeywordToken.GreaterThan or + name is lexer.KeywordToken.GreaterThan or name is lexer.KeywordToken.LessThan or name is lexer.KeywordToken.And or name is lexer.KeywordToken.Or): return _parseExprTreeBinaryOp(lexr) @@ -243,7 +243,7 @@ def _parseImportNameOrModule (lexr): def _parseImportNames (lexr, nameKinds, allowKeywords): token = lexr.GetToken() debugprint("IN parseimport: " + str(token)) - if (isinstance(token, lexer.IdOrKeywordToken) and + if (isinstance(token, lexer.IdOrKeywordToken) and not token.IsKeywordToken): names = [token] elif token is lexer.SyntaxToken.Paren: @@ -361,8 +361,8 @@ def _parseBlock (lexr): ### member and call, which the runtime binder decides). The non-dotted expr ### simply evals to an object that better be callable with the supplied args, ### which may be none. -### -def _parseFunctionCall (lexr): +### +def _parseFunctionCall (lexr): debugprint("IN parse fun call:") ## First sub expr is callable object or invoke member expr. fun = _parseExpr(lexr) @@ -399,7 +399,7 @@ def _parseEq (lexr): raise Exception("Internal: parsing Eq?") left, right = _parseBinaryRuntimeCall(lexr) return SymplEqExpr(left, right) - + def _parseCons (lexr): token = lexr.GetToken() if token is not lexer.KeywordToken.Cons: @@ -439,7 +439,7 @@ def _parseIf (lexr): return SymplIfExpr(args[0], args[1], args[2]) else: raise Exception("IF must be (if []).") - + ### _parseLoop parses a loop expression, a sequence of exprs to ### execute in order, forever. See Break for returning expression's value. ### @@ -474,7 +474,7 @@ def _parseBreak (lexr): ### be used to specific concrete generic type instances. Without this support ### SymPL programmers need to open code this as the examples show. ### -def _parseNew (lexr): +def _parseNew (lexr): debugprint("IN new call:") token = lexr.GetToken() if token is not lexer.KeywordToken.New: @@ -491,7 +491,7 @@ def _parseElt (lexr): obj = _parseExpr(lexr) indexes = _parseBody(lexr, "Unexpected EOF in arg list for call to Elt.") return SymplEltExpr(obj, indexes) - + ### _parseExprTreeBinaryOp handles operators that map to ET node kinds, but it ### doesn't handle Eq. We could fold that in here, but it is harder to do in C#. @@ -501,7 +501,7 @@ def _parseExprTreeBinaryOp (lexr): if (token is lexer.KeywordToken.Add or token is lexer.KeywordToken.Subtract or token is lexer.KeywordToken.Multiply or token is lexer.KeywordToken.Divide or token is lexer.KeywordToken.Equal or token is lexer.KeywordToken.NotEqual or - token is lexer.KeywordToken.GreaterThan or + token is lexer.KeywordToken.GreaterThan or token is lexer.KeywordToken.LessThan or token is lexer.KeywordToken.And or token is lexer.KeywordToken.Or): pass diff --git a/Microsoft/Samples/sympl/python/runtime.py b/Microsoft/Samples/sympl/python/runtime.py index b980a162..d44ed667 100644 --- a/Microsoft/Samples/sympl/python/runtime.py +++ b/Microsoft/Samples/sympl/python/runtime.py @@ -2,19 +2,19 @@ import clr if clr.use35: - clr.AddReference("Microsoft.Scripting") - clr.AddReference("Microsoft.Dynamic") - clr.AddReference("Microsoft.Scripting.Core") + clr.AddReference("Riverside.Scripting") + clr.AddReference("Riverside.Dynamic") + clr.AddReference("Riverside.Scripting.Core") - import Microsoft.Scripting.Ast as Exprs - from Microsoft.Scripting.ComInterop import ComBinder - from Microsoft.Scripting.Utils import (Action, Func) + import Riverside.Scripting.Ast as Exprs + from Riverside.Scripting.ComInterop import ComBinder + from Riverside.Scripting.Utils import (Action, Func) else: clr.AddReference("System.Core") - clr.AddReference("Microsoft.Dynamic") - + clr.AddReference("Riverside.Dynamic") + import System.Linq.Expressions as Exprs - from Microsoft.Scripting.ComInterop import ComBinder + from Riverside.Scripting.ComInterop import ComBinder from System import (Action, Func) from System.Runtime.CompilerServices import CallSite @@ -22,7 +22,7 @@ GetMemberBinder, SetMemberBinder, CallInfo, BindingRestrictions, IDynamicMetaObjectProvider, InvokeMemberBinder, CreateInstanceBinder, - GetIndexBinder, SetIndexBinder, + GetIndexBinder, SetIndexBinder, BinaryOperationBinder, UnaryOperationBinder) from System import (MissingMemberException, @@ -97,7 +97,7 @@ def MakeCons (x, y): @staticmethod def GetConsElt (lst, i): return RuntimeHelpers._nthcdr(lst, i).First - + @staticmethod def SetConsElt (lst, i, value): lst = RuntimeHelpers._nthcdr(lst, i) @@ -222,7 +222,7 @@ def GetTargetArgsRestrictions (targetMO, argMOs, targetInst): BindingRestrictions.GetTypeRestriction( targetMO.Expression, targetMO.LimitType)) - + for a in argMOs: if a.HasValue and a.Value is None: r = BindingRestrictions.GetInstanceRestriction(a.Expression, @@ -346,7 +346,7 @@ def GetIndexExpression (targetMO, indexMOs): Exprs.Expression.Constant( "Can't find matching indexer property."))) return Exprs.Expression.MakeIndex( - Exprs.Expression.Convert(targetMO.Expression, + Exprs.Expression.Convert(targetMO.Expression, targetMO.LimitType), res[0], indexExprs) @@ -395,7 +395,7 @@ def EnsureObjectResult (expr): ############################## -### Type model IDynObj wrapper +### Type model IDynObj wrapper ############################## ### TypeModel wraps System.Runtimetypes. When Sympl code encounters @@ -408,7 +408,7 @@ def __init__ (self, typ): ## Note, need to check for initialized members in GetMetaObject so ## that creating TypeModel's works without using our custom MO. self.ReflType = typ - + ### GetMetaObject needs to wrap the base IDO due to Python's objects all ### being IDOs. While this GetMetaObject definition is on the stack IPy ### ensures Ipy uses its own MO for TypeModel instances. However, when @@ -506,7 +506,7 @@ def BindInvokeMember (self, binder, args): # object, # ([Exprs.MakeMemberAccess(self.Expression, mem)] + # (x.Expression for x in args)))) - + ## Don't test for eventinfos since we do nothing with them now. else: ## Get MethodInfos with right arg count. @@ -540,16 +540,16 @@ def BindInvokeMember (self, binder, args): ## there is more than one applicable method using just ## assignablefrom, Expr.Call flames out. It does not pick a "most ## applicable" method. - + ## Defer to IPy binding to invoke TypeModel instance members. IPy ## will fallback to the binder as appropriate. ##return binder.FallbackInvokeMember(self) ##return self.BaseIDOMO.BindInvokeMember(binder, args) - + def BindCreateInstance (self, binder, args): ctors = self.ReflType.GetConstructors() ## Get constructors with right arg count. - ctors = [x for x in ctors + ctors = [x for x in ctors if len(x.GetParameters()) == len(args)] res = [] for mem in ctors: @@ -571,31 +571,31 @@ def BindCreateInstance (self, binder, args): ### ### Bindings I don't care about, so defer to Pythons IDO ### - + def BindConvert (self, binder): return self.BaseIDOMO.BindConvert(binder) - + def BindSetMember (self, binder, valueMO): return self.BaseIDOMO.BindSetMember(binder, valueMO) - + def BindDeleteMember (self, binder): return self.BaseIDOMO.BindDeleteMember(binder) def BindGetIndex (self, binder, indexes): return self.BaseIDOMO.BindGetIndex (binder, indexes) - + def BindSetIndex (self, binder, indexes, value): return self.BaseIDOMO.BindSetIndex (binder, indexes, value) - + def BindDeleteIndex (self, binder, indexes): return self.BaseIDOMO.BindDeleteIndex (binder, indexes) - + def BindInvoke (self, binder, args): return self.BaseIDOMO.BindInvoke (binder, args) - + def BindUnaryOperation (self, binder): return self.BaseIDOMO.BindUnaryOperation (binder) - + def BindBinaryOperation (self, binder, arg): return self.BaseIDOMO.BindBinaryOperation (binder, arg) @@ -709,12 +709,12 @@ def __new__ (cls, name): return SetMemberBinder.__new__(cls, name, True) def FallbackSetMember(self, targetMO, valueMO, errorSuggestionMO): - return (errorSuggestionMO or + return (errorSuggestionMO or CreateThrow( targetMO, None, BindingRestrictions.Empty, MissingMemberException, ## General msg: Sympl doesn't override IDOs to set members. - "If IDynObj doesn't support setting members, " + + "If IDynObj doesn't support setting members, " + "DOHelpers can't do it for the IDO.")) ## Don't need Equals override or GetHashCode because there is no more @@ -722,7 +722,7 @@ def FallbackSetMember(self, targetMO, valueMO, errorSuggestionMO): ## already compare. #def GetHashCode (self): # pass - # + # #def Equals (self, obj): # return (isinstance(obj, DOHelpersSetMemberBinder) and # super(DOHelpersSetMemberBinder, self).Equals(obj)) @@ -776,11 +776,11 @@ def FallbackGetMember(self, targetMO, errorSuggestionMO): if errorSuggestionMO is not None: return errorSuggestionMO return CreateThrow( - targetMO, None, + targetMO, None, BindingRestrictions.GetTypeRestriction( targetMO.Expression, targetMO.LimitType), MissingMemberException, - "Object " + str(targetMO.Value) + + "Object " + str(targetMO.Value) + " does not have member " + self.Name) @@ -826,7 +826,7 @@ def FallbackSetMember(self, targetMO, valueMO, errorSuggestionMO): else: return (errorSuggestionMO or CreateThrow( - targetMO, None, + targetMO, None, BindingRestrictions.GetTypeRestriction( targetMO.Expression, targetMO.LimitType), InvalidOperationException, @@ -850,7 +850,7 @@ def FallbackSetMember(self, targetMO, valueMO, errorSuggestionMO): if errorSuggestionMO is not None: return errorSuggestionMO return CreateThrow( - targetMO, None, + targetMO, None, BindingRestrictions.GetTypeRestriction( targetMO.Expression, targetMO.LimitType), MissingMemberException, @@ -889,7 +889,7 @@ def FallbackInvokeMember (self, targetMO, argMOs, errorSuggestionMO): # object, # ([Exprs.MakeMemberAccess(self.Expression, mem)] + # (x.Expression for x in args)))) - + ## Don't test for eventinfos since we do nothing with them now. else: ## Get MethodInfos with right arg count. @@ -946,17 +946,17 @@ class InvokeMemberBinderKey (object): def __init__ (self, name, info): self._name = name self._info = info - + def _getName (self): return self._name Name = property(_getName) def _getInfo (self): return self._info Info = property(_getInfo) - + def __eq__ (self, obj): #def Equals (self, obj): return ((obj is not None) and (obj.Name == self._name) and obj.Info.Equals(self._info)) - + def __hash__ (self): #def GetHashCode (self): return 0x28000000 ^ self._name.GetHashCode() ^ self._info.GetHashCode() @@ -996,7 +996,7 @@ def FallbackInvoke (self, targetMO, argMOs, errorSuggestionMO): targetMO.Expression, targetMO.LimitType)) return (errorSuggestionMO or CreateThrow( - targetMO, argMOs, + targetMO, argMOs, BindingRestrictions.GetTypeRestriction( targetMO.Expression, targetMO.LimitType), InvalidOperationException, @@ -1025,10 +1025,10 @@ def FallbackCreateInstance (self, targetMO, argMOs, errorSuggestionMO): ("Type object must be used when creating instance -- " + repr(targetMO)))) ## Get constructors with right arg count. - ctors = [x for x in targetMO.Value.GetConstructors() + ctors = [x for x in targetMO.Value.GetConstructors() if len(x.GetParameters()) == len(argMOs)] ## Get ctors with param types that work for args. This works - ## for except for value args that need to pass to reftype params. + ## for except for value args that need to pass to reftype params. ## We could detect that to be smarter and then explicitly StrongBox ## the args. res = [] @@ -1099,11 +1099,11 @@ def FallbackSetIndex (self, targetMO, argMOs, valueMO, errorSuggestionMO): return com ## Find our own binding. First setup value. valueExpr = valueMO.Expression - if type(valueMO.Value) is TypeModel: + if type(valueMO.Value) is TypeModel: ## Don't use LimitType to compare py type objs, use the value. valueExpr = GetRuntimeTypeMoFromModel(valueMO).Expression ## Check Cons vs. normal - if type(targetMO.Value) is Cons: + if type(targetMO.Value) is Cons: ## Don't use LimitType to compare py type objs, use the value. if len(argMOs) != 1: return (errorSuggestionMO or @@ -1131,7 +1131,7 @@ def FallbackSetIndex (self, targetMO, argMOs, valueMO, errorSuggestionMO): ## False means make type restriction on targetMO.LimitType restrictions = GetTargetArgsRestrictions(targetMO, argMOs, False) return DynamicMetaObject(setIndexExpr, restrictions) - + class SymplBinaryOperationBinder (BinaryOperationBinder): diff --git a/Microsoft/Samples/sympl/python/sympl.py b/Microsoft/Samples/sympl/python/sympl.py index 0989c8fd..ba1bae58 100644 --- a/Microsoft/Samples/sympl/python/sympl.py +++ b/Microsoft/Samples/sympl/python/sympl.py @@ -7,8 +7,8 @@ clr.use35 = False if clr.use35: - clr.AddReference("Microsoft.Scripting.Core") - import Microsoft.Scripting.Ast as Exprs + clr.AddReference("Riverside.Scripting.Core") + import Riverside.Scripting.Ast as Exprs else: clr.AddReference("System.Core") import System.Linq.Expressions as Exprs @@ -80,7 +80,7 @@ def _addNamespacesAndTypes (self): helpers.SetMember(table, ns, tmp) table = tmp helpers.SetMember(table, names[-1], runtime.TypeModel(typ)) - + def __setattr__ (self, name, value): if name != "_assemblies": object.__setattr__(self, name, value) @@ -91,7 +91,7 @@ def __setattr__ (self, name, value): dbgascope = None dbgbody = None dbgmodfun = None - + ### ExecuteFile executes the file in a new module scope and stores the ### scope on Globals, using either the provided name, globalVar, or the ### file's base name. This function returns the module scope. @@ -104,7 +104,7 @@ def ExecuteFile (self, filename, globalVar = None): runtime.DynamicObjectHelpers.SetMember(self.Globals, globalVar, moduleEO) return moduleEO - + ### ExecuteFileInScope executes the file in the given module scope. This ### does NOT store the module scope on Globals. This function returns ### nothing. @@ -112,7 +112,7 @@ def ExecuteFile (self, filename, globalVar = None): def ExecuteFileInScope (self, filename, moduleEO): try: f = StreamReader(filename) - runtime.DynamicObjectHelpers.SetMember(moduleEO, "__file__", + runtime.DynamicObjectHelpers.SetMember(moduleEO, "__file__", Path.GetFullPath(filename)) ASTs = parser.ParseFile(f) self.dbgASTs = ASTs @@ -139,7 +139,7 @@ def ExecuteFileInScope (self, filename, moduleEO): modulefun.Compile()(self, moduleEO) finally: f.Close() - + def ExecuteExpr (self, expr_str, moduleEO): f = StringReader(expr_str) ASTs = parser.ParseExpr(f) @@ -165,7 +165,7 @@ def ExecuteExpr (self, expr_str, moduleEO): scope.ModuleExpr) dbgmodfun = fun return fun.Compile()(self, moduleEO) - + def CreateScope (self): return ExpandoObject() @@ -206,7 +206,7 @@ def GetGetMemberBinder (self, name): b = runtime.SymplGetMemberBinder(name) self._getMemberBinders[name] = b return b - + def GetSetMemberBinder (self, name): ## Don't lower the name. Sympl is case-preserving in the metadata ## in case some DynamicMetaObject ignores ignoreCase. This makes @@ -226,7 +226,7 @@ def GetInvokeBinder (self, info): b = runtime.SymplInvokeBinder(info) self._invokeBinders[info] = b return b - + def GetInvokeMemberBinder (self, info): with self._lock: if self._invokeMemberBinders.ContainsKey(info): @@ -234,7 +234,7 @@ def GetInvokeMemberBinder (self, info): b = runtime.SymplInvokeMemberBinder(info.Name, info.Info) self._invokeMemberBinders[info] = b return b - + def GetCreateInstanceBinder (self, info): with self._lock: if self._createInstanceBinders.ContainsKey(info): @@ -242,7 +242,7 @@ def GetCreateInstanceBinder (self, info): b = runtime.SymplCreateInstanceBinder(info) self._createInstanceBinders[info] = b return b - + def GetGetIndexBinder (self, info): with self._lock: if self._getIndexBinders.ContainsKey(info): @@ -250,7 +250,7 @@ def GetGetIndexBinder (self, info): b = runtime.SymplGetIndexBinder(info) self._getIndexBinders[info] = b return b - + def GetSetIndexBinder (self, info): with self._lock: if self._setIndexBinders.ContainsKey(info): @@ -258,7 +258,7 @@ def GetSetIndexBinder (self, info): b = runtime.SymplSetIndexBinder(info) self._setIndexBinders[info] = b return b - + def GetBinaryOperationBinder (self, op): with self._lock: if self._binaryOperationBinders.ContainsKey(op): @@ -266,7 +266,7 @@ def GetBinaryOperationBinder (self, op): b = runtime.SymplBinaryOperationBinder(op) self._binaryOperationBinders[op] = b return b - + def GetUnaryOperationBinder (self, op): with self._lock: if self._unaryOperationBinders.ContainsKey(op): @@ -274,8 +274,8 @@ def GetUnaryOperationBinder (self, op): b = runtime.SymplUnaryOperationBinder(op) self._unaryOperationBinders[op] = b return b - - + + ################## ### Dev-time Utils @@ -287,4 +287,4 @@ def debugprint (*stuff): for x in stuff: print x, print - + diff --git a/Scripting/ArgumentTypeException.cs b/Scripting/ArgumentTypeException.cs index 9fd25a2d..f257e88e 100644 --- a/Scripting/ArgumentTypeException.cs +++ b/Scripting/ArgumentTypeException.cs @@ -5,7 +5,7 @@ using System; using System.Runtime.Serialization; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { [Serializable] public class ArgumentTypeException : Exception { public ArgumentTypeException() diff --git a/Scripting/AssemblyLoadedEventArgs.cs b/Scripting/AssemblyLoadedEventArgs.cs index 8f816c2c..112d4542 100644 --- a/Scripting/AssemblyLoadedEventArgs.cs +++ b/Scripting/AssemblyLoadedEventArgs.cs @@ -7,7 +7,7 @@ using System.Text; using System.Reflection; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { public class AssemblyLoadedEventArgs : EventArgs { public AssemblyLoadedEventArgs(Assembly assembly) { Assembly = assembly; diff --git a/Scripting/CompilerOptions.cs b/Scripting/CompilerOptions.cs index f694f91b..b531174c 100644 --- a/Scripting/CompilerOptions.cs +++ b/Scripting/CompilerOptions.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// Class that represents compiler options. diff --git a/Scripting/ErrorSink.cs b/Scripting/ErrorSink.cs index 090267b0..6d3e2dbe 100644 --- a/Scripting/ErrorSink.cs +++ b/Scripting/ErrorSink.cs @@ -3,9 +3,9 @@ // See the LICENSE file in the project root for more information. using System.Threading; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { public class ErrorSink { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] @@ -65,7 +65,7 @@ public bool AnyError { } } - public ErrorCounter() + public ErrorCounter() : this(ErrorSink.Null) { } @@ -73,7 +73,7 @@ public ErrorCounter(ErrorSink/*!*/ sink) { ContractUtils.RequiresNotNull(sink, nameof(sink)); _sink = sink; } - + protected virtual void CountError(Severity severity) { if (severity == Severity.FatalError) Interlocked.Increment(ref _fatalErrorCount); else if (severity == Severity.Error) Interlocked.Increment(ref _errorCount); diff --git a/Scripting/GlobalSuppressions.cs b/Scripting/GlobalSuppressions.cs index def0ef0f..7c5394a2 100644 --- a/Scripting/GlobalSuppressions.cs +++ b/Scripting/GlobalSuppressions.cs @@ -1,12 +1,12 @@ -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. -// Project-level suppressions either have no target or are given -// a specific target and scoped to a namespace, type, member, etc. +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. // -// To add a suppression to this file, right-click the message in the -// Error List, point to "Suppress Message(s)", and click -// "In Project Suppression File". -// You do not need to add suppressions to this file manually. +// To add a suppression to this file, right-click the message in the +// Error List, point to "Suppress Message(s)", and click +// "In Project Suppression File". +// You do not need to add suppressions to this file manually. -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Scripting.Hosting.Providers")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Scripting.Utils")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Riverside.Scripting.Hosting.Providers")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Riverside.Scripting.Utils")] diff --git a/Scripting/Hosting/CompiledCode.cs b/Scripting/Hosting/CompiledCode.cs index e0080226..407c2ee3 100644 --- a/Scripting/Hosting/CompiledCode.cs +++ b/Scripting/Hosting/CompiledCode.cs @@ -11,9 +11,9 @@ using System; using System.Threading; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// /// Hosting API counterpart for . @@ -44,7 +44,7 @@ public ScriptScope DefaultScope { if (_defaultScope == null) { Interlocked.CompareExchange(ref _defaultScope, new ScriptScope(Engine, ScriptCode.CreateScope()), null); } - return _defaultScope; + return _defaultScope; } } @@ -81,7 +81,7 @@ public T Execute(ScriptScope scope) { #if FEATURE_REMOTING /// /// Executes the code in an empty scope. - /// Returns an ObjectHandle wrapping the resulting value of running the code. + /// Returns an ObjectHandle wrapping the resulting value of running the code. /// public ObjectHandle ExecuteAndWrap() { return new ObjectHandle((object)Execute()); @@ -89,7 +89,7 @@ public ObjectHandle ExecuteAndWrap() { /// /// Executes the code in the specified scope. - /// Returns an ObjectHandle wrapping the resulting value of running the code. + /// Returns an ObjectHandle wrapping the resulting value of running the code. /// public ObjectHandle ExecuteAndWrap(ScriptScope scope) { return new ObjectHandle((object)Execute(scope)); @@ -97,13 +97,13 @@ public ObjectHandle ExecuteAndWrap(ScriptScope scope) { /// /// Executes the code in an empty scope. - /// Returns an ObjectHandle wrapping the resulting value of running the code. - /// + /// Returns an ObjectHandle wrapping the resulting value of running the code. + /// /// If an exception is thrown the exception is caught and an ObjectHandle to /// the exception is provided. /// /// - /// Use this API to handle non-serializable exceptions (exceptions might not be serializable due to security restrictions) + /// Use this API to handle non-serializable exceptions (exceptions might not be serializable due to security restrictions) /// or if an exception serialization loses information. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] @@ -119,13 +119,13 @@ public ObjectHandle ExecuteAndWrap(out ObjectHandle exception) { /// /// Executes the expression in the specified scope and return a result. - /// Returns an ObjectHandle wrapping the resulting value of running the code. - /// + /// Returns an ObjectHandle wrapping the resulting value of running the code. + /// /// If an exception is thrown the exception is caught and an ObjectHandle to /// the exception is provided. /// /// - /// Use this API to handle non-serializable exceptions (exceptions might not be serializable due to security restrictions) + /// Use this API to handle non-serializable exceptions (exceptions might not be serializable due to security restrictions) /// or if an exception serialization loses information. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] diff --git a/Scripting/Hosting/Configuration/LanguageElement.cs b/Scripting/Hosting/Configuration/LanguageElement.cs index 84dfcdfb..3db1d650 100644 --- a/Scripting/Hosting/Configuration/LanguageElement.cs +++ b/Scripting/Hosting/Configuration/LanguageElement.cs @@ -7,9 +7,9 @@ using System; using System.Configuration; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting.Configuration { +namespace Riverside.Scripting.Hosting.Configuration { // // diff --git a/Scripting/Hosting/Configuration/LanguageElementCollection.cs b/Scripting/Hosting/Configuration/LanguageElementCollection.cs index f2a7bc3a..0b12da93 100644 --- a/Scripting/Hosting/Configuration/LanguageElementCollection.cs +++ b/Scripting/Hosting/Configuration/LanguageElementCollection.cs @@ -6,7 +6,7 @@ using System.Configuration; -namespace Microsoft.Scripting.Hosting.Configuration { +namespace Riverside.Scripting.Hosting.Configuration { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface")] public class LanguageElementCollection : ConfigurationElementCollection { diff --git a/Scripting/Hosting/Configuration/OptionElement.cs b/Scripting/Hosting/Configuration/OptionElement.cs index ea5b9ce7..c4245057 100644 --- a/Scripting/Hosting/Configuration/OptionElement.cs +++ b/Scripting/Hosting/Configuration/OptionElement.cs @@ -7,9 +7,9 @@ using System; using System.Configuration; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Hosting.Configuration { +namespace Riverside.Scripting.Hosting.Configuration { public class OptionElement : ConfigurationElement { private const string _Option = "option"; diff --git a/Scripting/Hosting/Configuration/OptionElementCollection.cs b/Scripting/Hosting/Configuration/OptionElementCollection.cs index 4173225a..f1bec6b5 100644 --- a/Scripting/Hosting/Configuration/OptionElementCollection.cs +++ b/Scripting/Hosting/Configuration/OptionElementCollection.cs @@ -6,7 +6,7 @@ using System.Configuration; -namespace Microsoft.Scripting.Hosting.Configuration { +namespace Riverside.Scripting.Hosting.Configuration { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface")] public class OptionElementCollection : ConfigurationElementCollection { diff --git a/Scripting/Hosting/Configuration/Section.cs b/Scripting/Hosting/Configuration/Section.cs index 016951b1..5d6f6c6c 100644 --- a/Scripting/Hosting/Configuration/Section.cs +++ b/Scripting/Hosting/Configuration/Section.cs @@ -10,17 +10,17 @@ using System.IO; using System.Xml; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting.Configuration { +namespace Riverside.Scripting.Hosting.Configuration { // // - //
+ //
// // - // + // // // // @@ -31,10 +31,10 @@ namespace Microsoft.Scripting.Hosting.Configuration { // // // - // + // // public class Section : ConfigurationSection { - public static readonly string SectionName = "microsoft.scripting"; + public static readonly string SectionName = "Riverside.Scripting"; private const string _DebugMode = "debugMode"; private const string _PrivateBinding = "privateBinding"; @@ -42,10 +42,10 @@ public class Section : ConfigurationSection { private const string _Options = "options"; private static ConfigurationPropertyCollection _Properties = new ConfigurationPropertyCollection() { - new ConfigurationProperty(_DebugMode, typeof(bool?), null), - new ConfigurationProperty(_PrivateBinding, typeof(bool?), null), - new ConfigurationProperty(_Languages, typeof(LanguageElementCollection), null, ConfigurationPropertyOptions.IsDefaultCollection), - new ConfigurationProperty(_Options, typeof(OptionElementCollection), null), + new ConfigurationProperty(_DebugMode, typeof(bool?), null), + new ConfigurationProperty(_PrivateBinding, typeof(bool?), null), + new ConfigurationProperty(_Languages, typeof(LanguageElementCollection), null, ConfigurationPropertyOptions.IsDefaultCollection), + new ConfigurationProperty(_Options, typeof(OptionElementCollection), null), }; protected override ConfigurationPropertyCollection Properties => _Properties; diff --git a/Scripting/Hosting/DocumentationOperations.cs b/Scripting/Hosting/DocumentationOperations.cs index 52fa4d6d..6dcab76c 100644 --- a/Scripting/Hosting/DocumentationOperations.cs +++ b/Scripting/Hosting/DocumentationOperations.cs @@ -11,9 +11,9 @@ using System; using System.Collections.Generic; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Runtime; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// /// Provides documentation against live objects for use in a REPL window. /// @@ -23,7 +23,7 @@ public sealed class DocumentationOperations : MarshalByRefObject { internal DocumentationOperations(DocumentationProvider provider) { _provider = provider; } - + /// /// Gets the available members defined on the provided object. /// diff --git a/Scripting/Hosting/ErrorListener.cs b/Scripting/Hosting/ErrorListener.cs index e97d1bba..8d808794 100644 --- a/Scripting/Hosting/ErrorListener.cs +++ b/Scripting/Hosting/ErrorListener.cs @@ -10,7 +10,7 @@ using MarshalByRefObject = System.Object; #endif -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// /// The host can use this class to track for errors reported during script parsing and compilation. diff --git a/Scripting/Hosting/ErrorListenerProxy.cs b/Scripting/Hosting/ErrorListenerProxy.cs index d8422992..49bf3d15 100644 --- a/Scripting/Hosting/ErrorListenerProxy.cs +++ b/Scripting/Hosting/ErrorListenerProxy.cs @@ -2,18 +2,18 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// - /// Bridges ErrorSink and ErrorListener. + /// Bridges ErrorSink and ErrorListener. /// Errors reported by language compilers to ErrorSink are forwarded to the ErrorListener provided by the host. /// /// /// This proxy is created in the scenario when the compiler is processing a single SourceUnit. /// Therefore it could maintain one to one mapping from SourceUnit to ScriptSource. - /// In a case, which shouldn't happen, that the compiler reports an error in a different SourceUnit we just create - /// a new instance of the ScriptSource each time. - /// + /// In a case, which shouldn't happen, that the compiler reports an error in a different SourceUnit we just create + /// a new instance of the ScriptSource each time. + /// /// TODO: Consider compilation of multiple source units and creating a hashtable mapping SourceUnits to ScriptSources /// within the context of compilation unit. /// diff --git a/Scripting/Hosting/ErrorSinkProxyListener.cs b/Scripting/Hosting/ErrorSinkProxyListener.cs index 4bb32e68..d69dae06 100644 --- a/Scripting/Hosting/ErrorSinkProxyListener.cs +++ b/Scripting/Hosting/ErrorSinkProxyListener.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// /// Bridges ErrorListener and ErrorSink. It provides the reverse functionality as ErrorSinkProxyListener /// @@ -14,7 +14,7 @@ public ErrorSinkProxyListener(ErrorSink errorSink) { } public override void ErrorReported(ScriptSource source, string message, SourceSpan span, int errorCode, Severity severity) { - // Note that we cannot use "source.SourceUnit" since "source" may be a proxy object, and we will not be able to marshall + // Note that we cannot use "source.SourceUnit" since "source" may be a proxy object, and we will not be able to marshall // "source.SourceUnit" to the current AppDomain string code = null; diff --git a/Scripting/Hosting/ExceptionOperations.cs b/Scripting/Hosting/ExceptionOperations.cs index 66e818df..aab596e6 100644 --- a/Scripting/Hosting/ExceptionOperations.cs +++ b/Scripting/Hosting/ExceptionOperations.cs @@ -5,8 +5,8 @@ using System; using System.Collections.Generic; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; #if FEATURE_REMOTING using System.Runtime.Remoting; @@ -14,7 +14,7 @@ using MarshalByRefObject = System.Object; #endif -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { public sealed class ExceptionOperations : MarshalByRefObject { private readonly LanguageContext _context; diff --git a/Scripting/Hosting/LanguageSetup.cs b/Scripting/Hosting/LanguageSetup.cs index 1d11677c..c1043fe3 100644 --- a/Scripting/Hosting/LanguageSetup.cs +++ b/Scripting/Hosting/LanguageSetup.cs @@ -7,9 +7,9 @@ using System.Collections.ObjectModel; using System.Globalization; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// /// Stores information needed to setup a language /// @@ -109,9 +109,9 @@ public string DisplayName { [Obsolete("This option is ignored")] public bool InterpretedMode { get { return GetCachedOption("InterpretedMode", ref _interpretedMode); } - set { + set { CheckFrozen(); - Options["InterpretedMode"] = value; + Options["InterpretedMode"] = value; } } @@ -166,6 +166,6 @@ private void CheckFrozen() { if (_frozen) { throw new InvalidOperationException("Cannot modify LanguageSetup after it has been used to create a ScriptRuntime"); } - } + } } } diff --git a/Scripting/Hosting/MemberDoc.cs b/Scripting/Hosting/MemberDoc.cs index 55337ef4..3d0e25ca 100644 --- a/Scripting/Hosting/MemberDoc.cs +++ b/Scripting/Hosting/MemberDoc.cs @@ -4,9 +4,9 @@ using System; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// /// Provides documentation about a member in a live object. /// diff --git a/Scripting/Hosting/MemberKind.cs b/Scripting/Hosting/MemberKind.cs index 5e62236f..89438f72 100644 --- a/Scripting/Hosting/MemberKind.cs +++ b/Scripting/Hosting/MemberKind.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// /// Specifies the type of member. /// diff --git a/Scripting/Hosting/ObjectOperations.cs b/Scripting/Hosting/ObjectOperations.cs index 1bcea1e5..3560a4e3 100644 --- a/Scripting/Hosting/ObjectOperations.cs +++ b/Scripting/Hosting/ObjectOperations.cs @@ -14,18 +14,18 @@ using System.Collections.Generic; using System.Diagnostics; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// - /// ObjectOperations provide a large catalogue of object operations such as member access, conversions, + /// ObjectOperations provide a large catalogue of object operations such as member access, conversions, /// indexing, and things like addition. There are several introspection and tool support services available - /// for more advanced hosts. - /// - /// You get ObjectOperation instances from ScriptEngine, and they are bound to their engines for the semantics - /// of the operations. There is a default instance of ObjectOperations you can share across all uses of the + /// for more advanced hosts. + /// + /// You get ObjectOperation instances from ScriptEngine, and they are bound to their engines for the semantics + /// of the operations. There is a default instance of ObjectOperations you can share across all uses of the /// engine. However, very advanced hosts can create new instances. /// public sealed class ObjectOperations : MarshalByRefObject { @@ -38,7 +38,7 @@ internal ObjectOperations(DynamicOperations ops, ScriptEngine engine) { _ops = ops; Engine = engine; } - + public ScriptEngine Engine { get; } #pragma warning disable 618 @@ -46,8 +46,8 @@ internal ObjectOperations(DynamicOperations ops, ScriptEngine engine) { #region Local Operations /// - /// Returns true if the object can be called, false if it cannot. - /// + /// Returns true if the object can be called, false if it cannot. + /// /// Even if an object is callable Call may still fail if an incorrect number of arguments or type of arguments are provided. /// public bool IsCallable(object obj) { @@ -56,8 +56,8 @@ public bool IsCallable(object obj) { /// /// Invokes the provided object with the given parameters and returns the result. - /// - /// The prefered way of calling objects is to convert the object to a strongly typed delegate + /// + /// The prefered way of calling objects is to convert the object to a strongly typed delegate /// using the ConvertTo methods and then invoking that delegate. /// public dynamic Invoke(object obj, params object[] parameters) { @@ -94,7 +94,7 @@ public T GetMember(object obj, string name) { } /// - /// Gets the member name from the object obj. Returns true if the member is successfully retrieved and + /// Gets the member name from the object obj. Returns true if the member is successfully retrieved and /// stores the value in the value out param. /// public bool TryGetMember(object obj, string name, out object value) { @@ -109,7 +109,7 @@ public bool ContainsMember(object obj, string name) { } /// - /// Removes the member name from the object obj. + /// Removes the member name from the object obj. /// public void RemoveMember(object obj, string name) { _ops.RemoveMember(obj, name); @@ -146,7 +146,7 @@ public T GetMember(object obj, string name, bool ignoreCase) { } /// - /// Gets the member name from the object obj. Returns true if the member is successfully retrieved and + /// Gets the member name from the object obj. Returns true if the member is successfully retrieved and /// stores the value in the value out param. /// public bool TryGetMember(object obj, string name, bool ignoreCase, out object value) { @@ -161,7 +161,7 @@ public bool ContainsMember(object obj, string name, bool ignoreCase) { } /// - /// Removes the member name from the object obj. + /// Removes the member name from the object obj. /// public void RemoveMember(object obj, string name, bool ignoreCase) { _ops.RemoveMember(obj, name, ignoreCase); @@ -183,7 +183,7 @@ public void SetMember(object obj, string name, T value, bool ignoreCase) { } /// - /// Converts the object obj to the type T. The conversion will be explicit or implicit depending on + /// Converts the object obj to the type T. The conversion will be explicit or implicit depending on /// what the langauge prefers. /// public T ConvertTo(object obj) { @@ -191,7 +191,7 @@ public T ConvertTo(object obj) { } /// - /// Converts the object obj to the type type. The conversion will be explicit or implicit depending on + /// Converts the object obj to the type type. The conversion will be explicit or implicit depending on /// what the langauge prefers. /// public object ConvertTo(object obj, Type type) { @@ -202,7 +202,7 @@ public object ConvertTo(object obj, Type type) { /// /// Converts the object obj to the type T. Returns true if the value can be converted, false if it cannot. - /// + /// /// The conversion will be explicit or implicit depending on what the langauge prefers. /// public bool TryConvertTo(object obj, out T result) { @@ -211,7 +211,7 @@ public bool TryConvertTo(object obj, out T result) { /// /// Converts the object obj to the type type. Returns true if the value can be converted, false if it cannot. - /// + /// /// The conversion will be explicit or implicit depending on what the langauge prefers. /// public bool TryConvertTo(object obj, Type type, out object result) { @@ -236,7 +236,7 @@ public object ExplicitConvertTo(object obj, Type type) { /// /// Converts the object obj to the type T including explicit conversions which may lose information. - /// + /// /// Returns true if the value can be converted, false if it cannot. /// public bool TryExplicitConvertTo(object obj, out T result) { @@ -244,8 +244,8 @@ public bool TryExplicitConvertTo(object obj, out T result) { } /// - /// Converts the object obj to the type type including explicit conversions which may lose information. - /// + /// Converts the object obj to the type type including explicit conversions which may lose information. + /// /// Returns true if the value can be converted, false if it cannot. /// public bool TryExplicitConvertTo(object obj, Type type, out object result) { @@ -271,7 +271,7 @@ public object ImplicitConvertTo(object obj, Type type) { /// /// Converts the object obj to the type T including implicit conversions. - /// + /// /// Returns true if the value can be converted, false if it cannot. /// public bool TryImplicitConvertTo(object obj, out T result) { @@ -279,8 +279,8 @@ public bool TryImplicitConvertTo(object obj, out T result) { } /// - /// Converts the object obj to the type type including implicit conversions. - /// + /// Converts the object obj to the type type including implicit conversions. + /// /// Returns true if the value can be converted, false if it cannot. /// public bool TryImplicitConvertTo(object obj, Type type, out object result) { @@ -380,7 +380,7 @@ public dynamic RightShift(object self, object other) { } /// - /// Performs a bitwise-and of the two operands. Throws an exception if the operation + /// Performs a bitwise-and of the two operands. Throws an exception if the operation /// cannot be performed. /// public dynamic BitwiseAnd(object self, object other) { @@ -388,7 +388,7 @@ public dynamic BitwiseAnd(object self, object other) { } /// - /// Performs a bitwise-or of the two operands. Throws an exception if the operation + /// Performs a bitwise-or of the two operands. Throws an exception if the operation /// cannot be performed. /// public dynamic BitwiseOr(object self, object other) { @@ -396,7 +396,7 @@ public dynamic BitwiseOr(object self, object other) { } /// - /// Performs a exclusive-or of the two operands. Throws an exception if the operation + /// Performs a exclusive-or of the two operands. Throws an exception if the operation /// cannot be performed. /// public dynamic ExclusiveOr(object self, object other) { @@ -507,7 +507,7 @@ public bool IsCallable([NotNull]ObjectHandle obj) { /// /// Invokes the specified remote object with the specified remote parameters. - /// + /// /// Though delegates are preferable for calls they may not always be usable for remote objects. /// public ObjectHandle Invoke([NotNull]ObjectHandle obj, params ObjectHandle[] parameters) { @@ -584,7 +584,7 @@ public bool TryGetMember([NotNull]ObjectHandle obj, string name, out ObjectHandl } /// - /// Tests to see if the member name is defined on the remote object. + /// Tests to see if the member name is defined on the remote object. /// public bool ContainsMember([NotNull]ObjectHandle obj, string name) { return ContainsMember(GetLocalObject(obj), name); @@ -599,7 +599,7 @@ public void RemoveMember([NotNull]ObjectHandle obj, string name) { /// /// Converts the remote object into the specified type returning a handle to - /// the new remote object. The conversion will be explicit or implicit depending on + /// the new remote object. The conversion will be explicit or implicit depending on /// what the langauge prefers. /// public ObjectHandle ConvertTo([NotNull]ObjectHandle obj) { @@ -608,7 +608,7 @@ public ObjectHandle ConvertTo([NotNull]ObjectHandle obj) { /// /// Converts the remote object into the specified type returning a handle to - /// the new remote object. The conversion will be explicit or implicit depending on + /// the new remote object. The conversion will be explicit or implicit depending on /// what the langauge prefers. /// public ObjectHandle ConvertTo([NotNull]ObjectHandle obj, Type type) { @@ -618,7 +618,7 @@ public ObjectHandle ConvertTo([NotNull]ObjectHandle obj, Type type) { /// /// Converts the remote object into the specified type returning a handle to /// the new remote object. Returns true if the value can be converted, - /// false if it cannot. The conversion will be explicit or implicit depending on + /// false if it cannot. The conversion will be explicit or implicit depending on /// what the langauge prefers. /// public bool TryConvertTo([NotNull]ObjectHandle obj, out ObjectHandle result) { @@ -633,7 +633,7 @@ public bool TryConvertTo([NotNull]ObjectHandle obj, out ObjectHandle result) /// /// Converts the remote object into the specified type returning a handle to /// the new remote object. Returns true if the value can be converted, - /// false if it cannot. The conversion will be explicit or implicit depending on + /// false if it cannot. The conversion will be explicit or implicit depending on /// what the langauge prefers. /// public bool TryConvertTo([NotNull]ObjectHandle obj, Type type, out ObjectHandle result) { @@ -663,7 +663,7 @@ public ObjectHandle ExplicitConvertTo([NotNull]ObjectHandle obj, Type type) { /// /// Converts the object obj to the type T including explicit conversions which may lose information. - /// + /// /// Returns true if the value can be converted, false if it cannot. /// public bool TryExplicitConvertTo([NotNull]ObjectHandle obj, out ObjectHandle result) { @@ -673,8 +673,8 @@ public bool TryExplicitConvertTo([NotNull]ObjectHandle obj, out ObjectHandle } /// - /// Converts the object obj to the type type including explicit conversions which may lose information. - /// + /// Converts the object obj to the type type including explicit conversions which may lose information. + /// /// Returns true if the value can be converted, false if it cannot. /// public bool TryExplicitConvertTo([NotNull]ObjectHandle obj, Type type, out ObjectHandle result) { @@ -701,7 +701,7 @@ public ObjectHandle ImplicitConvertTo([NotNull]ObjectHandle obj, Type type) { /// /// Converts the object obj to the type T including implicit conversions. - /// + /// /// Returns true if the value can be converted, false if it cannot. /// public bool TryImplicitConvertTo([NotNull]ObjectHandle obj, out ObjectHandle result) { @@ -711,8 +711,8 @@ public bool TryImplicitConvertTo([NotNull]ObjectHandle obj, out ObjectHandle } /// - /// Converts the object obj to the type type including implicit conversions. - /// + /// Converts the object obj to the type type including implicit conversions. + /// /// Returns true if the value can be converted, false if it cannot. /// public bool TryImplicitConvertTo([NotNull]ObjectHandle obj, Type type, out ObjectHandle result) { @@ -780,7 +780,7 @@ public ObjectHandle Divide([NotNull]ObjectHandle self, [NotNull]ObjectHandle oth /// /// Performs modulus on the 1st remote object by the 2nd. Throws an exception if the operation cannot be performed. - /// + /// public ObjectHandle Modulo([NotNull]ObjectHandle self, [NotNull]ObjectHandle other) { return new ObjectHandle((object)Modulo(GetLocalObject(self), GetLocalObject(other))); } diff --git a/Scripting/Hosting/OverloadDoc.cs b/Scripting/Hosting/OverloadDoc.cs index d759578e..fe586c34 100644 --- a/Scripting/Hosting/OverloadDoc.cs +++ b/Scripting/Hosting/OverloadDoc.cs @@ -5,9 +5,9 @@ using System; using System.Collections.Generic; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// /// Provides documentation for a single overload of an invokable object. /// diff --git a/Scripting/Hosting/ParameterDoc.cs b/Scripting/Hosting/ParameterDoc.cs index 6e866d08..7577a41f 100644 --- a/Scripting/Hosting/ParameterDoc.cs +++ b/Scripting/Hosting/ParameterDoc.cs @@ -4,9 +4,9 @@ using System; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// /// Provides documentation for a single parameter. /// diff --git a/Scripting/Hosting/ParameterFlags.cs b/Scripting/Hosting/ParameterFlags.cs index 8bfe4dba..6f1e444e 100644 --- a/Scripting/Hosting/ParameterFlags.cs +++ b/Scripting/Hosting/ParameterFlags.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// /// Indications extra information about a parameter such as if it's a parameter array. /// diff --git a/Scripting/Hosting/Providers/HostingHelpers.cs b/Scripting/Hosting/Providers/HostingHelpers.cs index 02f3c3ef..16cab864 100644 --- a/Scripting/Hosting/Providers/HostingHelpers.cs +++ b/Scripting/Hosting/Providers/HostingHelpers.cs @@ -10,15 +10,15 @@ using System; using System.Runtime.Serialization; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting.Providers { +namespace Riverside.Scripting.Hosting.Providers { /// - /// Advanced APIs for HAPI providers. These methods should not be used by hosts. - /// They are provided for other hosting API implementers that would like to leverage existing HAPI and - /// extend it with language specific functionality, for example. + /// Advanced APIs for HAPI providers. These methods should not be used by hosts. + /// They are provided for other hosting API implementers that would like to leverage existing HAPI and + /// extend it with language specific functionality, for example. /// public static class HostingHelpers { /// is a null reference. @@ -79,7 +79,7 @@ public static ScriptScope CreateScriptScope(ScriptEngine engine, Scope scope) { /// Performs a callback in the ScriptEngine's app domain and returns the result. ///
[Obsolete("You should implement a service via LanguageContext and call ScriptEngine.GetService")] - public static TRet CallEngine(ScriptEngine engine, Func f, T arg) { + public static TRet CallEngine(ScriptEngine engine, Func f, T arg) { return engine.Call(f, arg); } diff --git a/Scripting/Hosting/ScriptEngine.cs b/Scripting/Hosting/ScriptEngine.cs index 9cf53fb7..f789e8ff 100644 --- a/Scripting/Hosting/ScriptEngine.cs +++ b/Scripting/Hosting/ScriptEngine.cs @@ -16,13 +16,13 @@ using System.Text; using System.Threading; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// - /// Represents a language in Hosting API. + /// Represents a language in Hosting API. /// Hosting API counterpart for . /// [DebuggerDisplay("{Setup.DisplayName}")] @@ -41,21 +41,21 @@ internal ScriptEngine(ScriptRuntime runtime, LanguageContext context) { #region Object Operations /// - /// Returns a default ObjectOperations for the engine. - /// - /// Because an ObjectOperations object caches rules for the types of - /// objects and operations it processes, using the default ObjectOperations for - /// many objects could degrade the caching benefits. Eventually the cache for - /// some operations could degrade to a point where ObjectOperations stops caching and - /// does a full search for an implementation of the requested operation for the given objects. - /// + /// Returns a default ObjectOperations for the engine. + /// + /// Because an ObjectOperations object caches rules for the types of + /// objects and operations it processes, using the default ObjectOperations for + /// many objects could degrade the caching benefits. Eventually the cache for + /// some operations could degrade to a point where ObjectOperations stops caching and + /// does a full search for an implementation of the requested operation for the given objects. + /// /// Another reason to create a new ObjectOperations instance is to have it bound /// to the specific view of a ScriptScope. Languages may attach per-language /// behavior to a ScriptScope which would alter how the operations are performed. - /// + /// /// For simple hosting situations, this is sufficient behavior. - /// - /// + /// + /// /// public ObjectOperations Operations { get { @@ -75,8 +75,8 @@ public ObjectOperations CreateOperations() { } /// - /// Returns a new ObjectOperations object that inherits any semantics particular to the provided ScriptScope. - /// + /// Returns a new ObjectOperations object that inherits any semantics particular to the provided ScriptScope. + /// /// See the Operations property for why you might want to call this. /// public ObjectOperations CreateOperations(ScriptScope scope) { @@ -95,9 +95,9 @@ public ObjectOperations CreateOperations(ScriptScope scope) { /// The engine doesn't support code execution. /// is a null reference. public dynamic Execute(string expression) { - // The host doesn't need the scope so do not create it here. + // The host doesn't need the scope so do not create it here. // The language can treat the code as not bound to a DLR scope and change global lookup semantics accordingly. - return CreateScriptSourceFromString(expression).Execute(); + return CreateScriptSourceFromString(expression).Execute(); } /// @@ -118,7 +118,7 @@ public dynamic Execute(string expression, ScriptScope scope) { public T Execute(string expression) { return Operations.ConvertTo((object)Execute(expression)); } - + /// /// Executes an expression within the specified scope and converts result to the given type. /// @@ -153,7 +153,7 @@ public ScriptScope ExecuteFile(string path, ScriptScope scope) { #if FEATURE_REMOTING /// /// Executes the expression in the specified scope and return a result. - /// Returns an ObjectHandle wrapping the resulting value of running the code. + /// Returns an ObjectHandle wrapping the resulting value of running the code. /// public ObjectHandle ExecuteAndWrap(string expression, ScriptScope scope) { return new ObjectHandle((object)Execute(expression, scope)); @@ -161,7 +161,7 @@ public ObjectHandle ExecuteAndWrap(string expression, ScriptScope scope) { /// /// Executes the code in an empty scope. - /// Returns an ObjectHandle wrapping the resulting value of running the code. + /// Returns an ObjectHandle wrapping the resulting value of running the code. /// public ObjectHandle ExecuteAndWrap(string expression) { return new ObjectHandle((object)Execute(expression)); @@ -169,13 +169,13 @@ public ObjectHandle ExecuteAndWrap(string expression) { /// /// Executes the expression in the specified scope and return a result. - /// Returns an ObjectHandle wrapping the resulting value of running the code. - /// + /// Returns an ObjectHandle wrapping the resulting value of running the code. + /// /// If an exception is thrown the exception is caught and an ObjectHandle to /// the exception is provided. /// /// - /// Use this API in case the exception is not serializable (for example, due to security restrictions) or its serialization + /// Use this API in case the exception is not serializable (for example, due to security restrictions) or its serialization /// loses information that you need to access. /// [Obsolete("Use ScriptSource.ExecuteAndWrap instead")] @@ -192,13 +192,13 @@ public ObjectHandle ExecuteAndWrap(string expression, ScriptScope scope, out Obj /// /// Executes the code in an empty scope. - /// Returns an ObjectHandle wrapping the resulting value of running the code. - /// + /// Returns an ObjectHandle wrapping the resulting value of running the code. + /// /// If an exception is thrown the exception is caught and an ObjectHandle to /// the exception is provided. /// /// - /// Use this API in case the exception is not serializable (for example, due to security restrictions) or its serialization + /// Use this API in case the exception is not serializable (for example, due to security restrictions) or its serialization /// loses information that you need to access. /// [Obsolete("Use ScriptSource.ExecuteAndWrap instead")] @@ -213,7 +213,7 @@ public ObjectHandle ExecuteAndWrap(string expression, out ObjectHandle exception } } #endif - + #endregion #region Scopes @@ -227,7 +227,7 @@ public ScriptScope CreateScope() { /// /// Creates a new ScriptScope whose storage contains the provided dictionary of objects - /// + /// /// Accesses to the ScriptScope will turn into get,set, and delete members against this dictionary /// public ScriptScope CreateScope(IDictionary dictionary) @@ -238,7 +238,7 @@ public ScriptScope CreateScope(IDictionary dictionary) /// /// Creates a new ScriptScope whose storage is an arbitrary object. - /// + /// /// Accesses to the ScriptScope will turn into get, set, and delete members against the object. /// public ScriptScope CreateScope(IDynamicMetaObjectProvider storage) { @@ -248,16 +248,16 @@ public ScriptScope CreateScope(IDynamicMetaObjectProvider storage) { } /// - /// This method returns the ScriptScope in which a ScriptSource of given path was executed. - /// - /// The ScriptSource.Path property is the key to finding the ScriptScope. Hosts need + /// This method returns the ScriptScope in which a ScriptSource of given path was executed. + /// + /// The ScriptSource.Path property is the key to finding the ScriptScope. Hosts need /// to make sure they create a ScriptSource and set its Path property appropriately. - /// - /// GetScope is primarily useful for tools that need to map files to their execution scopes. For example, - /// an editor and interpreter tool might run a file Foo that imports or requires a file Bar. - /// - /// The editor's user might later open the file Bar and want to execute expressions in its context. - /// The tool would need to find Bar's ScriptScope for setting the appropriate context in its interpreter window. + /// + /// GetScope is primarily useful for tools that need to map files to their execution scopes. For example, + /// an editor and interpreter tool might run a file Foo that imports or requires a file Bar. + /// + /// The editor's user might later open the file Bar and want to execute expressions in its context. + /// The tool would need to find Bar's ScriptScope for setting the appropriate context in its interpreter window. /// This method helps with this scenario. /// public ScriptScope GetScope(string path) { @@ -272,9 +272,9 @@ public ScriptScope GetScope(string path) { /// /// Return a ScriptSource object from string contents with the current engine as the language binding. - /// + /// /// The default SourceCodeKind is AutoDetect. - /// + /// /// The ScriptSource's Path property defaults to null. /// public ScriptSource CreateScriptSourceFromString(string expression) { @@ -285,7 +285,7 @@ public ScriptSource CreateScriptSourceFromString(string expression) { /// /// Return a ScriptSource object from string contents with the current engine as the language binding. - /// + /// /// The ScriptSource's Path property defaults to null. /// public ScriptSource CreateScriptSourceFromString(string code, SourceCodeKind kind) { @@ -297,7 +297,7 @@ public ScriptSource CreateScriptSourceFromString(string code, SourceCodeKind kin /// /// Return a ScriptSource object from string contents with the current engine as the language binding. - /// + /// /// The default SourceCodeKind is AutoDetect. /// public ScriptSource CreateScriptSourceFromString(string expression, string path) { @@ -317,15 +317,15 @@ public ScriptSource CreateScriptSourceFromString(string code, string path, Sourc } /// - /// Return a ScriptSource object from file contents with the current engine as the language binding. - /// - /// The path's extension does NOT have to be in ScriptRuntime.GetRegisteredFileExtensions + /// Return a ScriptSource object from file contents with the current engine as the language binding. + /// + /// The path's extension does NOT have to be in ScriptRuntime.GetRegisteredFileExtensions /// or map to this language engine with ScriptRuntime.GetEngineByFileExtension. - /// + /// /// The default SourceCodeKind is File. - /// + /// /// The ScriptSource's Path property will be the path argument. - /// + /// /// The encoding defaults to the default encoding of the language. /// public ScriptSource CreateScriptSourceFromFile(string path) { @@ -333,13 +333,13 @@ public ScriptSource CreateScriptSourceFromFile(string path) { } /// - /// Return a ScriptSource object from file contents with the current engine as the language binding. - /// - /// The path's extension does NOT have to be in ScriptRuntime.GetRegisteredFileExtensions + /// Return a ScriptSource object from file contents with the current engine as the language binding. + /// + /// The path's extension does NOT have to be in ScriptRuntime.GetRegisteredFileExtensions /// or map to this language engine with ScriptRuntime.GetEngineByFileExtension. - /// + /// /// The default SourceCodeKind is File. - /// + /// /// The ScriptSource's Path property will be the path argument. /// public ScriptSource CreateScriptSourceFromFile(string path, Encoding encoding) { @@ -347,11 +347,11 @@ public ScriptSource CreateScriptSourceFromFile(string path, Encoding encoding) { } /// - /// Return a ScriptSource object from file contents with the current engine as the language binding. - /// - /// The path's extension does NOT have to be in ScriptRuntime.GetRegisteredFileExtensions + /// Return a ScriptSource object from file contents with the current engine as the language binding. + /// + /// The path's extension does NOT have to be in ScriptRuntime.GetRegisteredFileExtensions /// or map to this language engine with ScriptRuntime.GetEngineByFileExtension. - /// + /// /// The ScriptSource's Path property will be the path argument. /// public ScriptSource CreateScriptSourceFromFile(string path, Encoding encoding, SourceCodeKind kind) { @@ -365,12 +365,12 @@ public ScriptSource CreateScriptSourceFromFile(string path, Encoding encoding, S #if FEATURE_CODEDOM /// - /// This method returns a ScriptSource object from a System.CodeDom.CodeObject. + /// This method returns a ScriptSource object from a System.CodeDom.CodeObject. /// This is a factory method for creating a ScriptSources with this language binding. - /// - /// The expected CodeDom support is extremely minimal for syntax-independent expression of semantics. - /// - /// Languages may do more, but hosts should only expect CodeMemberMethod support, + /// + /// The expected CodeDom support is extremely minimal for syntax-independent expression of semantics. + /// + /// Languages may do more, but hosts should only expect CodeMemberMethod support, /// and only sub nodes consisting of the following: /// CodeSnippetStatement /// CodeSnippetExpression @@ -383,12 +383,12 @@ public ScriptSource CreateScriptSource(CodeObject content) { } /// - /// This method returns a ScriptSource object from a System.CodeDom.CodeObject. + /// This method returns a ScriptSource object from a System.CodeDom.CodeObject. /// This is a factory method for creating a ScriptSources with this language binding. - /// - /// The expected CodeDom support is extremely minimal for syntax-independent expression of semantics. - /// - /// Languages may do more, but hosts should only expect CodeMemberMethod support, + /// + /// The expected CodeDom support is extremely minimal for syntax-independent expression of semantics. + /// + /// Languages may do more, but hosts should only expect CodeMemberMethod support, /// and only sub nodes consisting of the following: /// CodeSnippetStatement /// CodeSnippetExpression @@ -401,12 +401,12 @@ public ScriptSource CreateScriptSource(CodeObject content, string path) { } /// - /// This method returns a ScriptSource object from a System.CodeDom.CodeObject. + /// This method returns a ScriptSource object from a System.CodeDom.CodeObject. /// This is a factory method for creating a ScriptSources with this language binding. - /// - /// The expected CodeDom support is extremely minimal for syntax-independent expression of semantics. - /// - /// Languages may do more, but hosts should only expect CodeMemberMethod support, + /// + /// The expected CodeDom support is extremely minimal for syntax-independent expression of semantics. + /// + /// Languages may do more, but hosts should only expect CodeMemberMethod support, /// and only sub nodes consisting of the following: /// CodeSnippetStatement /// CodeSnippetExpression @@ -419,12 +419,12 @@ public ScriptSource CreateScriptSource(CodeObject content, SourceCodeKind kind) } /// - /// This method returns a ScriptSource object from a System.CodeDom.CodeObject. + /// This method returns a ScriptSource object from a System.CodeDom.CodeObject. /// This is a factory method for creating a ScriptSources with this language binding. - /// - /// The expected CodeDom support is extremely minimal for syntax-independent expression of semantics. - /// - /// Languages may do more, but hosts should only expect CodeMemberMethod support, + /// + /// The expected CodeDom support is extremely minimal for syntax-independent expression of semantics. + /// + /// Languages may do more, but hosts should only expect CodeMemberMethod support, /// and only sub nodes consisting of the following: /// CodeSnippetStatement /// CodeSnippetExpression @@ -441,10 +441,10 @@ public ScriptSource CreateScriptSource(CodeObject content, string path, SourceCo #endif /// - /// These methods return ScriptSource objects from stream contents with the current engine as the language binding. - /// + /// These methods return ScriptSource objects from stream contents with the current engine as the language binding. + /// /// The default SourceCodeKind is File. - /// + /// /// The encoding defaults to the default encoding of the language. /// public ScriptSource CreateScriptSource(StreamContentProvider content, string path) { @@ -454,8 +454,8 @@ public ScriptSource CreateScriptSource(StreamContentProvider content, string pat } /// - /// These methods return ScriptSource objects from stream contents with the current engine as the language binding. - /// + /// These methods return ScriptSource objects from stream contents with the current engine as the language binding. + /// /// The default SourceCodeKind is File. /// public ScriptSource CreateScriptSource(StreamContentProvider content, string path, Encoding encoding) { @@ -466,8 +466,8 @@ public ScriptSource CreateScriptSource(StreamContentProvider content, string pat } /// - /// These methods return ScriptSource objects from stream contents with the current engine as the language binding. - /// + /// These methods return ScriptSource objects from stream contents with the current engine as the language binding. + /// /// The encoding defaults to Encoding.Default. /// public ScriptSource CreateScriptSource(StreamContentProvider content, string path, Encoding encoding, SourceCodeKind kind) { @@ -480,7 +480,7 @@ public ScriptSource CreateScriptSource(StreamContentProvider content, string pat /// /// This method returns a ScriptSource with the content provider supplied with the current engine as the language binding. - /// + /// /// This helper lets you own the content provider so that you can implement a stream over internal host data structures, such as an editor's text representation. /// public ScriptSource CreateScriptSource(TextContentProvider contentProvider, string path, SourceCodeKind kind) { @@ -496,11 +496,11 @@ public ScriptSource CreateScriptSource(TextContentProvider contentProvider, stri #region Additional Services /// - /// This method returns a language-specific service. - /// - /// It provides a point of extensibility for a language implementation + /// This method returns a language-specific service. + /// + /// It provides a point of extensibility for a language implementation /// to offer more functionality than the standard engine members discussed here. - /// + /// /// Commonly available services include: /// TokenCategorizer /// Provides standardized tokenization of source code @@ -536,7 +536,7 @@ public TService GetService(params object[] args) where TService : clas /// This property returns readon-only LanguageOptions this engine is using. /// /// - /// The values are determined during runtime initialization and read-only afterwards. + /// The values are determined during runtime initialization and read-only afterwards. /// You can change the settings via a configuration file or explicitly using ScriptRuntimeSetup class. /// public LanguageSetup Setup { @@ -581,8 +581,8 @@ public CompilerOptions GetCompilerOptions(ScriptScope scope) { } /// - /// Sets the search paths used by the engine for loading files when a script wants - /// to import or require another file of code. + /// Sets the search paths used by the engine for loading files when a script wants + /// to import or require another file of code. /// /// The language doesn't allow to set search paths. public void SetSearchPaths(ICollection paths) { @@ -593,8 +593,8 @@ public void SetSearchPaths(ICollection paths) { } /// - /// Gets the search paths used by the engine for loading files when a script wants - /// to import or require another file of code. + /// Gets the search paths used by the engine for loading files when a script wants + /// to import or require another file of code. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] public ICollection GetSearchPaths() { diff --git a/Scripting/Hosting/ScriptHost.cs b/Scripting/Hosting/ScriptHost.cs index e98ed41d..e0315bee 100644 --- a/Scripting/Hosting/ScriptHost.cs +++ b/Scripting/Hosting/ScriptHost.cs @@ -10,20 +10,20 @@ using System; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// - /// ScriptHost is collocated with ScriptRuntime in the same app-domain. - /// The host can implement a derived class to consume some notifications and/or + /// ScriptHost is collocated with ScriptRuntime in the same app-domain. + /// The host can implement a derived class to consume some notifications and/or /// customize operations like TryGetSourceUnit,ResolveSourceUnit, etc. /// - /// The areguments to the the constructor of the derived class are specified in ScriptRuntimeSetup + /// The areguments to the the constructor of the derived class are specified in ScriptRuntimeSetup /// instance that enters ScriptRuntime initialization. - /// + /// /// If the host is remote with respect to DLR (i.e. also with respect to ScriptHost) - /// and needs to access objects living in its app-domain it can pass MarshalByRefObject + /// and needs to access objects living in its app-domain it can pass MarshalByRefObject /// as an argument to its ScriptHost subclass constructor. /// public class ScriptHost : MarshalByRefObject { @@ -31,8 +31,8 @@ public class ScriptHost : MarshalByRefObject { /// The runtime the host is attached to. /// private ScriptRuntime _runtime; - - // Called by ScriptRuntime when it is completely initialized. + + // Called by ScriptRuntime when it is completely initialized. // Notifies the host implementation that the runtime is available now. internal void SetRuntime(ScriptRuntime runtime) { Assert.NotNull(runtime); diff --git a/Scripting/Hosting/ScriptHostProxy.cs b/Scripting/Hosting/ScriptHostProxy.cs index 0ee707ec..d714ba2a 100644 --- a/Scripting/Hosting/ScriptHostProxy.cs +++ b/Scripting/Hosting/ScriptHostProxy.cs @@ -2,12 +2,12 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// - /// Provides hosting to DLR. Forwards DLR requests to the ScriptHost. + /// Provides hosting to DLR. Forwards DLR requests to the ScriptHost. /// internal sealed class ScriptHostProxy : DynamicRuntimeHostingProvider { private readonly ScriptHost _host; diff --git a/Scripting/Hosting/ScriptIO.cs b/Scripting/Hosting/ScriptIO.cs index 34f810f0..ce7e63d6 100644 --- a/Scripting/Hosting/ScriptIO.cs +++ b/Scripting/Hosting/ScriptIO.cs @@ -12,10 +12,10 @@ using System.IO; using System.Text; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// /// Provides host-redirectable IO streams used by DLR languages for default IO. /// diff --git a/Scripting/Hosting/ScriptRuntime.cs b/Scripting/Hosting/ScriptRuntime.cs index a232ae69..c9f5178a 100644 --- a/Scripting/Hosting/ScriptRuntime.cs +++ b/Scripting/Hosting/ScriptRuntime.cs @@ -15,12 +15,12 @@ using System.IO; using System.Reflection; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// - /// Represents a Dynamic Language Runtime in Hosting API. + /// Represents a Dynamic Language Runtime in Hosting API. /// Hosting API counterpart for . /// public sealed class ScriptRuntime : MarshalByRefObject { @@ -78,7 +78,7 @@ public ScriptRuntime(ScriptRuntimeSetup setup) { public ScriptIO IO { get; } /// - /// Creates a new runtime with languages set up according to the current application configuration + /// Creates a new runtime with languages set up according to the current application configuration /// (using System.Configuration). /// public static ScriptRuntime CreateFromConfiguration() { @@ -97,12 +97,12 @@ public static ScriptRuntime CreateFromConfiguration() { public static ScriptRuntime CreateRemote(AppDomain domain, ScriptRuntimeSetup setup) { ContractUtils.RequiresNotNull(domain, nameof(domain)); return (ScriptRuntime)domain.CreateInstanceAndUnwrap( - typeof(ScriptRuntime).Assembly.FullName, - typeof(ScriptRuntime).FullName, - false, - BindingFlags.Default, - null, - new object[] { setup }, + typeof(ScriptRuntime).Assembly.FullName, + typeof(ScriptRuntime).FullName, + false, + BindingFlags.Default, + null, + new object[] { setup }, null, null ); @@ -285,9 +285,9 @@ public ScriptScope UseFile(string path) { } /// - /// This property returns the "global object" or name bindings of the ScriptRuntime as a ScriptScope. - /// - /// You can set the globals scope, which you might do if you created a ScriptScope with an + /// This property returns the "global object" or name bindings of the ScriptRuntime as a ScriptScope. + /// + /// You can set the globals scope, which you might do if you created a ScriptScope with an /// IAttributesCollection so that your host could late bind names. /// public ScriptScope Globals { @@ -316,11 +316,11 @@ public ScriptScope Globals { } /// - /// This method walks the assembly's namespaces and name bindings to ScriptRuntime.Globals - /// to represent the types available in the assembly. Each top-level namespace name gets - /// bound in Globals to a dynamic object representing the namespace. Within each top-level - /// namespace object, nested namespace names are bound to dynamic objects representing each - /// tier of nested namespaces. When this method encounters the same namespace-qualified name, + /// This method walks the assembly's namespaces and name bindings to ScriptRuntime.Globals + /// to represent the types available in the assembly. Each top-level namespace name gets + /// bound in Globals to a dynamic object representing the namespace. Within each top-level + /// namespace object, nested namespace names are bound to dynamic objects representing each + /// tier of nested namespaces. When this method encounters the same namespace-qualified name, /// it merges names together objects representing the namespaces. /// /// diff --git a/Scripting/Hosting/ScriptRuntimeSetup.cs b/Scripting/Hosting/ScriptRuntimeSetup.cs index c820d612..23069d83 100644 --- a/Scripting/Hosting/ScriptRuntimeSetup.cs +++ b/Scripting/Hosting/ScriptRuntimeSetup.cs @@ -8,10 +8,10 @@ using System.IO; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// /// Stores information needed to setup a ScriptRuntime /// @@ -45,7 +45,7 @@ public ScriptRuntimeSetup() { /// /// Indicates that the script runtime is in debug mode. /// This means: - /// + /// /// 1) Symbols are emitted for debuggable methods (methods associated with SourceUnit). /// 2) Debuggable methods are emitted to non-collectable types (this is due to CLR limitations on dynamic method debugging). /// 3) JIT optimization is disabled for all methods @@ -55,7 +55,7 @@ public bool DebugMode { get => _debugMode; set { CheckFrozen(); - _debugMode = value; + _debugMode = value; } } @@ -66,7 +66,7 @@ public bool PrivateBinding { get => _privateBinding; set { CheckFrozen(); - _privateBinding = value; + _privateBinding = value; } } @@ -108,7 +108,7 @@ internal DlrConfiguration ToConfiguration() { // prepare ReadOnlyCollection setups = new ReadOnlyCollection(ArrayUtils.MakeArray(LanguageSetups)); var hostArguments = new ReadOnlyCollection(ArrayUtils.MakeArray(_hostArguments)); - var options = new ReadOnlyDictionary(new Dictionary(Options)); + var options = new ReadOnlyDictionary(new Dictionary(Options)); var config = new DlrConfiguration(_debugMode, _privateBinding, options); // validate @@ -143,9 +143,9 @@ private void Freeze(ReadOnlyCollection setups) { private void CheckFrozen() { if (_frozen) { throw new InvalidOperationException("Cannot modify ScriptRuntimeSetup after it has been used to create a ScriptRuntime"); - } + } } - + /// /// Reads setup from .NET configuration system (.config files). /// If there is no configuration available returns an empty setup. diff --git a/Scripting/Hosting/ScriptScope.cs b/Scripting/Hosting/ScriptScope.cs index 9bbadce8..aa27f211 100644 --- a/Scripting/Hosting/ScriptScope.cs +++ b/Scripting/Hosting/ScriptScope.cs @@ -15,16 +15,16 @@ using System.Linq.Expressions; using System.Runtime.Serialization; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// /// A ScriptScope is a unit of execution for code. It consists of a global Scope which /// all code executes in. A ScriptScope can have an arbitrary initializer and arbitrary - /// reloader. - /// - /// ScriptScope is not thread safe. Host should either lock when multiple threads could + /// reloader. + /// + /// ScriptScope is not thread safe. Host should either lock when multiple threads could /// access the same module or should make a copy for each thread. /// /// Hosting API counterpart for . @@ -108,7 +108,7 @@ public ObjectHandle GetVariableHandle(string name) { /// /// Tries to get a handle for a value stored in the scope under the given name. - /// Returns true if there is such name, false otherwise. + /// Returns true if there is such name, false otherwise. /// /// is a null reference. public bool TryGetVariableHandle(string name, out ObjectHandle handle) { @@ -145,7 +145,7 @@ public bool ContainsVariable(string name) { /// /// Removes the variable of the given name from this scope. - /// + /// /// true if the value existed in the scope before it has been removed. /// is a null reference. public bool RemoveVariable(string name) { @@ -173,7 +173,7 @@ public IEnumerable GetVariableNames() { public IEnumerable> GetItems() { // Remoting: we eagerly enumerate all variables to avoid cross domain calls for each item. var result = new List>(); - + foreach (string name in GetVariableNames()) { result.Add(new KeyValuePair(name, (object)Engine.Operations.GetMember((object)Scope.Storage, name))); } diff --git a/Scripting/Hosting/ScriptSource.cs b/Scripting/Hosting/ScriptSource.cs index aa9c9f4c..44800f65 100644 --- a/Scripting/Hosting/ScriptSource.cs +++ b/Scripting/Hosting/ScriptSource.cs @@ -13,9 +13,9 @@ using System.Diagnostics; using System.Text; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { /// /// Hosting counterpart for . /// @@ -25,7 +25,7 @@ public sealed class ScriptSource : MarshalByRefObject internal SourceUnit SourceUnit { get; } /// - /// Identification of the source unit. Assigned by the host. + /// Identification of the source unit. Assigned by the host. /// The format and semantics is host dependent (could be a path on file system or URL). /// null for anonymous script source. /// Cannot be an empty string. @@ -47,7 +47,7 @@ internal ScriptSource(ScriptEngine engine, SourceUnit sourceUnit) { #region Compilation and Execution /// - /// Compile the ScriptSource into CompileCode object that can be executed + /// Compile the ScriptSource into CompileCode object that can be executed /// repeatedly in its default scope or in other scopes without having to recompile the code. /// /// Code cannot be compiled. @@ -56,7 +56,7 @@ public CompiledCode Compile() { } /// - /// Errors are reported to the specified listener. + /// Errors are reported to the specified listener. /// Returns null if the parser cannot compile the code due to errors. /// public CompiledCode Compile(ErrorListener errorListener) { @@ -66,7 +66,7 @@ public CompiledCode Compile(ErrorListener errorListener) { } /// - /// Errors are reported to the specified listener. + /// Errors are reported to the specified listener. /// Returns null if the parser cannot compile the code due to error(s). /// public CompiledCode Compile(CompilerOptions compilerOptions) { @@ -76,7 +76,7 @@ public CompiledCode Compile(CompilerOptions compilerOptions) { } /// - /// Errors are reported to the specified listener. + /// Errors are reported to the specified listener. /// Returns null if the parser cannot compile the code due to error(s). /// public CompiledCode Compile(CompilerOptions compilerOptions, ErrorListener errorListener) { @@ -95,11 +95,11 @@ private CompiledCode CompileInternal(CompilerOptions compilerOptions, ErrorListe /// /// Executes the code in the specified scope. - /// Returns an object that is the resulting value of running the code. - /// - /// When the ScriptSource is a file or statement, the engine decides what is - /// an appropriate value to return. Some languages return the value produced - /// by the last expression or statement, but languages that are not expression + /// Returns an object that is the resulting value of running the code. + /// + /// When the ScriptSource is a file or statement, the engine decides what is + /// an appropriate value to return. Some languages return the value produced + /// by the last expression or statement, but languages that are not expression /// based may return null. /// /// Code cannot be compiled. @@ -113,7 +113,7 @@ public dynamic Execute(ScriptScope scope) { /// Executes the source code. The execution is not bound to any particular scope. /// public dynamic Execute() { - // The host doesn't need the scope so do not create it here. + // The host doesn't need the scope so do not create it here. // The language can treat the code as not bound to a DLR scope and change global lookup semantics accordingly. return SourceUnit.Execute(); } @@ -137,7 +137,7 @@ public T Execute() { #if FEATURE_REMOTING /// /// Executes the code in an empty scope. - /// Returns an ObjectHandle wrapping the resulting value of running the code. + /// Returns an ObjectHandle wrapping the resulting value of running the code. /// public ObjectHandle ExecuteAndWrap() { return new ObjectHandle((object)Execute()); @@ -145,7 +145,7 @@ public ObjectHandle ExecuteAndWrap() { /// /// Executes the code in the specified scope. - /// Returns an ObjectHandle wrapping the resulting value of running the code. + /// Returns an ObjectHandle wrapping the resulting value of running the code. /// public ObjectHandle ExecuteAndWrap(ScriptScope scope) { return new ObjectHandle((object)Execute(scope)); @@ -153,13 +153,13 @@ public ObjectHandle ExecuteAndWrap(ScriptScope scope) { /// /// Executes the code in an empty scope. - /// Returns an ObjectHandle wrapping the resulting value of running the code. - /// + /// Returns an ObjectHandle wrapping the resulting value of running the code. + /// /// If an exception is thrown the exception is caught and an ObjectHandle to /// the exception is provided. /// /// - /// Use this API to handle non-serializable exceptions (exceptions might not be serializable due to security restrictions) + /// Use this API to handle non-serializable exceptions (exceptions might not be serializable due to security restrictions) /// or if an exception serialization loses information. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] @@ -175,13 +175,13 @@ public ObjectHandle ExecuteAndWrap(out ObjectHandle exception) { /// /// Executes the expression in the specified scope and return a result. - /// Returns an ObjectHandle wrapping the resulting value of running the code. - /// + /// Returns an ObjectHandle wrapping the resulting value of running the code. + /// /// If an exception is thrown the exception is caught and an ObjectHandle to /// the exception is provided. /// /// - /// Use this API to handle non-serializable exceptions (exceptions might not be serializable due to security restrictions) + /// Use this API to handle non-serializable exceptions (exceptions might not be serializable due to security restrictions) /// or if an exception serialization loses information. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] @@ -197,13 +197,13 @@ public ObjectHandle ExecuteAndWrap(ScriptScope scope, out ObjectHandle exception #endif /// - /// Runs a specified code as if it was a program launched from OS command shell. - /// and returns a process exit code indicating the success or error condition + /// Runs a specified code as if it was a program launched from OS command shell. + /// and returns a process exit code indicating the success or error condition /// of executing the code. - /// - /// Exact behavior depends on the language. Some languages have a dedicated "exit" exception that + /// + /// Exact behavior depends on the language. Some languages have a dedicated "exit" exception that /// carries the exit code, in which case the exception is cought and the exit code is returned. - /// The default behavior returns the result of program's execution converted to an integer + /// The default behavior returns the result of program's execution converted to an integer /// using a language specific conversion. /// /// Code cannot be compiled. @@ -235,7 +235,7 @@ public SourceCodeReader GetReader() { /// Null if the content is already textual and no transcoding is performed. /// /// - /// Note that the default encoding specified when the script source is created could be overridden by + /// Note that the default encoding specified when the script source is created could be overridden by /// an encoding that is found in the content preamble (Unicode BOM or a language specific encoding preamble). /// In that case the preamble encoding is returned. Otherwise, the default encoding is returned. /// @@ -247,7 +247,7 @@ public Encoding DetectEncoding() { } /// - /// Reads specified range of lines (or less) from the source unit. + /// Reads specified range of lines (or less) from the source unit. /// /// 1-based number of the first line to fetch. /// The number of lines to fetch. @@ -281,7 +281,7 @@ public string GetCodeLine(int line) { /// Entire content. /// An I/O error occurs. /// - /// The result includes language specific preambles (e.g. "#coding:UTF-8" encoding preamble recognized by Ruby), + /// The result includes language specific preambles (e.g. "#coding:UTF-8" encoding preamble recognized by Ruby), /// but not the preamble defined by the content encoding (e.g. BOM). /// The entire content of the source unit is encoded by single encoding (if it is read from binary stream). /// diff --git a/Scripting/Hosting/TokenCategorizer.cs b/Scripting/Hosting/TokenCategorizer.cs index 6294e871..5c12bf29 100644 --- a/Scripting/Hosting/TokenCategorizer.cs +++ b/Scripting/Hosting/TokenCategorizer.cs @@ -11,10 +11,10 @@ using System; using System.Collections.Generic; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Hosting { +namespace Riverside.Scripting.Hosting { public sealed class TokenCategorizer : MarshalByRefObject { private readonly TokenizerService _tokenizer; diff --git a/Scripting/IndexSpan.cs b/Scripting/IndexSpan.cs index 1c2fd3bd..af99f14c 100644 --- a/Scripting/IndexSpan.cs +++ b/Scripting/IndexSpan.cs @@ -4,13 +4,13 @@ using System; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// - /// This structure represents an immutable integer interval that describes a range of values, from Start to End. - /// - /// It is closed on the left and open on the right: [Start .. End). + /// This structure represents an immutable integer interval that describes a range of values, from Start to End. + /// + /// It is closed on the left and open on the right: [Start .. End). /// public readonly struct IndexSpan : IEquatable { public IndexSpan(int start, int length) { diff --git a/Scripting/InvalidImplementationException.cs b/Scripting/InvalidImplementationException.cs index 883a0c58..1b72e76e 100644 --- a/Scripting/InvalidImplementationException.cs +++ b/Scripting/InvalidImplementationException.cs @@ -5,7 +5,7 @@ using System; using System.Runtime.Serialization; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { [Serializable] public class InvalidImplementationException : Exception { public InvalidImplementationException() diff --git a/Scripting/LanguageOptions.cs b/Scripting/LanguageOptions.cs index da9ce2ef..63cd86d1 100644 --- a/Scripting/LanguageOptions.cs +++ b/Scripting/LanguageOptions.cs @@ -5,12 +5,12 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; using System.IO; using System.Threading; using System.Globalization; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { [Serializable] public class LanguageOptions { @@ -28,8 +28,8 @@ public class LanguageOptions { /// public bool NoAdaptiveCompilation { get { return _noAdaptiveCompilation; } - } - + } + /// /// The number of iterations before the interpreter starts compiling.s /// @@ -71,7 +71,7 @@ public ReadOnlyCollection SearchPaths { get { return _searchPaths; } } - public LanguageOptions() + public LanguageOptions() : this(null) { } @@ -94,7 +94,7 @@ public static T GetOption(IDictionary options, string name, T } return defaultValue; } - + /// /// Reads an option whose value is expected to be a collection of non-null strings. /// Reaturns a read-only copy of the option's value. diff --git a/Scripting/PlatformAdaptationLayer.cs b/Scripting/PlatformAdaptationLayer.cs index c56297f2..fb705eb0 100644 --- a/Scripting/PlatformAdaptationLayer.cs +++ b/Scripting/PlatformAdaptationLayer.cs @@ -11,9 +11,9 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { #if !FEATURE_PROCESS public class ExitProcessException : Exception { @@ -302,8 +302,8 @@ public virtual void SetEnvironmentVariable(string key, string value) { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2140:TransparentMethodsMustNotReferenceCriticalCodeFxCopRule")] [MethodImpl(MethodImplOptions.NoInlining)] private static void SetEmptyEnvironmentVariable(string key) { - // System.Environment.SetEnvironmentVariable interprets an empty value string as - // deleting the environment variable. So we use the native SetEnvironmentVariable + // System.Environment.SetEnvironmentVariable interprets an empty value string as + // deleting the environment variable. So we use the native SetEnvironmentVariable // function here which allows setting of the value to an empty string. // This will require high trust and will fail in sandboxed environments if (!NativeMethods.SetEnvironmentVariable(key, String.Empty)) { diff --git a/Scripting/Properties/AssemblyInfo.cs b/Scripting/Properties/AssemblyInfo.cs index 4a92b22b..b0d89a8c 100644 --- a/Scripting/Properties/AssemblyInfo.cs +++ b/Scripting/Properties/AssemblyInfo.cs @@ -8,13 +8,13 @@ using System.Runtime.InteropServices; using System.Security; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Microsoft.Scripting")] +[assembly: AssemblyTitle("Riverside.Scripting")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -31,6 +31,6 @@ [assembly: SecurityTransparent] -[assembly: InternalsVisibleTo("Microsoft.Scripting.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c10ce00dd2e0ce5046d68183d3ad035b47e92bf0ce7bcf8a03a217ca5d0b0c7db973fdf97579b52b502a23d4069dbf043389e1ab65a1d6c508a9837f3e2350f15e05cc63c0fc4b0410867a51919090e4c33f80203e9b0035b21c32bae20f98b068f90d99a50133a5336480d94039b176519f5fd8524765f33be43da65c4b68ba")] +[assembly: InternalsVisibleTo("Riverside.Scripting.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c10ce00dd2e0ce5046d68183d3ad035b47e92bf0ce7bcf8a03a217ca5d0b0c7db973fdf97579b52b502a23d4069dbf043389e1ab65a1d6c508a9837f3e2350f15e05cc63c0fc4b0410867a51919090e4c33f80203e9b0035b21c32bae20f98b068f90d99a50133a5336480d94039b176519f5fd8524765f33be43da65c4b68ba")] [assembly: AllowPartiallyTrustedCallers] diff --git a/Scripting/Microsoft.Scripting.csproj b/Scripting/Riverside.Scripting.csproj similarity index 100% rename from Scripting/Microsoft.Scripting.csproj rename to Scripting/Riverside.Scripting.csproj diff --git a/Scripting/Runtime/ContextId.cs b/Scripting/Runtime/ContextId.cs index c50cd593..2c9b220c 100644 --- a/Scripting/Runtime/ContextId.cs +++ b/Scripting/Runtime/ContextId.cs @@ -5,9 +5,9 @@ using System; using System.Collections.Generic; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// - /// Represents a language context. Typically there is at most 1 context + /// Represents a language context. Typically there is at most 1 context /// associated with each language, but some languages may use more than one context /// to identify code that should be treated differently. Contexts are used during /// member and operator lookup. diff --git a/Scripting/Runtime/DlrConfiguration.cs b/Scripting/Runtime/DlrConfiguration.cs index 586467cf..25f05d45 100644 --- a/Scripting/Runtime/DlrConfiguration.cs +++ b/Scripting/Runtime/DlrConfiguration.cs @@ -8,9 +8,9 @@ using System.Reflection; using System.Threading; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Singleton for each language. /// @@ -45,7 +45,7 @@ internal LanguageContext LoadLanguageContext(ScriptDomainManager domainManager, throw new InvalidOperationException( String.Format( "Failed to load language '{0}': assembly '{1}' does not contain type '{2}'", - DisplayName, + DisplayName, #if FEATURE_FILESYSTEM assembly.Location, #else @@ -57,7 +57,7 @@ internal LanguageContext LoadLanguageContext(ScriptDomainManager domainManager, if (!type.IsSubclassOf(typeof(LanguageContext))) { throw new InvalidOperationException( - $"Failed to load language '{DisplayName}': type '{type}' is not a valid language provider because it does not inherit from LanguageContext"); + $"Failed to load language '{DisplayName}': type '{type}' is not a valid language provider because it does not inherit from LanguageContext"); } LanguageContext context; @@ -65,7 +65,7 @@ internal LanguageContext LoadLanguageContext(ScriptDomainManager domainManager, context = (LanguageContext)Activator.CreateInstance(type, new object[] { domainManager, _options }); } catch (TargetInvocationException e) { throw new TargetInvocationException( - $"Failed to load language '{DisplayName}': {e.InnerException.Message}", + $"Failed to load language '{DisplayName}': {e.InnerException.Message}", e.InnerException ); } catch (Exception e) { @@ -111,7 +111,7 @@ public DlrConfiguration(bool debugMode, bool privateBinding, IDictionary /// Gets a value indicating whether the application is in debug mode. /// This means: - /// + /// /// 1) Symbols are emitted for debuggable methods (methods associated with SourceUnit). /// 2) Debuggable methods are emitted to non-collectable types (this is due to CLR limitations on dynamic method debugging). /// 3) JIT optimization is disabled for all methods @@ -133,7 +133,7 @@ public void AddLanguage(string languageTypeName, string displayName, IList names, IList fileExtensions, + internal void AddLanguage(string languageTypeName, string displayName, IList names, IList fileExtensions, IDictionary options, string paramName) { ContractUtils.Requires(!_frozen, "Configuration cannot be modified once the runtime is initialized"); ContractUtils.Requires( @@ -239,7 +239,7 @@ public string[] GetLanguageNames(LanguageContext context) { ContractUtils.RequiresNotNull(context, nameof(context)); List result = new List(); - + foreach (var entry in _languageNames) { if (entry.Value.LanguageContext == context) { result.Add(entry.Key); diff --git a/Scripting/Runtime/DocumentationProvider.cs b/Scripting/Runtime/DocumentationProvider.cs index 61b51009..efb128f6 100644 --- a/Scripting/Runtime/DocumentationProvider.cs +++ b/Scripting/Runtime/DocumentationProvider.cs @@ -4,9 +4,9 @@ using System.Collections.Generic; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting.Hosting; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Provides language specific documentation for live objects. /// diff --git a/Scripting/Runtime/DynamicOperations.Generated.cs b/Scripting/Runtime/DynamicOperations.Generated.cs index 499f23e6..1d8a15e2 100644 --- a/Scripting/Runtime/DynamicOperations.Generated.cs +++ b/Scripting/Runtime/DynamicOperations.Generated.cs @@ -11,9 +11,9 @@ using System; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public sealed partial class DynamicOperations { private const int /*$$*/PregeneratedInvokerCount = 14; @@ -68,7 +68,7 @@ private Func EmitIn private static Func GetPregeneratedInvoker(int paramCount) { switch (paramCount) { -#if GENERATOR +#if GENERATOR def generate; $PregeneratedInvokerCount.times { |n| @n = n + 1; super }; end def n; @n; end def objects; "object, " * @n; end diff --git a/Scripting/Runtime/DynamicOperations.cs b/Scripting/Runtime/DynamicOperations.cs index b80b0d5d..e7412c52 100644 --- a/Scripting/Runtime/DynamicOperations.cs +++ b/Scripting/Runtime/DynamicOperations.cs @@ -10,17 +10,17 @@ using System.Reflection; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// - /// ObjectOperations provide a large catalogue of object operations such as member access, conversions, + /// ObjectOperations provide a large catalogue of object operations such as member access, conversions, /// indexing, and things like addition. There are several introspection and tool support services available - /// for more advanced hosts. - /// - /// You get ObjectOperation instances from ScriptEngine, and they are bound to their engines for the semantics - /// of the operations. There is a default instance of ObjectOperations you can share across all uses of the + /// for more advanced hosts. + /// + /// You get ObjectOperation instances from ScriptEngine, and they are bound to their engines for the semantics + /// of the operations. There is a default instance of ObjectOperations you can share across all uses of the /// engine. However, very advanced hosts can create new instances. /// public sealed partial class DynamicOperations { @@ -58,14 +58,14 @@ public DynamicOperations(LanguageContext lc) { /// /// Calls the provided object with the given parameters and returns the result. - /// - /// The prefered way of calling objects is to convert the object to a strongly typed delegate + /// + /// The prefered way of calling objects is to convert the object to a strongly typed delegate /// using the ConvertTo methods and then invoking that delegate. /// public object Invoke(object obj, params object[] parameters) { return GetInvoker(parameters.Length)(this, _lc.CreateInvokeBinder(new CallInfo(parameters.Length)), obj, parameters); } - + /// /// Invokes a member on the provided object with the given parameters and returns the result. /// @@ -103,7 +103,7 @@ public T GetMember(object obj, string name) { } /// - /// Gets the member name from the object obj. Returns true if the member is successfully retrieved and + /// Gets the member name from the object obj. Returns true if the member is successfully retrieved and /// stores the value in the value out param. /// public bool TryGetMember(object obj, string name, out object value) { @@ -158,7 +158,7 @@ public T GetMember(object obj, string name, bool ignoreCase) { } /// - /// Gets the member name from the object obj. Returns true if the member is successfully retrieved and + /// Gets the member name from the object obj. Returns true if the member is successfully retrieved and /// stores the value in the value out param. /// public bool TryGetMember(object obj, string name, bool ignoreCase, out object value) { @@ -213,7 +213,7 @@ public T ConvertTo(object obj) { return site.Target(site, obj); } - /// + /// /// Converts the object obj to the type type. The conversion will be explicit or implicit /// depending on what the langauge prefers. /// @@ -239,7 +239,7 @@ public object ConvertTo(object obj, Type type) { /// /// Converts the object obj to the type T. Returns true if the value can be converted, false if it cannot. - /// + /// /// The conversion will be explicit or implicit depending on what the langauge prefers. /// public bool TryConvertTo(object obj, out T result) { @@ -257,7 +257,7 @@ public bool TryConvertTo(object obj, out T result) { /// /// Converts the object obj to the type type. Returns true if the value can be converted, false if it cannot. - /// + /// /// The conversion will be explicit or implicit depending on what the langauge prefers. /// public bool TryConvertTo(object obj, Type type, out object result) { @@ -290,8 +290,8 @@ public object ExplicitConvertTo(object obj, Type type) { } /// - /// Converts the object obj to the type type including explicit conversions which may lose information. - /// + /// Converts the object obj to the type type including explicit conversions which may lose information. + /// /// Returns true if the value can be converted, false if it cannot. /// public bool TryExplicitConvertTo(object obj, Type type, out object result) { @@ -340,8 +340,8 @@ public object ImplicitConvertTo(object obj, Type type) { } /// - /// Converts the object obj to the type type including implicit conversions. - /// + /// Converts the object obj to the type type including implicit conversions. + /// /// Returns true if the value can be converted, false if it cannot. /// public bool TryImplicitConvertTo(object obj, Type type, out object result) { @@ -389,7 +389,7 @@ public TResult DoOperation(ExpressionType operation, T var site = GetOrCreateSite(_lc.CreateBinaryOperationBinder(operation)); return site.Target(site, target, other); } - + public string GetDocumentation(object o) { return _lc.GetDocumentation(o); } @@ -401,7 +401,7 @@ public IList GetCallSignatures(object o) { public bool IsCallable(object o) { return _lc.IsCallable(o); } - + /// /// Returns a list of strings which contain the known members of the object. /// @@ -534,7 +534,7 @@ private void CleanupNoLock() { toRemove.Add(sk); if (toRemove.Count > StopCleanupThreshold) { // if we have a setup like weight(100), weight(1), weight(1), weight(1), ... we don't want - // to just run through and remove all of the weight(1)'s. + // to just run through and remove all of the weight(1)'s. break; } } @@ -546,7 +546,7 @@ private void CleanupNoLock() { _sites.Remove(sk); } - // reset all hit counts so the next time through is fair + // reset all hit counts so the next time through is fair // to newly added members which may take precedence. foreach (SiteKey sk in _sites.Keys) { sk.HitCount = 0; @@ -558,8 +558,8 @@ private void CleanupNoLock() { /// /// Helper class for tracking all of our unique dynamic sites and their /// usage patterns. We hash on the combination of the binder and site type. - /// - /// We also track the hit count and the key holds the site associated w/ the + /// + /// We also track the hit count and the key holds the site associated w/ the /// key. Logically this is a set based upon the binder and site-type but we /// store it in a dictionary. /// diff --git a/Scripting/Runtime/DynamicRuntimeHostingProvider.cs b/Scripting/Runtime/DynamicRuntimeHostingProvider.cs index 4e8eb2c0..322fb6aa 100644 --- a/Scripting/Runtime/DynamicRuntimeHostingProvider.cs +++ b/Scripting/Runtime/DynamicRuntimeHostingProvider.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// DLR requires any Hosting API provider to implement this class and provide its instance upon Runtime initialization. /// DLR calls on it to perform basic host/system dependent operations. diff --git a/Scripting/Runtime/DynamicStackFrame.cs b/Scripting/Runtime/DynamicStackFrame.cs index a061e8e7..0b92608b 100644 --- a/Scripting/Runtime/DynamicStackFrame.cs +++ b/Scripting/Runtime/DynamicStackFrame.cs @@ -5,7 +5,7 @@ using System; using System.Reflection; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Helper for storing information about stack frames. /// diff --git a/Scripting/Runtime/InvariantContext.cs b/Scripting/Runtime/InvariantContext.cs index 8065704b..849e8cb5 100644 --- a/Scripting/Runtime/InvariantContext.cs +++ b/Scripting/Runtime/InvariantContext.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Singleton LanguageContext which represents a language-neutral LanguageContext /// diff --git a/Scripting/Runtime/LanguageBoundTextContentProvider.cs b/Scripting/Runtime/LanguageBoundTextContentProvider.cs index b486c127..ca75180c 100644 --- a/Scripting/Runtime/LanguageBoundTextContentProvider.cs +++ b/Scripting/Runtime/LanguageBoundTextContentProvider.cs @@ -5,9 +5,9 @@ using System.IO; using System.Text; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Internal class which binds a LanguageContext, StreamContentProvider, and Encoding together to produce /// a TextContentProvider which reads binary data with the correct language semantics. diff --git a/Scripting/Runtime/LanguageContext.cs b/Scripting/Runtime/LanguageContext.cs index 13e3d48d..2cee7c4b 100644 --- a/Scripting/Runtime/LanguageContext.cs +++ b/Scripting/Runtime/LanguageContext.cs @@ -11,9 +11,9 @@ using System.Text; using System.Threading; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Provides language specific facilities which are typically called by the runtime. /// @@ -26,10 +26,10 @@ protected LanguageContext(ScriptDomainManager domainManager) { DomainManager = domainManager; ContextId = domainManager.GenerateContextId(); } - + /// /// Provides the ContextId which includes members that should only be shown for this LanguageContext. - /// + /// /// ContextId's are used for filtering by Scope's. /// public ContextId ContextId { get; } @@ -59,19 +59,19 @@ public virtual Scope GetScope(string path) { public virtual Scope CreateScope() { return new Scope(); } - + /// /// Creates a new ScriptScope whose storage contains the provided dictionary of objects - /// + /// /// Accesses to the ScriptScope will turn into get,set, and delete members against this dictionary /// public virtual Scope CreateScope(IDictionary dictionary) { return new Scope(dictionary); } - + /// /// Creates a new ScriptScope whose storage is an arbitrary object. - /// + /// /// Accesses to the ScriptScope will turn into get, set, and delete members against the object. /// public virtual Scope CreateScope(IDynamicMetaObjectProvider storage) { @@ -100,12 +100,12 @@ public virtual ScopeExtension CreateScopeExtension(Scope scope) { } /// - /// Provides access to setting variables in scopes. - /// - /// By default this goes through ObjectOperations which can be rather slow. - /// Languages can override this to provide fast customized access which avoids - /// ObjectOperations. Languages can provide fast access to commonly used scope - /// types for that language. Typically this includes ScopeStorage and any other + /// Provides access to setting variables in scopes. + /// + /// By default this goes through ObjectOperations which can be rather slow. + /// Languages can override this to provide fast customized access which avoids + /// ObjectOperations. Languages can provide fast access to commonly used scope + /// types for that language. Typically this includes ScopeStorage and any other /// classes which the language themselves uses for backing of a Scope. /// public virtual void ScopeSetVariable(Scope scope, string name, object value) { @@ -113,12 +113,12 @@ public virtual void ScopeSetVariable(Scope scope, string name, object value) { } /// - /// Provides access to try getting variables in scopes. - /// - /// By default this goes through ObjectOperations which can be rather slow. - /// Languages can override this to provide fast customized access which avoids - /// ObjectOperations. Languages can provide fast access to commonly used scope - /// types for that language. Typically this includes ScopeStorage and any other + /// Provides access to try getting variables in scopes. + /// + /// By default this goes through ObjectOperations which can be rather slow. + /// Languages can override this to provide fast customized access which avoids + /// ObjectOperations. Languages can provide fast access to commonly used scope + /// types for that language. Typically this includes ScopeStorage and any other /// classes which the language themselves uses for backing of a Scope. /// public virtual bool ScopeTryGetVariable(Scope scope, string name, out dynamic value) { @@ -127,11 +127,11 @@ public virtual bool ScopeTryGetVariable(Scope scope, string name, out dynamic va /// /// Provides access to getting variables in scopes and converting the result. - /// - /// By default this goes through ObjectOperations which can be rather slow. - /// Languages can override this to provide fast customized access which avoids - /// ObjectOperations. Languages can provide fast access to commonly used scope - /// types for that language. Typically this includes ScopeStorage and any other + /// + /// By default this goes through ObjectOperations which can be rather slow. + /// Languages can override this to provide fast customized access which avoids + /// ObjectOperations. Languages can provide fast access to commonly used scope + /// types for that language. Typically this includes ScopeStorage and any other /// classes which the language themselves uses for backing of a Scope. /// public virtual T ScopeGetVariable(Scope scope, string name) { @@ -140,11 +140,11 @@ public virtual T ScopeGetVariable(Scope scope, string name) { /// /// Provides access to getting variables in scopes. - /// - /// By default this goes through ObjectOperations which can be rather slow. - /// Languages can override this to provide fast customized access which avoids - /// ObjectOperations. Languages can provide fast access to commonly used scope - /// types for that language. Typically this includes ScopeStorage and any other + /// + /// By default this goes through ObjectOperations which can be rather slow. + /// Languages can override this to provide fast customized access which avoids + /// ObjectOperations. Languages can provide fast access to commonly used scope + /// types for that language. Typically this includes ScopeStorage and any other /// classes which the language themselves uses for backing of a Scope. /// public virtual dynamic ScopeGetVariable(Scope scope, string name) { @@ -190,7 +190,7 @@ public virtual CompilerOptions GetCompilerOptions(Scope scope) { } /// - /// Parses the source code within a specified compiler context. + /// Parses the source code within a specified compiler context. /// The source unit to parse is held on by the context. /// /// null on failure. @@ -258,7 +258,7 @@ public virtual string FormatException(Exception exception) { public virtual IList GetStackFrames(Exception exception) { return Array.Empty(); } - + public virtual LanguageOptions Options => new LanguageOptions(); #region Source Units @@ -313,18 +313,18 @@ public SourceUnit CreateSourceUnit(TextContentProvider contentProvider, string p return new SourceUnit(this, contentProvider, path, kind); } - + #endregion - + #endregion - + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] public virtual ErrorSink GetCompilerErrorSink() { return ErrorSink.Null; } - + #region Object Operations Support internal static DynamicMetaObject ErrorMetaObject(Type resultType, DynamicMetaObject target, DynamicMetaObject[] args, DynamicMetaObject errorSuggestion) { @@ -393,10 +393,10 @@ public override DynamicMetaObject FallbackConvert(DynamicMetaObject self, Dynami /// /// Creates a conversion binder. - /// + /// /// If explicitCast is true then the binder should do explicit conversions. /// If explicitCast is false then the binder should do implicit conversions. - /// + /// /// If explicitCast is null it is up to the language to select the conversions /// which closest match their normal behavior. /// diff --git a/Scripting/Runtime/NotNullAttribute.cs b/Scripting/Runtime/NotNullAttribute.cs index 9401b741..5289c363 100644 --- a/Scripting/Runtime/NotNullAttribute.cs +++ b/Scripting/Runtime/NotNullAttribute.cs @@ -4,10 +4,10 @@ using System; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// This attribute marks a parameter that is not allowed to be null. - /// It is used by the method binding infrastructure to generate better error + /// It is used by the method binding infrastructure to generate better error /// messages and method selection. /// [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] @@ -16,7 +16,7 @@ public sealed class NotNullAttribute : Attribute { /// /// This attribute marks a parameter whose type is an array that is not allowed to have null items. - /// It is used by the method binding infrastructure to generate better error + /// It is used by the method binding infrastructure to generate better error /// messages and method selection. /// [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] diff --git a/Scripting/Runtime/ObjectDictionaryExpando.cs b/Scripting/Runtime/ObjectDictionaryExpando.cs index 04a6b98c..db077eaa 100644 --- a/Scripting/Runtime/ObjectDictionaryExpando.cs +++ b/Scripting/Runtime/ObjectDictionaryExpando.cs @@ -6,7 +6,7 @@ using System.Dynamic; using System.Linq.Expressions; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Wraps a an IDictionary[object, object] and exposes it as an IDynamicMetaObjectProvider so that /// users can access string attributes using member accesses. diff --git a/Scripting/Runtime/ParamDictionaryAttribute.cs b/Scripting/Runtime/ParamDictionaryAttribute.cs index bae6c30f..1e642e48 100644 --- a/Scripting/Runtime/ParamDictionaryAttribute.cs +++ b/Scripting/Runtime/ParamDictionaryAttribute.cs @@ -4,12 +4,12 @@ using System; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// This attribute is used to mark a parameter that can accept any keyword arguments that /// are not bound to normal parameters. The extra keyword arguments will be /// passed in a dictionary which is created for the call. - /// + /// /// Most languages which support params dictionaries will support the following types: /// /// IReadOnlyDictionary<string, anything>
@@ -20,10 +20,10 @@ namespace Microsoft.Scripting { /// Dictionary<object, anything>
/// IDictionary ///
- /// + /// /// For languages which don't have language level support the user will be required to /// create and populate the dictionary by hand. - /// + /// /// This attribute is the dictionary equivalent of the System.ParamArrayAttribute. ///
/// @@ -32,11 +32,11 @@ namespace Microsoft.Scripting { /// Console.WriteLine("Key: {0} Value: {1}", v.Key, v.Value); /// } /// } - /// + /// /// Called from Python: - /// + /// /// KeywordArgFunction(a = 2, b = "abc") - /// + /// /// will print: /// Key: a Value = 2 /// Key: b Value = abc diff --git a/Scripting/Runtime/ParserSink.cs b/Scripting/Runtime/ParserSink.cs index b90a9269..c74a6e14 100644 --- a/Scripting/Runtime/ParserSink.cs +++ b/Scripting/Runtime/ParserSink.cs @@ -2,13 +2,13 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public class ParserSink { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public static readonly ParserSink Null = new ParserSink(); - + public virtual void MatchPair(SourceSpan opening, SourceSpan closing, int priority) { } diff --git a/Scripting/Runtime/Scope.cs b/Scripting/Runtime/Scope.cs index 6a748222..9f4968f4 100644 --- a/Scripting/Runtime/Scope.cs +++ b/Scripting/Runtime/Scope.cs @@ -7,18 +7,18 @@ using System.Dynamic; using System.Linq.Expressions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Represents a host-provided variables for executable code. The variables are /// typically backed by a host-provided dictionary. Languages can also associate per-language /// information with the context by using scope extensions. This can be used for tracking - /// state which is used across multiple executions, for providing custom forms of + /// state which is used across multiple executions, for providing custom forms of /// storage (for example object keyed access), or other language specific semantics. - /// + /// /// Scope objects are thread-safe as long as their underlying storage is thread safe. - /// + /// /// Script hosts can choose to use thread safe or thread unsafe modules but must be sure /// to constrain the code they right to be single-threaded if using thread unsafe /// storage. @@ -29,7 +29,7 @@ public sealed class Scope : IDynamicMetaObjectProvider { private readonly IDynamicMetaObjectProvider _storage; /// - /// Creates a new scope with a new empty thread-safe dictionary. + /// Creates a new scope with a new empty thread-safe dictionary. /// public Scope() { _extensions = ScopeExtension.EmptyArray; @@ -56,10 +56,10 @@ public Scope(IDynamicMetaObjectProvider storage) { public ScopeExtension GetExtension(ContextId languageContextId) { return (languageContextId.Id < _extensions.Length) ? _extensions[languageContextId.Id] : null; } - + /// - /// Sets the ScopeExtension to the provided value for the given ContextId. - /// + /// Sets the ScopeExtension to the provided value for the given ContextId. + /// /// The extension can only be set once. The returned value is either the new ScopeExtension /// if no value was previously set or the previous value. /// @@ -90,7 +90,7 @@ public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, Dy return Restrict(StorageMetaObject.BindInvokeMember(binder, args)); } - public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value) { + public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value) { return Restrict(StorageMetaObject.BindSetMember(binder, value)); } diff --git a/Scripting/Runtime/ScopeExtension.cs b/Scripting/Runtime/ScopeExtension.cs index f1e064a5..d9dc0267 100644 --- a/Scripting/Runtime/ScopeExtension.cs +++ b/Scripting/Runtime/ScopeExtension.cs @@ -2,9 +2,9 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { // TODO: this class should be abstract public class ScopeExtension { diff --git a/Scripting/Runtime/ScopeStorage.cs b/Scripting/Runtime/ScopeStorage.cs index e9ebb40a..7e6a1ec9 100644 --- a/Scripting/Runtime/ScopeStorage.cs +++ b/Scripting/Runtime/ScopeStorage.cs @@ -8,9 +8,9 @@ using System.Linq.Expressions; using System.Threading; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// Provides optimized and cacheable support for scope storage. /// diff --git a/Scripting/Runtime/ScriptCode.cs b/Scripting/Runtime/ScriptCode.cs index 3fe75ed2..458d92b6 100644 --- a/Scripting/Runtime/ScriptCode.cs +++ b/Scripting/Runtime/ScriptCode.cs @@ -2,10 +2,10 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// ScriptCode is an instance of compiled code that is bound to a specific LanguageContext /// but not a specific ScriptScope. The code can be re-executed multiple times in different diff --git a/Scripting/Runtime/ScriptDomainManager.cs b/Scripting/Runtime/ScriptDomainManager.cs index 08ccbce1..6de3e767 100644 --- a/Scripting/Runtime/ScriptDomainManager.cs +++ b/Scripting/Runtime/ScriptDomainManager.cs @@ -7,9 +7,9 @@ using System.Reflection; using System.Threading; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")] // TODO: fix public sealed class ScriptDomainManager { private List _loadedAssemblies = new List(); @@ -125,7 +125,7 @@ public bool LoadAssembly(Assembly assembly) { return true; } - + public IList GetLoadedAssemblyList() { lock (_loadedAssemblies) { return _loadedAssemblies.ToArray(); diff --git a/Scripting/Runtime/SharedIO.cs b/Scripting/Runtime/SharedIO.cs index 346e1e9b..743628ad 100644 --- a/Scripting/Runtime/SharedIO.cs +++ b/Scripting/Runtime/SharedIO.cs @@ -6,9 +6,9 @@ using System.IO; using System.Text; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public sealed class SharedIO { public enum SupportLevel { diff --git a/Scripting/Runtime/SourceStringContentProvider.cs b/Scripting/Runtime/SourceStringContentProvider.cs index e37cb7e1..534afbd3 100644 --- a/Scripting/Runtime/SourceStringContentProvider.cs +++ b/Scripting/Runtime/SourceStringContentProvider.cs @@ -5,9 +5,9 @@ using System; using System.IO; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { [Serializable] internal sealed class SourceStringContentProvider : TextContentProvider { diff --git a/Scripting/Runtime/StreamContentProvider.cs b/Scripting/Runtime/StreamContentProvider.cs index cd51801b..cd3ce37e 100644 --- a/Scripting/Runtime/StreamContentProvider.cs +++ b/Scripting/Runtime/StreamContentProvider.cs @@ -5,14 +5,14 @@ using System; using System.IO; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// - /// Provides a factory to create streams over one source of binary content. - /// + /// Provides a factory to create streams over one source of binary content. + /// /// StreamContentProvider's are used when opening a file of an unknown encoding. The /// StreamContentProvider will be wrapped in a TextContentProvider provided by the language - /// which can support a language specific way of interpreting the binary data into text. - /// + /// which can support a language specific way of interpreting the binary data into text. + /// /// For example some languages allow a marker at the beginning of the file which specifies /// the encoding of the rest of the file. /// @@ -20,10 +20,10 @@ namespace Microsoft.Scripting { public abstract class StreamContentProvider { /// /// Creates a new Stream which is backed by the content the StreamContentProvider was created for. - /// + /// /// For example if the StreamContentProvider was backing a file then GetStream re-opens the file and returns /// the new stream. - /// + /// /// This method may be called multiple times. For example once to compile the code and again to get /// the source code to display error messages. /// diff --git a/Scripting/Runtime/StringDictionaryExpando.cs b/Scripting/Runtime/StringDictionaryExpando.cs index 005c55b2..188b828d 100644 --- a/Scripting/Runtime/StringDictionaryExpando.cs +++ b/Scripting/Runtime/StringDictionaryExpando.cs @@ -8,9 +8,9 @@ using System.Dynamic; using System.Linq.Expressions; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { /// /// Exposes a IDictionary[string, object] as a dynamic object. Gets/sets/deletes turn /// into accesses on the underlying dictionary. diff --git a/Scripting/Runtime/TokenInfo.cs b/Scripting/Runtime/TokenInfo.cs index 422f986c..01b118bd 100644 --- a/Scripting/Runtime/TokenInfo.cs +++ b/Scripting/Runtime/TokenInfo.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { [Serializable] public struct TokenInfo : IEquatable { diff --git a/Scripting/Runtime/TokenTriggers.cs b/Scripting/Runtime/TokenTriggers.cs index fcfbfcc3..dff85108 100644 --- a/Scripting/Runtime/TokenTriggers.cs +++ b/Scripting/Runtime/TokenTriggers.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// See also Microsoft.VisualStudio.Package.TokenTriggers. diff --git a/Scripting/Runtime/TokenizerService.cs b/Scripting/Runtime/TokenizerService.cs index f1ab98fc..101d6a4e 100644 --- a/Scripting/Runtime/TokenizerService.cs +++ b/Scripting/Runtime/TokenizerService.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.IO; -namespace Microsoft.Scripting.Runtime { +namespace Riverside.Scripting.Runtime { public abstract class TokenizerService { // static contract: diff --git a/Scripting/ScriptCodeParseResult.cs b/Scripting/ScriptCodeParseResult.cs index 7ce6e810..fb53a73d 100644 --- a/Scripting/ScriptCodeParseResult.cs +++ b/Scripting/ScriptCodeParseResult.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting { +namespace Riverside.Scripting { public enum ScriptCodeParseResult { /// /// Source code is a syntactically correct. @@ -13,7 +13,7 @@ public enum ScriptCodeParseResult { /// Source code represents an empty statement/expression. /// Empty, - + /// /// Source code is already invalid and no suffix can make it syntactically correct. /// diff --git a/Scripting/Severity.cs b/Scripting/Severity.cs index 4d84beeb..88890918 100644 --- a/Scripting/Severity.cs +++ b/Scripting/Severity.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting { +namespace Riverside.Scripting { public enum Severity { Ignore, Warning, diff --git a/Scripting/SourceCodeKind.cs b/Scripting/SourceCodeKind.cs index d7a29db3..5f11effc 100644 --- a/Scripting/SourceCodeKind.cs +++ b/Scripting/SourceCodeKind.cs @@ -4,7 +4,7 @@ using System.ComponentModel; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// Defines a kind of the source code. The parser sets its initial state accordingly. @@ -45,7 +45,7 @@ public enum SourceCodeKind { } } -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { public static partial class EnumBounds { public static bool IsValid(this SourceCodeKind value) { return value > SourceCodeKind.Unspecified && value <= SourceCodeKind.AutoDetect; diff --git a/Scripting/SourceCodeReader.cs b/Scripting/SourceCodeReader.cs index 045a8c96..6b09e17b 100644 --- a/Scripting/SourceCodeReader.cs +++ b/Scripting/SourceCodeReader.cs @@ -3,15 +3,15 @@ // See the LICENSE file in the project root for more information. using System.IO; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; using System.Text; using System; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// Source code reader. - /// + /// public class SourceCodeReader : TextReader { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public static new readonly SourceCodeReader Null = new SourceCodeReader(TextReader.Null, null); diff --git a/Scripting/SourceFileContentProvider.cs b/Scripting/SourceFileContentProvider.cs index b90f54b6..ae66d2fe 100644 --- a/Scripting/SourceFileContentProvider.cs +++ b/Scripting/SourceFileContentProvider.cs @@ -10,9 +10,9 @@ using System; using System.IO; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// Provides a StreamContentProvider for a stream of content backed by a file on disk. diff --git a/Scripting/SourceLocation.cs b/Scripting/SourceLocation.cs index 13b5b731..271241b8 100644 --- a/Scripting/SourceLocation.cs +++ b/Scripting/SourceLocation.cs @@ -5,7 +5,7 @@ using System; using System.Globalization; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// Represents a location in source code. /// @@ -146,7 +146,7 @@ public static int Compare(SourceLocation left, SourceLocation right) { /// A minimal valid location. /// public static readonly SourceLocation MinValue = new SourceLocation(0, 1, 1); - + /// /// Whether the location is a valid location. /// diff --git a/Scripting/SourceSpan.cs b/Scripting/SourceSpan.cs index 9e693057..0a154614 100644 --- a/Scripting/SourceSpan.cs +++ b/Scripting/SourceSpan.cs @@ -5,7 +5,7 @@ using System; using System.Globalization; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// Stores the location of a span of text in a source file. /// diff --git a/Scripting/SourceUnit.cs b/Scripting/SourceUnit.cs index 9693a9b0..af59fe15 100644 --- a/Scripting/SourceUnit.cs +++ b/Scripting/SourceUnit.cs @@ -8,11 +8,11 @@ using System.Collections.Generic; using System.Diagnostics; using System.Dynamic; -using Microsoft.Scripting.Runtime; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Runtime; +using Riverside.Scripting.Utils; using System.Text; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { [DebuggerDisplay("{DebugString}")] public sealed class SourceUnit { private readonly LanguageContext _language; @@ -24,7 +24,7 @@ public sealed class SourceUnit { private KeyValuePair[] _lineMap; /// - /// Identification of the source unit. Assigned by the host. + /// Identification of the source unit. Assigned by the host. /// The format and semantics is host dependent (could be a path on file system or URL). /// Empty string for anonymous source units. /// @@ -84,7 +84,7 @@ public SourceCodeReader GetReader() { } /// - /// Reads specified range of lines (or less) from the source unit. + /// Reads specified range of lines (or less) from the source unit. /// Line numbers starts with 1. /// public string[] GetCodeLines(int start, int count) { @@ -189,7 +189,7 @@ public ScriptCode Compile(ErrorSink errorSink) { } /// - /// Errors are reported to the specified sink. + /// Errors are reported to the specified sink. /// Returns null if the parser cannot compile the code due to error(s). /// public ScriptCode Compile(CompilerOptions options, ErrorSink errorSink) { diff --git a/Scripting/SyntaxErrorException.cs b/Scripting/SyntaxErrorException.cs index 4c65d4c8..c04629b8 100644 --- a/Scripting/SyntaxErrorException.cs +++ b/Scripting/SyntaxErrorException.cs @@ -5,10 +5,10 @@ using System; using System.Runtime.Serialization; using System.Dynamic; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; using System.Security; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { [Serializable] public class SyntaxErrorException : Exception { @@ -128,4 +128,4 @@ public string GetCodeLine() { return _sourceLine; } } -} \ No newline at end of file +} diff --git a/Scripting/TextContentProvider.cs b/Scripting/TextContentProvider.cs index c6fdeaed..0b882757 100644 --- a/Scripting/TextContentProvider.cs +++ b/Scripting/TextContentProvider.cs @@ -6,14 +6,14 @@ using System.IO; using System.Text; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { /// /// Provides a factory to create TextReader's over one source of textual content. - /// + /// /// TextContentProvider's are used when reading from a source which is already decoded - /// or has a known specific decoding. - /// + /// or has a known specific decoding. + /// /// For example a text editor might provide a TextContentProvider whose backing is /// an in-memory text buffer that the user can actively edit. /// @@ -22,7 +22,7 @@ public abstract class TextContentProvider { /// /// Creates a new TextReader which is backed by the content the TextContentProvider was created for. - /// + /// /// This method may be called multiple times. For example once to compile the code and again to get /// the source code to display error messages. /// diff --git a/Scripting/TokenCategory.cs b/Scripting/TokenCategory.cs index 778dc04c..fcf7920b 100644 --- a/Scripting/TokenCategory.cs +++ b/Scripting/TokenCategory.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting { +namespace Riverside.Scripting { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags")] public enum TokenCategory { @@ -42,7 +42,7 @@ public enum TokenCategory { /// A character literal. /// CharacterLiteral, - + /// /// A string literal. /// @@ -57,12 +57,12 @@ public enum TokenCategory { /// A keyword. /// Keyword, - + /// /// A directive (e.g. #line). /// Directive, - + /// /// A punctuation character that has a specific meaning in a language. /// @@ -77,7 +77,7 @@ public enum TokenCategory { /// An identifier (variable, $variable, @variable, @@variable, $variable$, function!, function?, [variable], i'variable', ...) /// Identifier, - + /// /// Braces, parenthesis, brackets. /// @@ -111,7 +111,7 @@ public enum TokenKind { NestableCommentEnd, // ]] // DocComments: - SingleLineDocComment, // + SingleLineDocComment, // MultiLineDocComment, // Ruby: =begin =end PHP: /** */ // Directives: @@ -122,8 +122,8 @@ public enum TokenKind { // Identifiers: Identifier, // identifier - VerbatimIdentifier, // PHP/CLR: i'...', - Variable, // Ruby: @identifier, @@identifier; PHP, Ruby: $identifier, + VerbatimIdentifier, // PHP/CLR: i'...', + Variable, // Ruby: @identifier, @@identifier; PHP, Ruby: $identifier, // Numbers: IntegerLiteral, @@ -151,9 +151,9 @@ public enum TokenKind { Dot, // . Semicolon, // ; Colon, // : - DoubleColon, // :: - TripleColon, // PHP/CLR: ::: - + DoubleColon, // :: + TripleColon, // PHP/CLR: ::: + // Operators: Plus, // + PlusPlus, // ++ @@ -172,7 +172,7 @@ public enum TokenKind { Power, // Python: ** PowerEqual, // Python, Ruby: **= LeftShift, // << - LeftShiftEqual, // <<= + LeftShiftEqual, // <<= RightShift, // >> RightShiftEqual, // >>= BitwiseAnd, // & @@ -194,12 +194,12 @@ public enum TokenKind { Assign, // = AssignAlias, // PHP: =& AssignColon, // := - Equal, // == + Equal, // == StrictEqual, // === Not, // ! NotEqual, // != StrictNotEqual, // !== - Unequal, // <> + Unequal, // <> CompareEqual, // Ruby: <=> Match, // =~ NotMatch, // !~ @@ -219,4 +219,4 @@ public enum TokenKind { LanguageDefined, } -} \ No newline at end of file +} diff --git a/Scripting/Utils/ArrayUtils.cs b/Scripting/Utils/ArrayUtils.cs index bd4b61e7..f6f9d394 100644 --- a/Scripting/Utils/ArrayUtils.cs +++ b/Scripting/Utils/ArrayUtils.cs @@ -7,7 +7,7 @@ using System.Diagnostics; using System.Text; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { internal static class ArrayUtils { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly")] public static readonly string[] EmptyStrings = EmptyArray.Instance; @@ -262,8 +262,8 @@ public static T[] InsertAt(T[] array, int index, params T[] items) { } /// - /// Converts a generic ICollection of T into an array of T. - /// + /// Converts a generic ICollection of T into an array of T. + /// /// If the collection is already an array of T the original collection is returned. /// public static T[] ToArray(ICollection list) { diff --git a/Scripting/Utils/AssemblyQualifiedTypeName.cs b/Scripting/Utils/AssemblyQualifiedTypeName.cs index 61d7c500..2c9e0d7a 100644 --- a/Scripting/Utils/AssemblyQualifiedTypeName.cs +++ b/Scripting/Utils/AssemblyQualifiedTypeName.cs @@ -5,7 +5,7 @@ using System; using System.Reflection; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { [Serializable] internal readonly struct AssemblyQualifiedTypeName : IEquatable { public readonly string TypeName; @@ -47,7 +47,7 @@ public AssemblyQualifiedTypeName(string assemblyQualifiedTypeName) { } internal static AssemblyQualifiedTypeName ParseArgument(string str, string argumentName) { - Assert.NotEmpty(argumentName); + Assert.NotEmpty(argumentName); try { return new AssemblyQualifiedTypeName(str); } catch (ArgumentException e) { diff --git a/Scripting/Utils/Assert.cs b/Scripting/Utils/Assert.cs index d9258d86..fa835717 100644 --- a/Scripting/Utils/Assert.cs +++ b/Scripting/Utils/Assert.cs @@ -8,7 +8,7 @@ using System.Collections.Generic; using System.Diagnostics; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { internal static class Assert { [Conditional("DEBUG")] public static void NotNull(object var) { diff --git a/Scripting/Utils/CollectionExtensions.cs b/Scripting/Utils/CollectionExtensions.cs index 1c01a962..87d8b19a 100644 --- a/Scripting/Utils/CollectionExtensions.cs +++ b/Scripting/Utils/CollectionExtensions.cs @@ -7,11 +7,11 @@ using System.Collections.ObjectModel; using System.Diagnostics; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { internal static class CollectionExtensions { /// /// Wraps the provided enumerable into a ReadOnlyCollection{T} - /// + /// /// Copies all of the data into a new array, so the data can't be /// changed after creation. The exception is if the enumerable is /// already a ReadOnlyCollection{T}, in which case we just return it. @@ -48,7 +48,7 @@ internal static T[] ToArray(this IEnumerable enumerable) { return new List(enumerable).ToArray(); } - + internal static bool Any(this IEnumerable source, Func predicate) { foreach (T element in source) { if (predicate(element)) { diff --git a/Scripting/Utils/ConsoleInputStream.cs b/Scripting/Utils/ConsoleInputStream.cs index 21797ac0..70e5de25 100644 --- a/Scripting/Utils/ConsoleInputStream.cs +++ b/Scripting/Utils/ConsoleInputStream.cs @@ -8,7 +8,7 @@ using System.IO; using System.Diagnostics; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { /// /// Console input stream (Console.OpenStandardInput) has a bug that manifests itself if reading small amounts of data. /// This class wraps the standard input stream with a buffer that ensures that enough data are read from the underlying stream. @@ -17,7 +17,7 @@ public sealed class ConsoleInputStream : Stream { public static readonly ConsoleInputStream Instance = new ConsoleInputStream(); // we use 0x1000 to be safe (MSVCRT uses this value for stdin stream buffer). - private const int MinimalBufferSize = 0x1000; + private const int MinimalBufferSize = 0x1000; private readonly Stream _input; private readonly object _lock = new object(); diff --git a/Scripting/Utils/ConsoleStreamType.cs b/Scripting/Utils/ConsoleStreamType.cs index d033c037..7782161e 100644 --- a/Scripting/Utils/ConsoleStreamType.cs +++ b/Scripting/Utils/ConsoleStreamType.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { public enum ConsoleStreamType { Input, Output, diff --git a/Scripting/Utils/ContractUtils.cs b/Scripting/Utils/ContractUtils.cs index c80db787..905efb0d 100644 --- a/Scripting/Utils/ContractUtils.cs +++ b/Scripting/Utils/ContractUtils.cs @@ -7,7 +7,7 @@ using System.Collections.Generic; using System.Diagnostics; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { internal static class ContractUtils { public static void RequiresNotNull(object value, string paramName) { Assert.NotEmpty(paramName); diff --git a/Scripting/Utils/DelegateUtils.cs b/Scripting/Utils/DelegateUtils.cs index 302dc1c2..0af25de2 100644 --- a/Scripting/Utils/DelegateUtils.cs +++ b/Scripting/Utils/DelegateUtils.cs @@ -13,15 +13,15 @@ using System.Text; using System.Threading; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { internal static class DelegateUtils { private static AssemblyBuilder _assembly; private static ModuleBuilder _modBuilder; private static int _typeCount; private static readonly Type[] _DelegateCtorSignature = new Type[] { typeof(object), typeof(IntPtr) }; - // Generic type names have the arity (number of generic type paramters) appended at the end. - // For eg. the mangled name of System.List is "List`1". This mangling is done to enable multiple + // Generic type names have the arity (number of generic type paramters) appended at the end. + // For eg. the mangled name of System.List is "List`1". This mangling is done to enable multiple // generic types to exist as long as they have different arities. public const char GenericArityDelimiter = '`'; @@ -43,7 +43,7 @@ private static TypeBuilder DefineDelegateType(string name) { return _modBuilder.DefineType( name + Interlocked.Increment(ref _typeCount), - TypeAttributes.Class | TypeAttributes.Public | TypeAttributes.Sealed | TypeAttributes.AnsiClass | TypeAttributes.AutoClass, + TypeAttributes.Class | TypeAttributes.Public | TypeAttributes.Sealed | TypeAttributes.AnsiClass | TypeAttributes.AutoClass, typeof(MulticastDelegate) ); } @@ -55,7 +55,7 @@ private static TypeBuilder DefineDelegateType(string name) { internal static Type EmitCallSiteDelegateType(int paramCount) { Debug.Assert(paramCount > 14); Type[] paramTypes = new Type[paramCount + 2]; - + paramTypes[0] = typeof(CallSite); paramTypes[1] = typeof(object); for (int i = 0; i < paramCount; i++) { diff --git a/Scripting/Utils/ExceptionFactory.Generated.cs b/Scripting/Utils/ExceptionFactory.Generated.cs index 541c563a..00d3f7b7 100644 --- a/Scripting/Utils/ExceptionFactory.Generated.cs +++ b/Scripting/Utils/ExceptionFactory.Generated.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting { +namespace Riverside.Scripting { internal static partial class Strings { private static string FormatString(string format, params object[] args) { @@ -12,7 +12,7 @@ private static string FormatString(string format, params object[] args) { } } - #region Generated Microsoft.Scripting Exception Factory + #region Generated Riverside.Scripting Exception Factory // *** BEGIN GENERATED CODE *** // generated by function: gen_expr_factory_scripting from: generate_exception_factory.py diff --git a/Scripting/Utils/ExceptionUtils.cs b/Scripting/Utils/ExceptionUtils.cs index ad0d3db9..2bfdf838 100644 --- a/Scripting/Utils/ExceptionUtils.cs +++ b/Scripting/Utils/ExceptionUtils.cs @@ -4,7 +4,7 @@ using System; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { internal static class ExceptionUtils { public static ArgumentNullException MakeArgumentItemNullException(int index, string arrayName) { return new ArgumentNullException($"{arrayName}[{index}]"); diff --git a/Scripting/Utils/ExpressionUtils.cs b/Scripting/Utils/ExpressionUtils.cs index d5e9166c..2e018bb8 100644 --- a/Scripting/Utils/ExpressionUtils.cs +++ b/Scripting/Utils/ExpressionUtils.cs @@ -6,7 +6,7 @@ using System; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { internal sealed class ExpressionUtils { internal static Expression Convert(Expression expression, Type type) { return (expression.Type != type) ? Expression.Convert(expression, type) : expression; diff --git a/Scripting/Utils/NativeMethods.cs b/Scripting/Utils/NativeMethods.cs index 9c04beb6..210d5bc5 100644 --- a/Scripting/Utils/NativeMethods.cs +++ b/Scripting/Utils/NativeMethods.cs @@ -7,7 +7,7 @@ using System; using System.Runtime.InteropServices; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { internal static class NativeMethods { [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError=true)] [return: MarshalAs(UnmanagedType.Bool)] diff --git a/Scripting/Utils/ReflectionUtils.cs b/Scripting/Utils/ReflectionUtils.cs index 198134ec..feb6d991 100644 --- a/Scripting/Utils/ReflectionUtils.cs +++ b/Scripting/Utils/ReflectionUtils.cs @@ -8,7 +8,7 @@ using System.Collections.Generic; using System.Reflection.Emit; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { internal static class ReflectionUtils { public static MethodInfo GetMethodInfo(this Delegate d) { return d.Method; diff --git a/Scripting/Utils/TextStream.cs b/Scripting/Utils/TextStream.cs index 0662622b..0041736a 100644 --- a/Scripting/Utils/TextStream.cs +++ b/Scripting/Utils/TextStream.cs @@ -6,7 +6,7 @@ using System.IO; using System.Text; -namespace Microsoft.Scripting.Utils { +namespace Riverside.Scripting.Utils { internal abstract class TextStreamBase : Stream { private readonly bool _buffered; diff --git a/Tests/ClrAssembly/ClrAssembly.csproj b/Tests/ClrAssembly/ClrAssembly.csproj index fda286cd..59de3c25 100644 --- a/Tests/ClrAssembly/ClrAssembly.csproj +++ b/Tests/ClrAssembly/ClrAssembly.csproj @@ -125,7 +125,7 @@ - + diff --git a/Tests/ClrAssembly/Src/dynamicobjmodel.cs b/Tests/ClrAssembly/Src/dynamicobjmodel.cs index d37c6d41..ddb7451c 100644 --- a/Tests/ClrAssembly/Src/dynamicobjmodel.cs +++ b/Tests/ClrAssembly/Src/dynamicobjmodel.cs @@ -7,7 +7,7 @@ using System; using System.Runtime.CompilerServices; using System.Collections.Generic; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Runtime; namespace Merlin.Testing.DynamicObjectModel { diff --git a/Tests/ClrAssembly/Src/methodargs.cs b/Tests/ClrAssembly/Src/methodargs.cs index 29b76e94..3d990101 100644 --- a/Tests/ClrAssembly/Src/methodargs.cs +++ b/Tests/ClrAssembly/Src/methodargs.cs @@ -8,7 +8,7 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using Merlin.Testing.TypeSample; -using Microsoft.Scripting; +using Riverside.Scripting; namespace Merlin.Testing.Call { public class VariousParameters { diff --git a/Tests/HostingTest/CompiledCodeTest.cs b/Tests/HostingTest/CompiledCodeTest.cs index 8ddf3d7d..8cc218bd 100644 --- a/Tests/HostingTest/CompiledCodeTest.cs +++ b/Tests/HostingTest/CompiledCodeTest.cs @@ -4,12 +4,12 @@ using System; using System.Dynamic; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting.Hosting; using NUnit.Framework; -using Microsoft.Scripting; +using Riverside.Scripting; namespace HostingTest { - using Microsoft.Scripting.Runtime; + using Riverside.Scripting.Runtime; class MyErrorListener : ErrorListener { public ScriptSource _source; @@ -107,7 +107,7 @@ public void Execute_AccessVarPreDefinedInScope() { /// /// Test : Validate that file is only re-read on Execute, change file between Executes /// Expected : Validate that Executes have updated source. - /// + /// /// Note : A new test case based on spec for compiledcode /// [Test] @@ -120,8 +120,8 @@ public void Execute_ValidateFileIsReReadOnExecute() { /// /// Test : Engine Property is accessible from Compiled scope /// Expected : Engine is same as engine that created scope, source, etc - /// - /// Note : validate the scope value is the same in the engine as the + /// + /// Note : validate the scope value is the same in the engine as the /// scope. /// [Test] diff --git a/Tests/HostingTest/HAPITestBase.cs b/Tests/HostingTest/HAPITestBase.cs index ef789860..4ddeefed 100644 --- a/Tests/HostingTest/HAPITestBase.cs +++ b/Tests/HostingTest/HAPITestBase.cs @@ -2,13 +2,13 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -using Microsoft.Scripting.Hosting; +using Riverside.Scripting.Hosting; using IronRuby.Runtime; using NUnit.Framework; using System; using System.Diagnostics; using System.IO; -using Microsoft.Scripting.Generation; +using Riverside.Scripting.Generation; namespace HostingTest { @@ -17,7 +17,7 @@ public class HAPITestBase { static internal PreDefinedCodeSnippets _codeSnippets; // static string _testLanguage; - //Don't use this member. Use _runtime instead. + //Don't use this member. Use _runtime instead. //This will be deleted once all the files are switched over to the id with correct casing protected ScriptRuntime _runTime; protected ScriptRuntime _runtime, _remoteRuntime; @@ -30,7 +30,7 @@ public class HAPITestBase { protected ScriptScope _defaultScope; protected HAPITestBase() { - + var ses = CreateSetup(); ses.HostType = typeof(TestHost); _runtime = new ScriptRuntime(ses); @@ -42,7 +42,7 @@ protected HAPITestBase() { _RBEng = _runTime.GetEngine("rb"); SetTestLanguage(); - + _defaultScope = _runTime.CreateScope(); _codeSnippets = new PreDefinedCodeSnippets(); } @@ -63,7 +63,7 @@ public static ScriptRuntimeSetup CreateSetup() { private void SetTestLanguage() { // _testLanguage = "ironpython"; - _testEng = _PYEng; + _testEng = _PYEng; } } diff --git a/Tests/HostingTest/HostingTest.csproj b/Tests/HostingTest/HostingTest.csproj index d8935e0c..38363b0d 100644 --- a/Tests/HostingTest/HostingTest.csproj +++ b/Tests/HostingTest/HostingTest.csproj @@ -69,17 +69,17 @@ {95289EA9-5778-489D-AB48-F81F2CE2DA32} IronPython %28Languages\IronPython\IronPython%29 - + {02FF0909-F5AD-48CF-A86A-345E721B7E40} - Microsoft.Scripting + Riverside.Scripting - + {EB66B766-6354-4208-A3D4-AACBDCB5C3B3} - Microsoft.Dynamic + Riverside.Dynamic - \ No newline at end of file + diff --git a/Tests/HostingTest/ObjectOperationsTest.cs b/Tests/HostingTest/ObjectOperationsTest.cs index ed91d1dd..b2031192 100644 --- a/Tests/HostingTest/ObjectOperationsTest.cs +++ b/Tests/HostingTest/ObjectOperationsTest.cs @@ -7,8 +7,8 @@ using System.Runtime.Remoting; using IronPython.Runtime; using IronPython.Runtime.Exceptions; -using Microsoft.Scripting; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting; +using Riverside.Scripting.Hosting; using NUnit.Framework; namespace HostingTest { @@ -46,7 +46,7 @@ public void IsCallable_NullObjectHandleArgument() { /// /// Test : Obj of a delegate instance /// Expected : True - /// + /// /// Notes : Look for example in existing code. /// [Test] @@ -57,12 +57,12 @@ public void IsCallable_ObjOfDelegateInstance() { ScriptScope scope = _testEng.CreateScope(); ScriptSource code = _testEng.CreateScriptSourceFromString(_codeSnippets[CodeType.IsOddFunction], SourceCodeKind.Statements); - // Execute source in scope + // Execute source in scope code.Execute(scope); - + //Get a Delegate Instance using the Func<> Generic declaration and GetVariable Func isodd = scope.GetVariable>("isodd"); - + Assert.IsTrue(_testEng.Operations.IsCallable(isodd)); // Call the function to validate IsCallable @@ -78,11 +78,11 @@ public void IsCallable_ObjOfDelegateInstance() { Assert.IsTrue(isodd2(1)); Assert.IsFalse(isodd2(2)); } - + private delegate TRet F1(T1 value); /// - /// Test : Null object + /// Test : Null object /// Expected : ArgumentNullException /// [Test] @@ -94,7 +94,7 @@ public void Call_NullObject() { } /// - /// Test : Null object[] + /// Test : Null object[] /// Expected : ArgumentNullException /// [Test] @@ -120,7 +120,7 @@ public void GetMember_NullObject() { [ExpectedException(typeof(ArgumentNullException))] public void GetMember_NullName() { string varName = "FooClass"; - + object FooClass = GetVariableValue(_codeSnippets[CodeType.SimpleFooClassDefinition], varName); _testEng.Operations.GetMember(FooClass, (string)null); @@ -189,12 +189,12 @@ public void DoOperation_NoOperatorForLanguage() { public void GetCallSignature_NullArg() { int expectedResult = 0; string[] result = (string[])_testEng.Operations.GetCallSignatures((object)null); - + // Should be empty array of Length zero Assert.AreEqual(result.Length, expectedResult); } - + [Test] [Negative] public void GetMemberNames_NullObject() { @@ -203,13 +203,13 @@ public void GetMemberNames_NullObject() { [Test] public void GetMemberNames_MemberObjects() { - List expectedResult = new List() { "concat", "add", "__doc__", "__module__", "__init__", "f", "someInstanceAttribute" }; + List expectedResult = new List() { "concat", "add", "__doc__", "__module__", "__init__", "f", "someInstanceAttribute" }; String varName = "FooClass"; object tmpFoo = GetVariableValue(_codeSnippets[CodeType.SimpleFooClassDefinition], varName); - + object FooClass = _testEng.Operations.Invoke(tmpFoo); // create new FooClass - + // BUG - Not same return value as Spec List result = new List(_testEng.Operations.GetMemberNames(FooClass)); @@ -222,7 +222,7 @@ public void GetMemberNames_MemberObjects() { [Test] public void GetCallSignature_PassValidClassObject() { - // depending on how the object stores objects + // depending on how the object stores objects // internally python stores 4 members maybe? string[] expectedResult = new string[4]; String varName = "FooClass"; @@ -235,7 +235,7 @@ public void GetCallSignature_PassValidClassObject() { Assert.AreEqual(result.Length, expectedResult.Length); } - + [Test] public void GetCallSignature_PassValidMethodObject() { string varName = "concat"; @@ -290,7 +290,7 @@ public void ConvertTo_NullType() { // Lookup value in scope string lookupObjectName = "x"; - + // Get object from the scope object ScopeObjectValue = GetVariableValue(_codeSnippets[CodeType.OneLineAssignmentStatement], lookupObjectName); @@ -319,7 +319,7 @@ public void GenericConvertTo_IntegerToDouble() { /// [Test] public void GenericTryConvertTo_IntegerToDouble(){ - + string lookupObjectName = "x"; double expectedValue = 3; @@ -343,10 +343,10 @@ public void SetMember_NullNameArg() { } /// - /// Test : For each Operations language and each source language, - /// set an existing and settable member + /// Test : For each Operations language and each source language, + /// set an existing and settable member /// Expected : The member is updated with the new value - /// + /// /// Note : This code fails for languages that do not have read/write objects! /// [Test] @@ -364,8 +364,8 @@ public void SetMember_BasicMemberTest() { object fooClass = _testEng.Operations.Invoke(objectVar); // create new FooClass // Verify that the member function exists Assert.IsTrue(_testEng.Operations.ContainsMember(fooClass, lookupMemberName)); - - // Set the member + + // Set the member // Get some new code to put in replace/set. ScriptScope scope = _testEng.CreateScope(); ScriptSource code = _testEng.CreateScriptSourceFromString("new_add=1", SourceCodeKind.Statements); @@ -376,11 +376,11 @@ public void SetMember_BasicMemberTest() { _testEng.Operations.SetMember(fooClass, lookupMemberName, newObjectValue); // Verify that the member does not exists anymore Assert.IsFalse(_testEng.Operations.ContainsMember(fooClass, "new_add")); - + } /// - /// Test : Lookup the a member of an object + /// Test : Lookup the a member of an object /// Expected : validate that ContainsMember returns true for a known member /// [Test] @@ -398,7 +398,7 @@ public void ContainsMember_BasicLookup() { /// - /// Test : Lookup the a member that is not in an object + /// Test : Lookup the a member that is not in an object /// Expected : validate that ContainsMember returns false /// [Negative] @@ -415,9 +415,9 @@ public void ContainsMember_LookForMemberThatDoesNotExist() { Assert.IsFalse(_testEng.Operations.ContainsMember(fooClass, lookupMemberName)); } - + /// - /// Test : Null object + /// Test : Null object /// Expected : ArgumentNullException /// [Negative] @@ -428,7 +428,7 @@ public void RemoveMember_NullObjectArg(){ } /// - /// Test : Null object + /// Test : Null object /// Expected : ArgumentNullException /// [Negative] @@ -444,9 +444,9 @@ public void RemoveMember_NullStringNameArg() { /// /// Test : Create a FooClass object in Hosted script language /// Expected : Verify that ObjectOperations is removed - /// + /// /// Notes : This will not work for every language but it should work for - /// Python. The Object Operations RemoveMember would be equivelent to + /// Python. The Object Operations RemoveMember would be equivelent to /// this Python: /// class FooClass: /// def inc(self, x): @@ -455,7 +455,7 @@ public void RemoveMember_NullStringNameArg() { /// N.inc(4) ==> 5 /// del N.inc(4) /// N.inc(4) ==> Error - /// + /// /// [Test] public void RemoveMember_BaiscObjectRemovalFn() { @@ -472,7 +472,7 @@ public void RemoveMember_BaiscObjectRemovalFn() { _testEng.Operations.RemoveMember(fooClass, lookupMemberName); // Verify that the member does not exists anymore Assert.IsFalse(_testEng.Operations.ContainsMember(fooClass, lookupMemberName)); - + } @@ -486,14 +486,14 @@ public void RemoveMember_BaiscObjectRemovalFn() { public void RemoveMember_BaiscObjectRemovalVar() { // BUG - investigate/file bug string varName = "x"; - + object objectVar = GetVariableValue(_codeSnippets[CodeType.OneLineAssignmentStatement], varName); _testEng.Operations.RemoveMember(objectVar, varName); } - + /// /// Test : GetMembers of imported module from script /// Expected : check subset of member names exist @@ -517,7 +517,7 @@ public void GetMemberNames_LocalFromImportedModule() { // Setup the date time dot net object object dotNetObject = GetVariableValue(_codeSnippets[CodeType.ImportCPythonDateTimeModule], varName); - + // Verify that this is the Spec'd signature List members = new List(_testEng.Operations.GetMemberNames(dotNetObject)); @@ -526,7 +526,7 @@ public void GetMemberNames_LocalFromImportedModule() { Assert.IsTrue(members.Contains(name)); }); - + //Assert.AreEqual(result.Length, expectedResult.Length); } /// @@ -555,10 +555,10 @@ public void GetDocumentation_AssemblyModule() { // Verify values Assert.IsTrue( doc.Contains(expectedDocs)); } - + [Test] public void GetDocumentation_FromScriptMethod() { - + string varName = "doc"; // Expected value string expectedDocs = "This function does nothing"; @@ -568,11 +568,11 @@ public void GetDocumentation_FromScriptMethod() { string doc = _testEng.Operations.GetDocumentation(objectVar); Assert.AreEqual(expectedDocs, doc); } - + /// /// Test : Import .Net DateTime assembly - /// Expected : Get the correct doc string attached - /// + /// Expected : Get the correct doc string attached + /// /// Note : Could be a problem if the .Net version changes and this specific doc string is changed /// [Test] @@ -582,7 +582,7 @@ public void GetDocumentation_FromDotNetObject() { ScriptSource code = _testEng.CreateScriptSourceFromString(_codeSnippets[CodeType.ImportDotNetAssemblyDateTimeModule], SourceCodeKind.Statements); code.Execute(scope); - + // This could break if the Underlining DotNet documentation changes. //http://dlr.codeplex.com/WorkItem/View.aspx?WorkItemId=6071 //string expectedDocs = "Represents an instant in time, typically expressed as a date and time of day"; @@ -613,7 +613,7 @@ public void SubMethod() { /// - /// Test : Test env change using engine.CreateOperations with module change in scope + /// Test : Test env change using engine.CreateOperations with module change in scope /// Expected : New env change should give correct __future__ division type. /// [Test] @@ -626,13 +626,13 @@ public void TestFromFuture_UsingOperations() { futureScope.SetVariable("division", true); sr.Globals.SetVariable("__future__", futureScope); - ScriptSource source = _testEng.CreateScriptSourceFromString(_codeSnippets[CodeType.ImportFutureDiv], + ScriptSource source = _testEng.CreateScriptSourceFromString(_codeSnippets[CodeType.ImportFutureDiv], SourceCodeKind.Statements); ScriptScope localScope = _testEng.CreateScope(); source.Execute(localScope); ObjectOperations operation = _testEng.CreateOperations(localScope); - + // now do div operations and check result object divResult = operation.Divide(1, 2); @@ -660,7 +660,7 @@ public void Create_Op2() ScriptScope scope = engine.CreateScope(); ObjectOperations operation = engine.CreateOperations(scope); - + string pyCode = @"class TC(object): i = -1 def what(self): @@ -668,7 +668,7 @@ def what(self): ScriptSource src = engine.CreateScriptSourceFromString(pyCode, SourceCodeKind.Statements); src.Execute(scope); - + object FooClass = scope.GetVariable("TC"); object[] param = new object[] { }; object newObjectInstance = engine.Operations.CreateInstance(FooClass, param); // create new FooClass @@ -694,9 +694,9 @@ def what(self): ScriptSource src = engine.CreateScriptSourceFromString(pyCode, SourceCodeKind.Statements); src.Execute(scope); - + object FooClass = scope.GetVariable("TC"); - + object[] param = new object[] { }; object testClassInstance0 = engine.Operations.CreateInstance(FooClass, param); // create new FooClass diff --git a/Tests/HostingTest/ObjectOperationsTestHelper.cs b/Tests/HostingTest/ObjectOperationsTestHelper.cs index 4382c18a..5d1e7966 100644 --- a/Tests/HostingTest/ObjectOperationsTestHelper.cs +++ b/Tests/HostingTest/ObjectOperationsTestHelper.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -using Microsoft.Scripting.Hosting; +using Riverside.Scripting.Hosting; using NUnit.Framework; namespace HostingTest @@ -21,12 +21,12 @@ public TestContext TestContext { public ObjectOperationsTest() : base() { - + } internal object GetVariableValue(string code, string varname) { ScriptScope scope = _testEng.CreateScope(); - ScriptSource source = scope.Engine.CreateScriptSourceFromString(code, Microsoft.Scripting.SourceCodeKind.Statements); + ScriptSource source = scope.Engine.CreateScriptSourceFromString(code, Riverside.Scripting.SourceCodeKind.Statements); source.Execute(scope); return scope.GetVariable(varname); } diff --git a/Tests/HostingTest/Properties/AssemblyInfo.cs b/Tests/HostingTest/Properties/AssemblyInfo.cs index b30d33d4..44a88e71 100644 --- a/Tests/HostingTest/Properties/AssemblyInfo.cs +++ b/Tests/HostingTest/Properties/AssemblyInfo.cs @@ -1,9 +1,9 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting.Hosting; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("HostingTest")] @@ -15,8 +15,8 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM componenets. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM componenets. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -26,11 +26,11 @@ // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Revision and Build Numbers +// You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/HostingTest/ScriptEngineTest.cs b/Tests/HostingTest/ScriptEngineTest.cs index eeb1c146..9303cf7a 100644 --- a/Tests/HostingTest/ScriptEngineTest.cs +++ b/Tests/HostingTest/ScriptEngineTest.cs @@ -5,9 +5,9 @@ using System.Runtime.Remoting; using System.Text; using IronPython.Runtime; -using Microsoft.Scripting; -using Microsoft.Scripting.Hosting; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting; +using Riverside.Scripting.Hosting; +using Riverside.Scripting.Runtime; using NUnit.Framework; using System.Dynamic; @@ -49,7 +49,7 @@ public void GetRegisteredExtensions_Test() { result = _runTime.GetEngine("ruby").Setup.FileExtensions; TestHelpers.AreEqualArrays(new string[] { ".rb" }, result); } - + [Test] public void LanguageVersion_Test() { //LanguageVersion @@ -114,7 +114,7 @@ public void CreateScriptSource_InvalidCode_Test() { ScriptScope scope = _runTime.CreateScope(); src.Execute(scope); - + } DeleteTempFiles(); @@ -225,7 +225,7 @@ public void CreateScriptSource_NullTextContentProvider_Test() { [Test] [ExpectedException(typeof(ArgumentNullException))] public void CreateScriptSource_NullStreamContentProvider3_Test() { - _testEng.CreateScriptSource((StreamContentProvider)null, "some_path.py", + _testEng.CreateScriptSource((StreamContentProvider)null, "some_path.py", Encoding.Unicode, SourceCodeKind.Statements); } @@ -264,7 +264,7 @@ public void CreateScriptSourceFromFile_NullArgsUnicode_Test2() { public void CreateScriptSourceFromFile_InvalidFileUnicode_Test() { _testEng.CreateScriptSourceFromFile("some_path.py", null, SourceCodeKind.File); } - + [Negative] [Test] [ExpectedException(typeof(ArgumentNullException))] @@ -358,15 +358,15 @@ public void ExecuteFile_WithScope() { ScriptScope scope = _testEng.CreateScope(); scope.SetVariable("y", 1); - + ScriptScope result = _testEng.ExecuteFile(tmpFile, scope); Assert.AreEqual(result, scope); var x = scope.GetVariable("x"); Assert.AreEqual(x, 2); } - - //TODO : these tests should move to script source. + + //TODO : these tests should move to script source. #region CompileExpression tests /// /// Covers ScriptEngine.CompileExpression for various basic expressions @@ -388,7 +388,7 @@ public void Compile_Expression_SyntaxError_Test() { //Compile an invalid expression _testEng.CreateScriptSourceFromString("? 2+2").Compile(); - + } [Negative] @@ -400,7 +400,7 @@ public void Compile_Expression_UnboundVar_Test() { //Compile an expression referencing an unbound variable, which generates a runtime error CompiledCode e1 = _testEng.CreateScriptSourceFromString("unbound + 2").Compile(); e1.Execute(scope); - + } [Test] @@ -449,7 +449,7 @@ public void Compile_Statement_SyntaxError_Test() { //Compile an invalid statement _testEng.CreateScriptSourceFromString("? 2+2", SourceCodeKind.Statements).Compile(); - + } [Negative] @@ -461,7 +461,7 @@ public void Compile_Statement_UnboundVar_Test() { //Compile a statement referencing an unbound variable, which generates a runtime error CompiledCode e1 = _testEng.CreateScriptSourceFromString("print unbound+2", SourceCodeKind.Statements).Compile(); e1.Execute(scope); - + } [Test] @@ -545,7 +545,7 @@ public void LanguageDisplay_WrongLanguage() { public void LanguageDisplayName_EmptyLanguage() { var name = _runTime.GetEngine("").Setup.DisplayName; } - + [Test] public void GetRegisteredIdentifiers_LangWithNoIDs_Test() { ScriptRuntime runtime = ScriptRuntimeTest.CreatePythonOnlyRuntime(new string[] { }, new string[]{".py"}); @@ -566,7 +566,7 @@ public void GetRegisteredExtensions_LangWithNoExt() { /// [Test] public void Operations_InvokeIsNotNull_Test() { - + Assert.IsNotNull(_testEng.Operations); Assert.IsNotNull(_RBEng.Operations); Assert.IsNotNull(_runTime.Operations); @@ -578,14 +578,14 @@ public void Operations_InvokeIsNotNull_Test() { /// [Test] public void Operations_MultiAccess_Test() { - + ObjectOperations operations = _testEng.Operations; ObjectOperations dummyResult = _testEng.CreateOperations(); //Ensure the previous call didn't have any side effects. Assert.AreEqual(operations, _testEng.Operations); - + } /// /// Verify Successfully Invoke a usable new instance. @@ -596,15 +596,15 @@ public void CreateOperations_Invoke_Test() { } /// - /// Make multiple instances of an object and + /// Make multiple instances of an object and /// and make sure that they are different. - /// + /// /// Only test that the next instance is not the /// same as the last instance /// [Test] public void CreateOperations_MultipleTimes() { - + const int n = 5; ObjectOperations[] OpA = new ObjectOperations[n]; for (int i = 0; i < n; i++) { @@ -612,7 +612,7 @@ public void CreateOperations_MultipleTimes() { if (i > 0) Assert.IsTrue(OpA[i] != OpA[i - 1]); } } - + [Test] [Negative] [ExpectedException(typeof(ArgumentNullException))] @@ -630,7 +630,7 @@ public void TestFromFuture_localScope() { futureScope.SetVariable("division", true); sr.Globals.SetVariable("__future__", futureScope); ScriptSource source = pyeng.CreateScriptSourceFromString(testSrc, SourceCodeKind.Statements); - + object result = source.Execute(futureScope); object r2 = futureScope.GetVariable("r"); Assert.AreEqual((double)r2, 0.5); @@ -649,7 +649,7 @@ public void TestFromFuture_globalScope() { //futureScope.SetVariable("division", true); globalScope.SetVariable("division", true); sr.Globals.SetVariable("__future__", globalScope); - + ScriptSource source = pyeng.CreateScriptSourceFromString(testSrc, SourceCodeKind.Statements); //ScriptScope globalScope = sr.CreateScope(); @@ -658,7 +658,7 @@ public void TestFromFuture_globalScope() { Assert.AreEqual((double)r2, 0.5); } - + /// /// Make sure this throws the Null Argument Exception /// @@ -685,12 +685,12 @@ public void GetScope_InvalidPath() { /// [Test] public void GetScope_NonExistentScriptSourcePath() { - + //As long as the engine's scope is not associated with //a scope that has a valid path this should work or //If you just give an invalide script path. - // Probably dont' need each of these tests since + // Probably dont' need each of these tests since // they invalid path's are probably tested else where! string[] wrongPath = {"c:\\lsslsl\\slslslsl\\lslslsa/a/a/ssswww/foo.py", @@ -718,10 +718,10 @@ public void GetScope_ValidPathOfUnExecutedScript() { /// /// Test case : - /// In a supported language, the valid path of an existing ScriptSource that has been executed + /// In a supported language, the valid path of an existing ScriptSource that has been executed /// Expected result: /// Return of the ScriptScope in which the given ScriptSource most recently ran - /// + /// /// [Test] public void GetScope_VerifyScriptScopeFromScriptFileCanBeRetrieved(){ @@ -751,7 +751,7 @@ public void GetScope_VerifyScriptScopeFromScriptFileCanBeRetrieved(){ // We should have a valid instance of the scope Assert.IsNotNull(fileScope); - // If we get a valid scope check the expected contents. + // If we get a valid scope check the expected contents. Assert.AreEqual(expResult, fileScope.GetVariable("x")); } @@ -761,7 +761,7 @@ public void GetScope_VerifyScriptScopeFromScriptFileCanBeRetrieved(){ /// [Test] public void CreateScriptSourceFromFile_ValidPathToJunkFile() { - + //Create a temp source with some invalid code string testSrc = "Moby-Dick[1] is an 1851 novel by Herman Melville. The story" + " tells the adventures of the wandering sailor Ishmael and his" @@ -781,7 +781,7 @@ public void CreateScriptSourceFromFile_ValidPathToJunkFile() { } /// - /// Test to ensure the CreateScriptSource doesnt throw any exception irrespective + /// Test to ensure the CreateScriptSource doesnt throw any exception irrespective /// of how bad the input path is... /// [Test] @@ -790,7 +790,7 @@ public void CreateScriptSourceFromFile_NoExceptions() { foreach (string path in StandardTestPaths.AllPaths) { _testEng.CreateScriptSourceFromFile(path); } - + } /// @@ -813,18 +813,18 @@ public void CreateScriptSourceFromString_JunkStringsTest() { } /// - /// + /// /// [Test] public void CreateScriptSourceFromFile_JunkStringsTest() { - + int cnt = 0; ScriptSource sSrc; ScriptCodeParseResult sCodeProp = new ScriptCodeParseResult(); foreach (string junk in StandardTestStrings.AllStrings) { - + // Count the loop sanity check! cnt++; string msg = string.Format("junk string index {0}", cnt); @@ -844,16 +844,16 @@ public void CreateScriptSourceFromFile_JunkStringsTest() { /// I am not sure why you think the method shouldn't through when the codedom is wrong. /// Anyway, we should probably have a very basic sanity test for this and not test too much /// Let's discuss about this test - /// + /// /// CodeObject and id are passed up the chain of function until they hit ScriptSource(...) /// - + [Test] [Negative] [ExpectedException(typeof(ArgumentNullException))] //public void CreateScriptSource_NullIdValidCodeObject() { public void CreateScriptSource_NullCodeObject() { - + //Why is this called 'BuildCountCode'? CodeObject cObj = BuildCountCode(); // If we return just the method from BuildCountCode() diff --git a/Tests/HostingTest/ScriptEngineTestHelper.cs b/Tests/HostingTest/ScriptEngineTestHelper.cs index 2d87e36e..2f88bb70 100644 --- a/Tests/HostingTest/ScriptEngineTestHelper.cs +++ b/Tests/HostingTest/ScriptEngineTestHelper.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.IO; using System.Text; -using Microsoft.Scripting; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting; +using Riverside.Scripting.Hosting; using NUnit.Framework; namespace HostingTest { @@ -25,7 +25,7 @@ public TestContext TestContext { } #region Additional test attributes - // + // //You can use the following additional attributes as you write your tests: // //Use ClassInitialize to run code before running the first test in the class @@ -104,21 +104,21 @@ private List CreateSourceListWithDifferentEncodings(string code) { /// /// This is a simple helper method to create a test valid - /// CodeObject to be feed into the + /// CodeObject to be feed into the /// CreateScriptSource(CodeObject content, string id) - /// + /// /// However, CodeObject is simply a base class so we probably /// need a specific type of CodeObject but what? - /// + /// /// [Bill - has indicate that CodeObject parameter for CreateScriptSource /// does in fact need to be a CodeMemberMethod - Maybe a spec BUG] - /// + /// /// Probably need to put this somewhere else maybe put this in: /// ScriptEngineTestHelper.cs /// /// A valid CodeObject boxes some kind of CompileUnit private static CodeObject BuildCountCode() { - // Create a new CodeCompileUnit to contain + // Create a new CodeCompileUnit to contain // the program graph. CodeCompileUnit compileUnit = new CodeCompileUnit(); @@ -157,9 +157,9 @@ private static CodeObject BuildCountCode() { internal static class ScriptEngineExtensions { internal static bool IsValidPythonEngine(this ScriptEngine eng) { ScriptScope scope = eng.CreateScope(); - ScriptSource code = eng.CreateScriptSourceFromString("five=2+3", Microsoft.Scripting.SourceCodeKind.Statements); - - code.Execute(scope); + ScriptSource code = eng.CreateScriptSourceFromString("five=2+3", Riverside.Scripting.SourceCodeKind.Statements); + + code.Execute(scope); return (int)scope.GetVariable("five") == 5; } } diff --git a/Tests/HostingTest/ScriptHostBasicSubTest.cs b/Tests/HostingTest/ScriptHostBasicSubTest.cs index 149cc343..e5438c88 100644 --- a/Tests/HostingTest/ScriptHostBasicSubTest.cs +++ b/Tests/HostingTest/ScriptHostBasicSubTest.cs @@ -2,15 +2,15 @@ using System.Diagnostics; using System.IO; using System.Threading; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting.Hosting; namespace HostingTest { /// - /// From copied source : + /// From copied source : /// "One instance loaded into remote script app-domain, one instance runs locally." /// - /// Other possible test scenario : + /// Other possible test scenario : /// Creating more then one derived Host as well as target each /// override-able (i.e., virtual) and abstract methods. /// @@ -19,7 +19,7 @@ public class ScriptHostBasicSubTest : ScriptHost { private readonly string/*!*/ _path; private ScriptScope _defaultScope; - + public ScriptHostBasicSubTest(string/*!*/ path) { Debug.Assert(path != null); _path = path; diff --git a/Tests/HostingTest/ScriptHostTest.cs b/Tests/HostingTest/ScriptHostTest.cs index 88f0dcf2..1fe78431 100644 --- a/Tests/HostingTest/ScriptHostTest.cs +++ b/Tests/HostingTest/ScriptHostTest.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.IO; using IronPython.Runtime; -using Microsoft.Scripting; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting; +using Riverside.Scripting.Hosting; using NUnit.Framework; namespace HostingTest { @@ -15,28 +15,28 @@ public MyHost() { } public MyHost(string foo, int bar) {} } - + /// /// This is a test class for ScriptHostTest and is intended /// to contain all ScriptHostTest Unit Tests /// - /// From the spec : - /// The DLR instantiates the ScriptHost when the DLR initializes a ScriptRuntime. + /// From the spec : + /// The DLR instantiates the ScriptHost when the DLR initializes a ScriptRuntime. /// The host can get at the instance with ScriptRuntime.Host. /// /// This class depends on on the DerivedHostTest class that I created in order /// to fully test the host. - /// - /// Other possible test scenario : + /// + /// Other possible test scenario : /// Creating more then one derived Host as well as target each /// override-able (i.e., virtual) and abstract methods. /// [TestFixture] public partial class ScriptHostTest : HAPITestBase { - + /// - /// Test : Use a custom host to create a runtime. Compare the original + /// Test : Use a custom host to create a runtime. Compare the original /// runtime with this property. /// Expected : Values are the same. /// @@ -46,31 +46,31 @@ public void Runtime_HostRuntimeProperty() { // Todo - Investigate this to verify correctness. // Setup derived With basic DerivedHostTest ScriptRuntime runtimeEnv = CreateHostRuntime(typeof(ScriptHostBasicSubTest), Path.GetFullPath(".")); - + // Verify runtime's are equal ValidateProperties(runtimeEnv, runtimeEnv.Host.Runtime); - + } /// - /// Test : Invoke the property + /// Test : Invoke the property /// Expected : Correct PAL is returned /// [Test] public void PAL_HostPalProperty() { - + // Setup runtime with specific path string testPath = Path.GetFullPath("."); ScriptRuntime runtimeEnv = CreateHostRuntime(typeof(ScriptHostBasicSubTest), testPath); // Verify correct PAL property -- Maybe blocked by bug 462717 ValidateProperties(runtimeEnv.Host.PlatformAdaptationLayer, testPath); - + } - - - + + + /// /// Test : Basic smoke test for derived host invocation. /// Expected : Verify that properties return correct references. @@ -83,17 +83,17 @@ public void Host_BasicInvokeFromRuntime(){ // Todo - Investigate this to verify correctness. // Setup derived With basic DerivedHostTest ScriptRuntime runtimeEnv = CreateHostRuntime(typeof(ScriptHostBasicSubTest), testPath); - + // Verify correct PAL property -- Maybe blocked by bug 462717 ValidateProperties(runtimeEnv.Host.PlatformAdaptationLayer, testPath); - + // Verify correct runtime property. ValidateProperties(runtimeEnv, runtimeEnv.Host.Runtime); } /// /// Test : Create a Host that is not associated with a ScriptRuntime - /// Expected : Throw not initialized exception + /// Expected : Throw not initialized exception /// [Test] [Negative] @@ -106,20 +106,20 @@ public void Host_UninitializedRuntimeProperty() { // Verify correct runtime property. ScriptRuntime runtimeEnv = myHost.Runtime; - + } /// /// Test : Create a Host that is not associated with a ScriptRuntime /// and Get PAL property. - /// Expected : Throw not initialized exception - /// + /// Expected : Throw not initialized exception + /// /// Note : Missing documentation this may not be the expected behaviour /// [Test] [Negative] [ExpectedException(typeof(InvalidOperationException))] - [Ignore] // BUG - Currently blocked by lack of documentation for ScriptHost|PAL + [Ignore] // BUG - Currently blocked by lack of documentation for ScriptHost|PAL // (Investigate | file bug) public void Host_UninitializedPALProperty() { @@ -137,7 +137,7 @@ public void Host_UninitializedPALProperty() { #if OBSOLETE /// - /// Test : Env var pointerd by ‘PathEnvironmentVariableName’ is null; Invoke the property + /// Test : Env var pointerd by ‘PathEnvironmentVariableName’ is null; Invoke the property /// Expected : Value is ‘.’ /// [Test] @@ -159,29 +159,29 @@ public void SourceFileSearchPath_NullPathEnvironmentVariableName() { // Verify results ValidateSourceFileSearchPathValues(host.GetSourceFileSearchPath(), expectedPaths); - + } /// /// Test : Load a script from a file using the host. - /// Expected : Execute with expected results + /// Expected : Execute with expected results /// [Test] //[Ignore] public void TryGetSourceFile_WithEncodingAndKind() { - // Setup test env - string tmpFileName = TestHelpers.CreateTempSourceFile(_codeSnippets[CodeType.OneLineAssignmentStatement], + // Setup test env + string tmpFileName = TestHelpers.CreateTempSourceFile(_codeSnippets[CodeType.OneLineAssignmentStatement], ".py"); // Setup expected test vars string lookupVarName = "x"; object expectedResult = 3; - - ScriptHostBasicSubTest host = (ScriptHostBasicSubTest)CreateTestHost(typeof(ScriptHostBasicSubTest), + + ScriptHostBasicSubTest host = (ScriptHostBasicSubTest)CreateTestHost(typeof(ScriptHostBasicSubTest), tmpFileName); // Verify results ValidateTryGetSourceFile(host, tmpFileName, lookupVarName, expectedResult); - + } @@ -192,33 +192,33 @@ public void TryGetSourceFile_WithEncodingAndKind() { [Test] //[Ignore] // BUG - This test is blocked by lack of DLRPATH DLR/Config support public void ResolveSourceFileName_OverrideTestNameIsUnchanged() { - + // Setup env for search. string tmpFileName = TestHelpers.CreateTempSourceFile("1+1", ".py"); - + // This could possble enable the host to be aware of other search path - ScriptRuntime newRuntimeEnv = CreateHostRuntime(typeof(ScriptHostBasicSubTest), + ScriptRuntime newRuntimeEnv = CreateHostRuntime(typeof(ScriptHostBasicSubTest), Path.GetDirectoryName(tmpFileName)); ScriptHostBasicSubTest host = (ScriptHostBasicSubTest)newRuntimeEnv.Host; // Using abs path tmpFileName ValidateResolveSourceFileNameSearchResult(host, tmpFileName); - + } /// /// Test : Try to resolve a file that should not be in the path /// Expected : Should throw exceptions - /// + /// /// Note : This test doesn't necessarily give real information since /// we can't change the DLR Path currently thus almost any file - /// will fail - weather it there or not! + /// will fail - weather it there or not! /// [Test] [Negative] [ExpectedException(typeof(FileNotFoundException))] //[Ignore] // See|File Host Config Bug/ResolveSourceFile public void ResolveSourceFileName_LookForMissingFile() { - + //Need to find a name that is less likely to be in the path string missingFileName = "123sadfsssp__foo__.py"; @@ -227,7 +227,7 @@ public void ResolveSourceFileName_LookForMissingFile() { ScriptHostBasicSubTest host = (ScriptHostBasicSubTest)newRuntimeEnv.Host; // Verify search result ValidateResolveSourceFileNameSearchResult(host, missingFileName); - + } @@ -244,11 +244,11 @@ public void ResolveSourceFileName_LookForFilePysicallyAddFileAndDLRPATH() { string tmpFileName = TestHelpers.CreateTempSourceFile(_codeSnippets[CodeType.OneLineAssignmentStatement], fileExt); string FileNameInDLRPath = Path.GetFileName(tmpFileName).Replace(fileExt, ""); - string testDLRPath = Path.GetDirectoryName(tmpFileName); - + string testDLRPath = Path.GetDirectoryName(tmpFileName); + TestHelpers.EnvSetupTearDown EnvTest = new TestHelpers.EnvSetupTearDown("DLRPATH", testDLRPath); - + // This could possble enable the host to be aware of other search path ScriptRuntime newRuntimeEnv = CreateHostRuntime(typeof(ScriptHostBasicSubTest), "-nothing"); ScriptHostBasicSubTest host = (ScriptHostBasicSubTest)newRuntimeEnv.Host; @@ -256,31 +256,31 @@ public void ResolveSourceFileName_LookForFilePysicallyAddFileAndDLRPATH() { // Verify search result ValidateResolveSourceFileNameSearchResult(host, FileNameInDLRPath, testDLRPath + "\\" + FileNameInDLRPath + fileExt); - + } - + [Test] //[Ignore] public void ResolveSourceFileTest() { // Adjust DLRPATH and place a file in this directory - // After looking at the source code I see that I need to leave off + // After looking at the source code I see that I need to leave off // the file extension. Environment.SetEnvironmentVariable("DLRPATH", "c:\\dlr\\dlrpath\\"); - + // Create Runtime with attached Host // ScriptRuntime aRuntime = FooTest.CreateHostRuntime(typeof(ADerivedHost), "-f foo"); //ADerivedHost host = (ADerivedHost)aRuntime.Host; - + // This finds a file //host.ResolveSourceFile("foo"); // This fails //host.ResolveSourceFile("foo.py"); - + } [Test] @@ -288,7 +288,7 @@ public void ResolveSourceFileTest() { public void ResolveSourceFile_Test() { // Adjust DLRPATH and place a file in this directory - // After looking at the source code I see that I need to leave off + // After looking at the source code I see that I need to leave off // the file extension. string tempFile = Path.GetTempFileName(); @@ -302,19 +302,19 @@ public void ResolveSourceFile_Test() { // Adjust the environment Environment.SetEnvironmentVariable("DLRPATH", Path.GetDirectoryName(newFile)); - + ScriptRuntimeSetup setup = new ScriptRuntimeSetup(true); setup.HostType = typeof(ScriptHostBasicSubTest); - // Are HostArgs ment to be arguments to a loaded script i.e. + // Are HostArgs ment to be arguments to a loaded script i.e. // passing paramters to argv? setup.HostArguments = new object[] { "-f foo" }; - // This throws exception + // This throws exception ScriptRuntime aRuntime = ScriptRuntime.Create(setup); ScriptHostBasicSubTest host = (ScriptHostBasicSubTest)aRuntime.Host; - + // Search for 'foo' type name that is a success host.ResolveSourceFile(fileNameWithoutExtension); - + // Search for 'foo.py' type file fails host.ResolveSourceFile(fileNameWithExtension); } @@ -337,14 +337,14 @@ public void ResolveSourceFile_WithSingleArg() { Path.GetDirectoryName(tmpFileName)); ScriptHostBasicSubTest host = (ScriptHostBasicSubTest)newRuntimeEnv.Host; ValidateResolveSourceFileSearchResult(host, tmpFileName, Path.GetFullPath(tmpFileName)); - + } /// - /// Test : Pass a valid ‘name’ that was used to execute in the current runtime + /// Test : Pass a valid ‘name’ that was used to execute in the current runtime /// Expected : The corresponding ScriptSource object is returned - /// + /// /// Note : See Test Plan BUG?/ See Config/ResolveSourceFileName(...) bug /// [Test] @@ -352,7 +352,7 @@ public void ResolveSourceFile_WithSingleArg() { public void ResolveSourceFile_PassValidName() { // Get source string testSrc = _codeSnippets[CodeType.OneLineAssignmentStatement]; - + // Setup env for search. string tmpFileName = TestHelpers.CreateTempSourceFile(testSrc, ".py"); @@ -361,10 +361,10 @@ public void ResolveSourceFile_PassValidName() { Path.GetDirectoryName(tmpFileName)); ScriptHostBasicSubTest host = (ScriptHostBasicSubTest)newRuntimeEnv.Host; ScriptScope scope = newRuntimeEnv.ExecuteFile(tmpFileName); - + // Using abs path tmpFileName ValidateResolveSourceFileSearchResult(host, tmpFileName, Path.GetDirectoryName(tmpFileName)); - + } /// diff --git a/Tests/HostingTest/ScriptHostTestHelper.cs b/Tests/HostingTest/ScriptHostTestHelper.cs index a65c7582..6ad16730 100644 --- a/Tests/HostingTest/ScriptHostTestHelper.cs +++ b/Tests/HostingTest/ScriptHostTestHelper.cs @@ -6,8 +6,8 @@ using System.Collections.Generic; using System.IO; using System.Text; -using Microsoft.Scripting; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting; +using Riverside.Scripting.Hosting; using NUnit.Framework; #if SILVERLIGHT @@ -16,8 +16,8 @@ namespace HostingTest { - - + + /// /// This is a test a sub class for ScriptHostTest and is intended /// to contain many of the ScriptHost overridden members @@ -26,7 +26,7 @@ public partial class ScriptHostTest : HAPITestBase { private TestContext testContextInstance; - + /// /// This gets or sets the test context which provides /// information about and functionality for the current test run. @@ -57,13 +57,13 @@ public ScriptHostTest() } /// - /// + /// /// /// The type of host we have derived /// Host Search Path /// private ScriptRuntimeSetup/*!*/ CreateHostTypeScriptRuntimeSetup(Type HostType, string/*!*/ testPath) { - ScriptRuntimeSetup setup = CreateSetup(); + ScriptRuntimeSetup setup = CreateSetup(); setup.HostType = HostType; setup.HostArguments = new object[] { testPath }; return setup; @@ -72,7 +72,7 @@ public ScriptHostTest() /// /// BUG - This helper function is blocked by the lack of HostConfig documentation/implementation - /// for example "4.16 ScriptRuntimeSetup" is undefined in DLR Hosting Spec + /// for example "4.16 ScriptRuntimeSetup" is undefined in DLR Hosting Spec /// from DLR Hosting doc "Design expected 19 MAY 08. XXX" /// /// diff --git a/Tests/HostingTest/ScriptIOTest.cs b/Tests/HostingTest/ScriptIOTest.cs index e1948a1e..4b07ad37 100644 --- a/Tests/HostingTest/ScriptIOTest.cs +++ b/Tests/HostingTest/ScriptIOTest.cs @@ -1,7 +1,7 @@ using System; using System.IO; using System.Text; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting.Hosting; using NUnit.Framework; @@ -21,7 +21,7 @@ public partial class ScriptIOTest : HAPITestBase /// this class. /// public ScriptIOTest(){ - + } [Negative()] @@ -56,7 +56,7 @@ public void SetOutput_TextWriterFirstParameterIsNull() { [Test] [ExpectedException(typeof(ArgumentNullException))] public void SetOutput_TextWriterSecondParameterIsNull() { - + string file = TestHelpers.CreateTempFile("Test!"); FileStream stream = new FileStream(file, FileMode.Create, FileAccess.ReadWrite); _runTime.IO.SetOutput((Stream)stream, (StreamWriter)null); @@ -114,7 +114,7 @@ public void SetOutput_TextWriterValidateOutput() { _runTime.IO.SetOutput((Stream)stream, streamWriter); ScriptScope scope = _testEng.CreateScope(); - ScriptSource source = scope.Engine.CreateScriptSourceFromString("print \"" + expectedOutput + "\"", Microsoft.Scripting.SourceCodeKind.Statements); + ScriptSource source = scope.Engine.CreateScriptSourceFromString("print \"" + expectedOutput + "\"", Riverside.Scripting.SourceCodeKind.Statements); source.Execute(scope); stream.Close(); @@ -124,19 +124,19 @@ public void SetOutput_TextWriterValidateOutput() { /// /// Tests : Set stream to a valid object; set encoding to a known value - /// Expected : The output stream receives the proper values in proper format + /// Expected : The output stream receives the proper values in proper format /// [Test] public void SetOutput_ValidateOutput() { string testFile = Path.GetTempFileName(); - + string expectedOutput = "test-" + DateTime.Now.ToUniversalTime(); FileStream stream = new FileStream(testFile, FileMode.Create, FileAccess.ReadWrite); _runTime.IO.SetOutput((Stream)stream, Encoding.ASCII); ScriptScope scope = _testEng.CreateScope(); - ScriptSource source = _testEng.CreateScriptSourceFromString("print \'" + expectedOutput + "\'", Microsoft.Scripting.SourceCodeKind.Statements); + ScriptSource source = _testEng.CreateScriptSourceFromString("print \'" + expectedOutput + "\'", Riverside.Scripting.SourceCodeKind.Statements); source.Execute(scope); _runTime.IO.OutputStream.Close(); @@ -145,8 +145,8 @@ public void SetOutput_ValidateOutput() { } /// - /// Tests : ‘stream’ is set explicitly; output is captured in ‘stream’ then ‘stream’ - /// is closed when still in use by the engine + /// Tests : ‘stream’ is set explicitly; output is captured in ‘stream’ then ‘stream’ + /// is closed when still in use by the engine /// Expected : ObjectDisposed exception is thrown since the stream was closed /// [Test] @@ -158,9 +158,9 @@ public void SetOutput_ValidateOutputCloseStreamAndVerifyEngineStability() { _runTime.IO.SetOutput((Stream)stream, Encoding.ASCII); ScriptScope scope = _testEng.CreateScope(); - ScriptSource source = _testEng.CreateScriptSourceFromString("print 'something'", Microsoft.Scripting.SourceCodeKind.Statements); + ScriptSource source = _testEng.CreateScriptSourceFromString("print 'something'", Riverside.Scripting.SourceCodeKind.Statements); - source.Execute(scope); + source.Execute(scope); stream.Close(); ValidateAttachedStreamOutput(testFile, "something"); @@ -213,7 +213,7 @@ public void SetInput_TextReaderSecondParameterIsNull() { [ExpectedException(typeof(ArgumentNullException))] public void SetErrorOutput_FirstParameterIsNull() { _runTime.IO.SetErrorOutput((Stream)null, Encoding.ASCII); - + } [Negative()] diff --git a/Tests/HostingTest/ScriptRuntimeSetupTest.cs b/Tests/HostingTest/ScriptRuntimeSetupTest.cs index d067c0fd..f77f769c 100644 --- a/Tests/HostingTest/ScriptRuntimeSetupTest.cs +++ b/Tests/HostingTest/ScriptRuntimeSetupTest.cs @@ -5,9 +5,9 @@ using System.Runtime.Remoting; using System.Text; using IronPython.Runtime; -using Microsoft.Scripting; -using Microsoft.Scripting.Hosting; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting; +using Riverside.Scripting.Hosting; +using Riverside.Scripting.Runtime; using NUnit.Framework; using System.Diagnostics; @@ -114,7 +114,7 @@ public void ReadConfiguration_Multi_SameTypeDifferentName() { [ExpectedException(typeof(ArgumentException))] public void ReadConfiguration_Multi_SameNameDifferentType() { LangSetup py1 = LangSetup.Python; - LangSetup py2 = new LangSetup( py1.Names, py1.Extensions, py1.DisplayName, + LangSetup py2 = new LangSetup( py1.Names, py1.Extensions, py1.DisplayName, LangSetup.Ruby.TypeName, LangSetup.Ruby.AssemblyString); string configFile = GetTempConfigFile(new[] { py1, py2 }); @@ -160,7 +160,7 @@ public void ReadConfiguration_DuplicateNames() { [ExpectedException(typeof(ArgumentException))] public void ReadConfiguration_MissingAssembly() { LangSetup lang = new LangSetup(new[]{"SomeName"}, new[]{".sn"}, "Somename", - "SomeLang.Runtime.LangContext", + "SomeLang.Runtime.LangContext", "SomeLang, Version=8.0.0.5050, Culture=neutral, PublicKeyToken=31345fgsd4344e35"); string configFile = GetTempConfigFile(new[] { lang}); @@ -180,7 +180,7 @@ public void ReadConfiguration_MisMatchedTypeAssembly() { string configFile = GetTempConfigFile(new[] { py2}); var srs = ScriptRuntimeSetup.ReadConfiguration(configFile); - + var sr = new ScriptRuntime(srs); var eng = sr.GetEngine("py"); Assert.Fail("some exception should have been thrown"); diff --git a/Tests/HostingTest/ScriptRuntimeSetupTestHelper.cs b/Tests/HostingTest/ScriptRuntimeSetupTestHelper.cs index d3f8c090..144e0f00 100644 --- a/Tests/HostingTest/ScriptRuntimeSetupTestHelper.cs +++ b/Tests/HostingTest/ScriptRuntimeSetupTestHelper.cs @@ -1,5 +1,5 @@ -using Microsoft.Scripting; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting; +using Riverside.Scripting.Hosting; using NUnit.Framework; using System; using System.Text; @@ -7,7 +7,7 @@ namespace HostingTest { public partial class ScriptRuntimeSetupTest : HAPITestBase { - + private TestContext testContextInstance; /// @@ -24,7 +24,7 @@ public TestContext TestContext { } #region Additional test attributes - // + // //You can use the following additional attributes as you write your tests: // //Use ClassInitialize to run code before running the first test in the class @@ -54,17 +54,17 @@ public TestContext TestContext { #endregion internal string GetTempConfigFile(LangSetup[] langs) { - string xmlPrefix = "" + + string xmlPrefix = "" + "" + ""+ - "
"+ + "
"+ ""+ - ""+ + ""+ ""; string xmlSuffix =""+ - ""+ + ""+ ""; StringBuilder ret = new StringBuilder(); diff --git a/Tests/HostingTest/ScriptRuntimeTest.cs b/Tests/HostingTest/ScriptRuntimeTest.cs index 9b1c202b..c8b8ab36 100644 --- a/Tests/HostingTest/ScriptRuntimeTest.cs +++ b/Tests/HostingTest/ScriptRuntimeTest.cs @@ -5,11 +5,11 @@ using System.Security.Policy; using System.Text; using IronPython.Runtime; -using Microsoft.Scripting; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting; +using Riverside.Scripting.Hosting; using NUnit.Framework; using System.Reflection; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Runtime; namespace HostingTest{ [TestFixture] @@ -28,7 +28,7 @@ public void Create_WithSecondAppDomain(){ Assert.IsTrue(secondSR.IsValid()); } - + [Test] [Negative] [ExpectedException(typeof(ArgumentNullException))] @@ -40,7 +40,7 @@ public void Create_NullAppDomain() { [Negative] [ExpectedException(typeof(AppDomainUnloadedException))] public void Create_PassUnloadedAppDomain(){ - AppDomain otherAD = TestHelpers.CreateAppDomain("SecondAppDomain"); + AppDomain otherAD = TestHelpers.CreateAppDomain("SecondAppDomain"); //this call is not really needed, but let's have it and use it to check if the domain was //created properly and we were able to execute a create call successfully @@ -62,7 +62,7 @@ public void Create_CallMethodsOnSecondUnloadedAppDomain(){ // This throws exception 'System.IO.FileNotFoundException' ScriptRuntime scpRunTimeOne = CreateRemoteRuntime(appDomainOne); - + // This should NOT throw an exception ScriptRuntime scpRunTimeTwo = CreateRemoteRuntime(appDomainTwo); @@ -71,9 +71,9 @@ public void Create_CallMethodsOnSecondUnloadedAppDomain(){ // This should work fine ScriptScope sScpOne = scpRunTimeOne.CreateScope(); - + // *** USABILITY *** can be simpler then test plan - // indicates - perhaps could gather test from other code + // indicates - perhaps could gather test from other code // into one place to do light weight end to end tests. // Usability tests - Never Get Here because of earlier exception. @@ -88,7 +88,7 @@ public void Create_CallMethodsOnSecondUnloadedAppDomain(){ ScriptScope sScpEng = pEng.CreateScope(); object fooObj = sScpEng.GetVariable("foo"); Assert.IsTrue(fooObj.Equals(exptRtnVal), "Did the operation work"); - + // This should throw AppDomainUnloadedException ScriptScope sScpTwo = scpRunTimeTwo.CreateScope(); } @@ -113,7 +113,7 @@ public void Create_PartialTrust() { AppDomain.Unload(newDomain); } - + [Test] [Negative] [ExpectedException(typeof(ArgumentException))] @@ -121,12 +121,12 @@ public void Create_PartialTrust() { public void ExecuteFile_InvalidPath(){ ScriptRuntime runTime = CreateRuntime(); - // BUG : An invalid path throws an 'Microsoft.Scripting.SyntaxErrorException' + // BUG : An invalid path throws an 'Riverside.Scripting.SyntaxErrorException' string[] paths = StandardTestPaths.CreateBadPathCombinations(Path.GetTempPath()); foreach(string p in paths) runTime.ExecuteFile(p + "foo.py"); } - + [Test] [Negative] [ExpectedException(typeof(SyntaxErrorException))] @@ -143,7 +143,7 @@ public void ExecuteFile_ValidPathToScriptWithUnRegExtension(){ String tmpFile = TestHelpers.CreateTempFile(_codeSnippets[CodeType.Valid1]); _runtime.ExecuteFile(tmpFile); } - + [Test] [Negative] [ExpectedException(typeof(ArgumentNullException))] @@ -249,7 +249,7 @@ public void UseFile_ValidPath() { v.Close(); File.WriteAllText(tmpFile, _codeSnippets[CodeType.IsEvenFunction]); - + scope = _runtime.UseFile(tmpFile); isodd = scope.GetVariable>("isodd"); Assert.IsFalse(isodd(12)); @@ -266,7 +266,7 @@ public void UseFile_PartialPath() { } /// - /// Ensure multiple sets result in the latest 'set' having the effect + /// Ensure multiple sets result in the latest 'set' having the effect /// (this test is pretty obvious. but doesnt hurt to have here) /// [Test] @@ -274,7 +274,7 @@ public void Globals_TryToAccessNamesSet(){ ScriptScopeDictionary dict = new ScriptScopeDictionary(); string key = "foo"; dict[key] = 1; - + _runtime.Globals = _testEng.CreateScope(new ObjectDictionaryExpando(dict)); Assert.AreEqual(1, _runtime.Globals.GetVariable( key)); @@ -315,7 +315,7 @@ public void CreateScope_WithManyPreExistingScopes(){ ScriptScope curScope, prevScope = null; // Create a 'numberOfScopeTests' and make - // each scope is unique - + // each scope is unique - for (int i = 0; i < 10; i++) { curScope = _runtime.CreateScope(); @@ -360,13 +360,13 @@ public void CreateScope_PassNull(){ } /// - /// Pass a valid global IAttributesCollection object and validate + /// Pass a valid global IAttributesCollection object and validate /// all lookups in the scope go through the provided IAttributesCollection /// [Test] public void CreateScope_PassValidScope(){ ScriptScopeDictionary dict = new ScriptScopeDictionary(); - + dict["foo_1"] = 1000; dict["foo_2"] = 2000; @@ -386,7 +386,7 @@ public void CreateScope_PassValidScope(){ /// /// Invoke the method twice with the same 'globals' - /// + /// /// 2 different ScriptScopes with no side effect created. /// Verify the first returned value has no changes after /// the second call. @@ -549,13 +549,13 @@ public void ScriptIO_Get(){ [Test, Negative, ExpectedException(typeof(ArgumentException))] public void Setup_EmptySetup() { - + new ScriptRuntime(new ScriptRuntimeSetup()); } [Test] public void Setup_EmptyDisplayName() { - + var setup = ScriptRuntimeTest.CreateSetup(); setup.LanguageSetups[0].DisplayName = ""; var runtime = new ScriptRuntime(setup); @@ -563,7 +563,7 @@ public void Setup_EmptyDisplayName() { } [Test, Negative, ExpectedException(typeof(InvalidOperationException))] - public void Setup_InvalidTypeName() { + public void Setup_InvalidTypeName() { // Dev10 bug 502234 var setup = ScriptRuntimeTest.CreateSetup(); setup.LanguageSetups[0].TypeName = setup.LanguageSetups[0].TypeName.Replace("PythonContext", "PythonBuffer"); diff --git a/Tests/HostingTest/ScriptRuntimeTestHelper.cs b/Tests/HostingTest/ScriptRuntimeTestHelper.cs index 0fed6d4c..c70c0f22 100644 --- a/Tests/HostingTest/ScriptRuntimeTestHelper.cs +++ b/Tests/HostingTest/ScriptRuntimeTestHelper.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. using System; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting.Hosting; using NUnit.Framework; namespace HostingTest @@ -38,13 +38,13 @@ internal static ScriptRuntime CreatePythonOnlyRuntime(string[] ids, string[] ext return new ScriptRuntime(srs); } } - + internal static class ScriptRuntimeExtensions { internal static bool IsValid(this ScriptRuntime sr) { ScriptEngine se = sr.GetEngine("py"); ScriptScope ss = se.CreateScope(); - ScriptSource code = se.CreateScriptSourceFromString("five=2+3", Microsoft.Scripting.SourceCodeKind.Statements); + ScriptSource code = se.CreateScriptSourceFromString("five=2+3", Riverside.Scripting.SourceCodeKind.Statements); code.Execute(ss); return (int)ss.GetVariable("five") == 5; diff --git a/Tests/HostingTest/ScriptScopeDictionary.cs b/Tests/HostingTest/ScriptScopeDictionary.cs index 9f74aa4c..32d1bff7 100644 --- a/Tests/HostingTest/ScriptScopeDictionary.cs +++ b/Tests/HostingTest/ScriptScopeDictionary.cs @@ -4,8 +4,8 @@ using System; using System.Collections.Generic; -using Microsoft.Scripting; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting; +using Riverside.Scripting.Runtime; using System.Runtime.Serialization; namespace HostingTest { diff --git a/Tests/HostingTest/ScriptScopeTest.cs b/Tests/HostingTest/ScriptScopeTest.cs index 02c050a7..ace7a287 100644 --- a/Tests/HostingTest/ScriptScopeTest.cs +++ b/Tests/HostingTest/ScriptScopeTest.cs @@ -2,10 +2,10 @@ using System.Collections.Generic; using System.IO; using IronPython.Runtime.Exceptions; -using Microsoft.Scripting; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting; +using Riverside.Scripting.Hosting; using NUnit.Framework; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Runtime; using System.Runtime.Remoting; using System.Text; @@ -28,7 +28,7 @@ public void ContainsVariable_NoDefaultEngineContainsVariable() { /// - /// Test : No Default Engine test for existence of a variable contained in the scope with wrong + /// Test : No Default Engine test for existence of a variable contained in the scope with wrong /// case lookup string. /// Expected : Fail /// @@ -54,7 +54,7 @@ public void ContainsVariable_BasicLookup() { } /// - /// Test : Null name + /// Test : Null name /// Expected : ArgumentNullException /// [Negative] @@ -92,7 +92,7 @@ public void GetVariable_WithNonExistentVariable() { _runtime.CreateScope().GetVariable("MissingVar"); } - [Ignore] + [Ignore] [Test] public void DefaultEngine_GetDefaultEngineTest() { ScriptRuntime defaultRuntime = CreateRuntime(); @@ -111,8 +111,8 @@ public void SetVariable_WithNullName() { } /// - /// Test : No default engine, empty string name, any value - /// Expect : the value to be inserted properly with an empty + /// Test : No default engine, empty string name, any value + /// Expect : the value to be inserted properly with an empty /// string name identifier (or arguably an exception) /// [Test] @@ -126,8 +126,8 @@ public void SetVariable_WithEmptyName() { } /// - /// Test : No default engine and case sensitive engine, existing name with a new casing, - /// any value + /// Test : No default engine and case sensitive engine, existing name with a new casing, + /// any value /// Expected : New casing inserted properly, old casing undisturbed /// [Test] @@ -168,7 +168,7 @@ public void SetVariable_SetExistingVarToNewValue() { } /// - /// Test : ‘name’ already exists; but value’s actual type is different from the + /// Test : ‘name’ already exists; but value’s actual type is different from the /// current one. /// Expected : New value and new type is available subsequently /// @@ -192,7 +192,7 @@ public void ExecuteGeneric_CallEmptyArg() { } /// - /// Test : Correct T value and valid Expression + /// Test : Correct T value and valid Expression /// Expected : Returns a expresion as type T. /// [Test] @@ -327,7 +327,7 @@ public void RemoveVariable_WrongCase() { /// /// Scope bound to thsi engine, new name - /// + /// /// New variable is created matching the given name and value. /// [Test] @@ -349,9 +349,9 @@ public void SetVariable_ScopeBoundToEngineSetNewName() { } /// - /// + /// /// Test for empty string value lookup - /// + /// /// [Test] public void ContainVariable_EmptyStringValue() { @@ -389,7 +389,7 @@ public void SetVariable_ScopeBoundToEngineSetExistingName() { /// /// name.Length > 255 and name not declared in scope - /// + /// /// Expected return false /// [Test] @@ -411,19 +411,19 @@ public void ContainVariable_NameLengthGT256WithNonExistingName() { string tLongKey = longStrTest.ToString(); - // Validate that this key is longer then 256 + // Validate that this key is longer then 256 Assert.IsTrue(tLongKey.Length > BigValueToTestBeyond); // Get default scope with set values ScriptScope TestScope = _testEng.CreateScope(new ObjectDictionaryExpando(global)); - // Lookup Long key + // Lookup Long key Assert.IsFalse(TestScope.ContainsVariable(tLongKey)); } /// - /// name.Length > 20 and name declared in scope + /// name.Length > 20 and name declared in scope /// expected return true. /// [Test] @@ -443,14 +443,14 @@ public void ContainVariable_NameLengthTwentyWithExistingName() { Assert.IsTrue(TestScope.ContainsVariable(key[0])); } - + /// /// Try Get Variable for the casses of GetVariableGenericT(...) - /// + /// /// 1) Get When var exists - Get value set to its value and a return of true - /// 2) Get when it doesn't exist - value set to null and a + /// 2) Get when it doesn't exist - value set to null and a /// return of false - /// 3) When it doesn't or cannot be converted to T, value set to null + /// 3) When it doesn't or cannot be converted to T, value set to null /// and return of false - HOW CAN WE TEST THIS CASE? /// [Test] @@ -486,9 +486,9 @@ public void TryGetVariableGenericT_MultipleCases() { /// /// 1) Get When var exists - Get value set to its value and a return of true - /// 2) Get when it doesn't exist - value set to null and a + /// 2) Get when it doesn't exist - value set to null and a /// return of false - /// + /// /// [Test] public void TryGetVariable_multipleCases() { @@ -525,9 +525,9 @@ public void TryGetVariable_multipleCases() { /// /// 1) Get When var exists - Get value set to its value and a return of true - /// 2) Get when it doesn't exist - value set to null and a + /// 2) Get when it doesn't exist - value set to null and a /// return of false - /// + /// /// [Test] public void TryGetVariableAsHandle_MultipleCases() { @@ -628,7 +628,7 @@ public void GetItems_MultipleCalls() { } - + [Test] public void GetItems_MultipleCallsRemoteRuntime() { ValidateGetItems(_remoteRuntime); @@ -640,9 +640,9 @@ public void Execute_ValidExpressionResult() { Assert.AreEqual((int)(_testEng.Execute("1 + 1")), 2); } - + // Bug # 482429 validation - // TODO : Replace existing Generic Execute + // TODO : Replace existing Generic Execute [Test] public void ExecuteGeneric_ValidExpressionResult() { @@ -658,7 +658,7 @@ public void TryGetVariable_ValidateExistingScopeItem() int expected1; Assert.IsTrue(scope.TryGetVariable("var1", out expected1)); Assert.AreEqual(expected1, 1); - + } // Bug # 485727 @@ -669,7 +669,7 @@ public void TryGetVariable_ValidateNonExistingScopeItem() string expected1; Assert.IsFalse(scope.TryGetVariable("var1", out expected1)); Assert.AreEqual(expected1, null); - + } // Bug # 485727 @@ -695,7 +695,7 @@ public void TryGetVaiable_TryWrongTypeGet() [ExpectedException(typeof(ArgumentNullException))] public void GetVariableAsHandle_NullName() { - // Create a valid Scope Dictionary + // Create a valid Scope Dictionary ScriptScopeDictionary global = new ScriptScopeDictionary(); // Populate with some test data global["Test1"] = 1111; @@ -730,7 +730,7 @@ public void GetVariableAsHandle_LocalEngine_NonExistentName() { [Test] public void GetVariableAsHandle_LocalEngineExistingName() { - // Create a valid Scope Dictionary + // Create a valid Scope Dictionary ScriptScopeDictionary global = new ScriptScopeDictionary(); // Populate with some test data global["Test1"] = 1111; @@ -750,7 +750,7 @@ public void GetVariableAsHandle_LocalEngineExistingName() { /// - /// Remote engine, remote value, return var value returned + /// Remote engine, remote value, return var value returned /// wrapped in ObjectHandle. /// [Test] @@ -774,17 +774,17 @@ public void GetVariableAsHandle_RemoteEngineRemoteValue() { /// - /// Use a Non-null globals dictonary should Returns a new, usable, + /// Use a Non-null globals dictonary should Returns a new, usable, /// ScriptScope with globals as the backing dictionary. Scope updates s /// hold be reflected in globals. - /// + /// /// Also make changes with Execute and verify they are global /// scope is updated. /// [Test] public void CreateScope_UsingValidScopeDic() { - // Create a Scope Dictionary + // Create a Scope Dictionary ScriptScopeDictionary global = new ScriptScopeDictionary(); // Populate with some test data global["One"] = 1; @@ -811,7 +811,7 @@ public void CreateScope_UsingValidScopeDic() { [Test] public void GetVariable_EmptyString() { - // Create a Scope Dictionary + // Create a Scope Dictionary ScriptScopeDictionary global = new ScriptScopeDictionary(); // Populate with some test data global["Test1"] = 1111; diff --git a/Tests/HostingTest/ScriptScopeTestHelper.cs b/Tests/HostingTest/ScriptScopeTestHelper.cs index a4c6fbd0..ea3d4f06 100644 --- a/Tests/HostingTest/ScriptScopeTestHelper.cs +++ b/Tests/HostingTest/ScriptScopeTestHelper.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting.Hosting; using NUnit.Framework; @@ -20,7 +20,7 @@ public TestContext TestContext { testContextInstance = value; } } - + private void ValidateGetItems(ScriptRuntime runtime) { ScriptScope scope = runtime.CreateScope(); @@ -45,7 +45,7 @@ internal static bool IsValid(this ScriptScope scope) { /// /// Check If Scope Is Empty - /// + /// /// Simply verify that there are zero elements /// internal static bool IsEmpty(this ScriptScope scope) { @@ -68,9 +68,9 @@ internal static bool HasNoDefaultLanguage(this ScriptScope scope) { } /// - /// Check to make sure that two seperate (i.e. not references to same memory) + /// Check to make sure that two seperate (i.e. not references to same memory) /// ScriptScope objects are equivalent. - /// + /// /// 1) If they are NOT pointing at the same memory. /// 2) If they have the same number of elements and each scope element is the /// same then they are both equal diff --git a/Tests/HostingTest/ScriptSourceTest.cs b/Tests/HostingTest/ScriptSourceTest.cs index 1f493756..bb1d4943 100644 --- a/Tests/HostingTest/ScriptSourceTest.cs +++ b/Tests/HostingTest/ScriptSourceTest.cs @@ -5,8 +5,8 @@ using System; using System.Text; using System.Text.RegularExpressions; -using Microsoft.Scripting; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting; +using Riverside.Scripting.Hosting; using NUnit.Framework; #if SILVERLIGHT @@ -15,10 +15,10 @@ namespace HostingTest { using Assert = NUnit.Framework.Assert; - + [TestFixture] public partial class ScriptSourceTest : HAPITestBase { - + [Test] public void ScriptEngine_CreateScriptSource1() { } @@ -48,8 +48,8 @@ public void ScriptSource_GetCodeProperties() { ValidateGetCodeProperties( _codeSnippets[CodeType.WhiteSpace1], ScriptCodeParseResult.Invalid); } - - + + [Test] public void ScriptSource_Engine() { foreach (CodeSnippet cs in _codeSnippets.AllSnippets) { @@ -71,12 +71,12 @@ public void ScriptSource_GetCode() { [ExpectedException(typeof(ArgumentException))] public void GetCodeLine_NegativeOutOfBoundsOfActualLineNumbers() { - ScriptSource sSrc = _testEng.CreateScriptSourceFromString(_codeSnippets[CodeType.OneLineAssignmentStatement], + ScriptSource sSrc = _testEng.CreateScriptSourceFromString(_codeSnippets[CodeType.OneLineAssignmentStatement], SourceCodeKind.SingleStatement); //throws sSrc.GetCodeLine(-1); } - + [Test] [Negative] [ExpectedException(typeof(ArgumentException))] @@ -107,7 +107,7 @@ public void GetCodeLine_GetValidCodeLine() string codeLine = sSrc.GetCodeLine(actualCode); Assert.AreEqual(codeLine, _codeSnippets[CodeType.OneLineAssignmentStatement]); } - + /// /// Verify that the \r is valid LinefeedTerminator in a string. /// @@ -117,13 +117,13 @@ public void GetCodeLine_GetValidCodeLineWithLinefeedTerminatorR() //Source example using \r string strTestSrc = "x = 1+2\ry= 3+4"; string strExpectedTestLine = "y= 3+4"; - // The second line of code input during CreateScriptSourceFromString + // The second line of code input during CreateScriptSourceFromString // if '\r' is a valid LinefeedTerminator int expectedCodeLine = 2; - + ScriptSource sSrc = _testEng.CreateScriptSourceFromString(strTestSrc, SourceCodeKind.Statements); - // Get the second line + // Get the second line string codeLine = sSrc.GetCodeLine(expectedCodeLine); // Check the expected value Assert.AreEqual(codeLine, strExpectedTestLine); @@ -205,7 +205,7 @@ public void GetCodeLines_Basic4() { public void GetCodeLines_GetCodeLinesInRangeFromFile() { string sourceInput = _codeSnippets[CodeType.SevenLinesOfAssignemtStatements]; - + string scriptName = TestHelpers.CreateTempSourceFile(sourceInput, ".py"); ScriptSource source = _testEng.CreateScriptSourceFromFile(scriptName); @@ -223,13 +223,13 @@ public void Path_CheckDefaultValueIsNull() } [Test] - [Ignore()]//Bug 464777 - the test actually succeeds, but we want to check for the path->scope mapping + [Ignore()]//Bug 464777 - the test actually succeeds, but we want to check for the path->scope mapping //and that is blocked by this bug public void Path_ExplicitSetDuringConstruction() { string path = "UniquePath1"; ScriptSource src = _testEng.CreateScriptSourceFromString( - _codeSnippets[CodeType.SimpleExpressionOnePlusOne], + _codeSnippets[CodeType.SimpleExpressionOnePlusOne], path); Assert.AreEqual(path, src.Path); @@ -281,7 +281,7 @@ public void Path_NotExplicitlySet4() } /// - /// + /// /// [Test] public void Compile_Invoke() @@ -347,17 +347,17 @@ public void Compile_InvokeWithOptions() SourceCodeKind.Expression); // This is only a stub - I think. CompilerOptions options = new CompilerOptions(); - + CompiledCode ccode = source.Compile(options); object results = ccode.Execute(); Assert.Fail("This test is block by the missing CompiledCode class"); } /// - /// Test Case: - /// Multiple invocation of the same call + /// Test Case: + /// Multiple invocation of the same call /// Verification: - /// Same correct value is returned + /// Same correct value is returned /// [Test] public void Execute_MultipleInvocation() @@ -378,7 +378,7 @@ public void Execute_MultipleInvocation() } /// - /// Test Case: + /// Test Case: /// Multiple invocation of the same call doesn't return reference to the same object /// We need a method that would return a reference type. Simple ints and strings wont cut it. /// Verification: @@ -401,8 +401,8 @@ public void Execute_CallingPythonMethod() { ScriptScope scope = _testEng.CreateScope(); - // Execute source in scope - ScriptSource source = scope.Engine.CreateScriptSourceFromString(_codeSnippets[CodeType.IsOddFunction], Microsoft.Scripting.SourceCodeKind.Statements); + // Execute source in scope + ScriptSource source = scope.Engine.CreateScriptSourceFromString(_codeSnippets[CodeType.IsOddFunction], Riverside.Scripting.SourceCodeKind.Statements); source.Execute(scope); //Get a Delegate Instance using the Func<> Generic declaration and GetVariable @@ -413,13 +413,13 @@ public void Execute_CallingPythonMethod() Assert.IsFalse(isodd(2)); } - + /// - /// Test Case: + /// Test Case: /// Python defines a method and we call it from C# multiple times /// Verification: /// Validate that a defined method is called. - /// + /// /// This example is more of a ScriptScope example /// [Ignore]// Bug #466321 @@ -429,8 +429,8 @@ public void Execute_SingleInvocationMultipleCallsOfLoadedFn() // Setup tests simple result of rot13 on string and it's result //string testInput = "shone"; //string expResult = ""; -// int testRuns = 1; - +// int testRuns = 1; + // load script ScriptSource source = _testEng.CreateScriptSourceFromString(_codeSnippets[CodeType.Rot13Function], SourceCodeKind.Statements); @@ -439,7 +439,7 @@ public void Execute_SingleInvocationMultipleCallsOfLoadedFn() // Execute for this scope (return val is null since code is statement) source.Execute(scope); - + // From scope GetVariables using predefined generic delegate Func rot13 = scope.GetVariable>("rot13"); @@ -448,24 +448,24 @@ public void Execute_SingleInvocationMultipleCallsOfLoadedFn() //// string newTestInput, newExpResult; // for (int i = 0; i < testRuns; i++) // { -// // call function defined by python script over and over and +// // call function defined by python script over and over and // verify that the new result is different. //newTestInput = string.Format(testInput + "{0}", i); //newExpResult = string.Format(expResult + "{0}", i); - + string fnResult = rot13("newTestInput"); - + // check the results. //Assert.AreEqual(fnResult, newExpResult); //} } /// - /// Test Case: + /// Test Case: /// Multiple invocation of the same call /// Verification: /// Validate that a defined method is called. - /// + /// /// //with a different python code (or removed altogether) [Test] @@ -476,12 +476,12 @@ public void Execute_MultipleInvocationValidDefinedMethodIsCalled() ValidateExecute("abs(-1)", 1); } - + /// /// Load a python script that has a valid class and methods. /// This tests that we can get access to these function and call them - /// from within C#. - /// + /// from within C#. + /// /// Case 1 : calling a function defined in C# /// [Test] @@ -490,7 +490,7 @@ public void Execute_CallingPythonObjectMethodWrappedInAFun() ScriptSource source = _testEng.CreateScriptSourceFromString( _codeSnippets[CodeType.SimpleFooClassDefinition], SourceCodeKind.Statements); - + ScriptScope scope = _testEng.CreateScope(); source.Execute(scope); @@ -501,13 +501,13 @@ public void Execute_CallingPythonObjectMethodWrappedInAFun() /// /// Load a python script that has a valid class and methods. /// This tests that we can get access to these function and call them - /// from within C#. - /// + /// from within C#. + /// /// Case 2 : calling an object that has been created of type FooClass and - /// calling it's member function. + /// calling it's member function. /// [Test] - public void Execute_CallingInstanceMethodDefinedInAPythonObject() + public void Execute_CallingInstanceMethodDefinedInAPythonObject() { // Setup tests string testSrc = _codeSnippets[CodeType.SimpleFooClassDefinition]; @@ -526,13 +526,13 @@ public void Execute_CallingInstanceMethodDefinedInAPythonObject() // Now call fooTest's object member function 'f' string result = sayHello(); Assert.AreEqual(result, expResult); - + } /// /// Test : Load a python script that has a valid class and method(s). /// This tests that we can get access to these function and call them - /// from within C#. - /// + /// from within C#. + /// /// Result : Successfully, calling the FooClass member from C#. /// [Test] @@ -543,12 +543,12 @@ public void Execute_CallingPythonClassMemberMethod() string expResult = "Hello World"; ScriptSource source = _testEng.CreateScriptSourceFromString(testSrc, SourceCodeKind.Statements); - + ScriptScope scope = _testEng.CreateScope(); // Execute for this scope (return val is null since code is statement) source.Execute(scope); - + object FooClass = scope.GetVariable("FooClass"); object fooTest = _testEng.Operations.Invoke(FooClass); // create new FooClass Func sayHello = _testEng.Operations.GetMember>(FooClass, "f"); @@ -558,7 +558,7 @@ public void Execute_CallingPythonClassMemberMethod() } /// - /// Test Case: + /// Test Case: /// Verification: /// [Test] @@ -567,16 +567,16 @@ public void Execute_AccessValidVarInScope() // Setup tests data ScriptScopeDictionary env = new ScriptScopeDictionary(); env["test1"] = -10; - + ValidateExecute(env, "abs(test1)", 10); } - + /// - /// Test Case: - /// Script invokes a variable pre defined in the scope + /// Test Case: + /// Script invokes a variable pre defined in the scope /// Verification: - /// Script executes against the preset value of the var + /// Script executes against the preset value of the var /// [Test] public void Execute_UseVarDefinedInScope() @@ -588,10 +588,10 @@ public void Execute_UseVarDefinedInScope() } // - /// Test Case: + /// Test Case: /// Execute /// Verification: - /// Script executes against the preset value of the var + /// Script executes against the preset value of the var /// [Test] public void Execute_ResultAvailableInScope() @@ -600,17 +600,17 @@ public void Execute_ResultAvailableInScope() // Python abs method on var defined in default script scope string testInput = @" test1 = -10 -test1 = abs(test1)"; - +test1 = abs(test1)"; + // Exp result is the absolute value of test1 ScriptSource source = _testEng.CreateScriptSourceFromString(testInput, SourceCodeKind.Statements); // Create scope ScriptScope scope = _testEng.CreateScope(); - - // Setup var to hold result and execute for this scope + + // Setup var to hold result and execute for this scope source.Execute(scope); - + // Check affect of Execution object testResult = scope.GetVariable("test1"); Assert.AreEqual(testResult, 10); @@ -632,7 +632,7 @@ public void Execute_NullScriptScope() source.Execute((ScriptScope)null); } - + [Test] public void ExecuteAndGetAsHandle_CheckExpectedReturnValue() { @@ -669,7 +669,7 @@ public void GetReader_MoveIntoStreamCreateNewReaderAndCheckPosition() // Create first reader SourceCodeReader srcFirstUnitReader = source.GetReader(); - // This could be a little fragile. Might be better just to hard code + // This could be a little fragile. Might be better just to hard code // expected value. - Save first line with first reader. Assert.IsTrue(srcFirstUnitReader.SeekLine(1)); string expValue = srcFirstUnitReader.ReadLine(); @@ -683,7 +683,7 @@ public void GetReader_MoveIntoStreamCreateNewReaderAndCheckPosition() } /// - ///Test: Create 2 reader objects and read from them independently + ///Test: Create 2 reader objects and read from them independently ///(ex ): Read 20% using the first reader, 40% using the second reader ///Expected Result: The readers are unaffected and don’t interfere in the other’s instance /// @@ -706,7 +706,7 @@ public void GetReader_TwoIndependentReadersAccessingSameData() int cnt = 0; // Read first half of stream with first stream reader while (((chrnbr = srcFirstUnitReader.Read()) > 0) && (cnt < codeMidPoint)){ - + strBuffer.Append((char)chrnbr); cnt++; // inc cnt // Increment Second Reader diff --git a/Tests/HostingTest/ScriptSourceTestHelper.cs b/Tests/HostingTest/ScriptSourceTestHelper.cs index b81748fa..af25f608 100644 --- a/Tests/HostingTest/ScriptSourceTestHelper.cs +++ b/Tests/HostingTest/ScriptSourceTestHelper.cs @@ -1,9 +1,9 @@ using System; using System.IO; -using Microsoft.Scripting; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting; +using Riverside.Scripting.Hosting; using NUnit.Framework; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Runtime; namespace HostingTest { @@ -25,7 +25,7 @@ public TestContext TestContext { } #region Additional test attributes - // + // //You can use the following additional attributes as you write your tests: // //Use ClassInitialize to run code before running the first test in the class @@ -73,7 +73,7 @@ internal ScriptSource CreateFileBasedScriptSource(string pythonCode) { internal ScriptSource CreateStringBasedScriptSource(string code) { return _testEng.CreateScriptSourceFromString(code); } - + internal ScriptSource CreateScriptSource(string code) { return CreateStringBasedScriptSource(code); } @@ -91,7 +91,7 @@ internal ScriptSource CreateScriptSource(string code, SourceCodeKind inputKind) /// The value with which the enum should be verified against internal void ValidateKind(string InputCode, SourceCodeKind input, SourceCodeKind ExpectedValue) { ScriptSource ss = CreateScriptSource(InputCode, input); - + Assert.AreEqual(ss.Kind, ExpectedValue); } @@ -181,7 +181,7 @@ internal void ValidateGetCodeLines(string statements, int startIndex, int count, private void ValidateExecute( string expression, int expResult) { ScriptSource source = _testEng.CreateScriptSourceFromString(expression, SourceCodeKind.Expression); - + // Execute source using scope and capture result object testResult = source.Execute(_testEng.CreateScope()); // test result against expected result @@ -203,7 +203,7 @@ private void ValidateExecute(ScriptScopeDictionary env, string expression, int e private void ValidateExecute(ScriptScope scope, string expression, int expResult) { ScriptSource source = _testEng.CreateScriptSourceFromString(expression, SourceCodeKind.Expression); - + // Execute source using scope and capture result object testResult = source.Execute(scope); @@ -231,10 +231,10 @@ private void ValidateExecuteProgram(string expression, int expectedResult, Sourc Assert.AreEqual(expectedResult, exitCode); } - + #endregion } - + } diff --git a/Tests/HostingTest/TestHelpers.cs b/Tests/HostingTest/TestHelpers.cs index 07beb3ed..573fa75e 100644 --- a/Tests/HostingTest/TestHelpers.cs +++ b/Tests/HostingTest/TestHelpers.cs @@ -5,8 +5,8 @@ using System; using System.IO; using System.Text; -using Microsoft.Scripting.Hosting; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Hosting; +using Riverside.Scripting.Utils; using NUnit.Framework; using System.Reflection; using System.Collections; @@ -24,7 +24,7 @@ internal class TestHelpers { public static string StandardConfigFile { get; private set; } /// - ///Directory where tests execute and binaries are loaded from + ///Directory where tests execute and binaries are loaded from /// public static string BinDirectory { get; private set; } @@ -62,7 +62,7 @@ internal static void RedirectOutput(ScriptRuntime runTime, TextWriter output, Sy runTime.IO.RedirectToConsole(); } } - + [Flags] internal enum OutputFlags { None = 0, @@ -91,7 +91,7 @@ internal static void AssertOutput(ScriptRuntime runTime, System.Action f, string Assert.IsTrue(actualOutput == expectedOutput, "Unexpected output: '" + builder.Replace("\r", "\\r").Replace("\n", "\\n").Replace("\t", "\\t") + "'."); } - + internal static void AreEqualArrays(IList expected, IList actual) { Assert.AreEqual(actual.Count, expected.Count); for (int i = 0; i < actual.Count; i++) { @@ -145,7 +145,7 @@ public class EnvSetupTearDown { public EnvSetupTearDown(string name, string newValue) { _envName = name; _oldEnvEntry = Environment.GetEnvironmentVariable(name); - + Environment.SetEnvironmentVariable(name, newValue); } ~EnvSetupTearDown() { @@ -154,4 +154,4 @@ public EnvSetupTearDown(string name, string newValue) { } } } -} \ No newline at end of file +} diff --git a/Tests/HostingTest/TestHost.cs b/Tests/HostingTest/TestHost.cs index b68ab262..5b598ebb 100644 --- a/Tests/HostingTest/TestHost.cs +++ b/Tests/HostingTest/TestHost.cs @@ -5,7 +5,7 @@ using System; using System.Reflection; -using Microsoft.Scripting.Hosting; +using Riverside.Scripting.Hosting; namespace HostingTest { public class TestHost : ScriptHost { diff --git a/Tests/Metadata/Metadata.csproj b/Tests/Metadata/Metadata.csproj index 009de736..d4e51b69 100644 --- a/Tests/Metadata/Metadata.csproj +++ b/Tests/Metadata/Metadata.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/Tests/Metadata/MetadataTablesExtensions.cs b/Tests/Metadata/MetadataTablesExtensions.cs index 2b1c06cd..ce6454ff 100644 --- a/Tests/Metadata/MetadataTablesExtensions.cs +++ b/Tests/Metadata/MetadataTablesExtensions.cs @@ -8,7 +8,7 @@ using System.Text; using System.Reflection; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Metadata; +using Riverside.Scripting.Metadata; namespace Metadata { public static class MetadataTablesExtensions { @@ -23,7 +23,7 @@ public static bool IsNested(this TypeAttributes attrs) { case TypeAttributes.Public: case TypeAttributes.NotPublic: return false; - + default: return true; } @@ -80,7 +80,7 @@ public static IEnumerable GetVisibleExtensionMethods(this MetadataTab if ((mattrs & MethodAttributes.MemberAccessMask) == MethodAttributes.Public && (mattrs & MethodAttributes.Static) != 0) { var declType = mdef.FindDeclaringType(); var tattrs = declType.Attributes; - if (((tattrs & TypeAttributes.VisibilityMask) == TypeAttributes.Public || + if (((tattrs & TypeAttributes.VisibilityMask) == TypeAttributes.Public || (tattrs & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPublic) && (tattrs & TypeAttributes.Abstract) != 0 && (tattrs & TypeAttributes.Sealed) != 0) { diff --git a/Tests/Metadata/NamespaceTree.cs b/Tests/Metadata/NamespaceTree.cs index a1a12ed6..78e1b975 100644 --- a/Tests/Metadata/NamespaceTree.cs +++ b/Tests/Metadata/NamespaceTree.cs @@ -7,8 +7,8 @@ using System.Linq; using System.Text; using System.Reflection; -using Microsoft.Scripting.Metadata; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Metadata; +using Riverside.Scripting.Utils; namespace Metadata { public sealed class NamespaceTreeNode { @@ -40,7 +40,7 @@ internal void AddNamespace(NamespaceTreeNode ns) { _lastChild._nextSibling = ns; _lastChild = ns; } - + } public MetadataNamePart Name { get; } @@ -66,7 +66,7 @@ public IEnumerable GetNamespaces() { /// public void Merge(NamespaceTreeNode other) { ContractUtils.Requires(other != null); - + if (other._typeDefs != null) { _typeDefs.AddRange(other._typeDefs); other._typeDefs = null; @@ -87,7 +87,7 @@ public void Merge(NamespaceTreeNode other) { } } } - + public sealed class NamespaceTree { // Maps every prefix of every namespace name to the corresponding namespace: private readonly Dictionary _names; @@ -107,7 +107,7 @@ public IEnumerable GetAllNamespaces() { public void Add(MetadataTables tables) { ContractUtils.Requires(tables != null); - + foreach (TypeDef typeDef in tables.TypeDefs) { if (typeDef.IsGlobal || typeDef.Attributes.IsNested()) { continue; @@ -129,7 +129,7 @@ public void Add(MetadataTables tables) { ContractUtils.Assert(prefix.Length > 0); int lastDot = prefix.LastIndexOf((byte)'.', prefix.Length - 1, prefix.Length); - + MetadataNamePart name = (lastDot >= 0) ? prefix.GetPart(lastDot + 1) : prefix; NamespaceTreeNode newNs = new NamespaceTreeNode(name); if (ns == null) { diff --git a/Tests/Metadata/NamespaceTree_Reflection.cs b/Tests/Metadata/NamespaceTree_Reflection.cs index 6bdb00b3..b04ff544 100644 --- a/Tests/Metadata/NamespaceTree_Reflection.cs +++ b/Tests/Metadata/NamespaceTree_Reflection.cs @@ -7,8 +7,8 @@ using System.Linq; using System.Text; using System.Reflection; -using Microsoft.Scripting.Metadata; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Metadata; +using Riverside.Scripting.Utils; namespace Metadata { public sealed class RNamespaceTreeNode { @@ -40,7 +40,7 @@ internal void AddNamespace(RNamespaceTreeNode ns) { _lastChild._nextSibling = ns; _lastChild = ns; } - + } public string Name { get; } @@ -66,7 +66,7 @@ public IEnumerable GetNamespaces() { /// public void Merge(RNamespaceTreeNode other) { ContractUtils.Requires(other != null); - + if (other._typeDefs != null) { _typeDefs.AddRange(other._typeDefs); other._typeDefs = null; @@ -134,7 +134,7 @@ public void Add(Module module) { ContractUtils.Assert(prefix.Length > 0); int lastDot = prefix.LastIndexOf('.', prefix.Length - 1, prefix.Length); - + string name = (lastDot >= 0) ? prefix.Substring(lastDot + 1) : prefix; RNamespaceTreeNode newNs = new RNamespaceTreeNode(name); if (ns == null) { diff --git a/Tests/Metadata/Program.cs b/Tests/Metadata/Program.cs index c3f16165..865d6e67 100644 --- a/Tests/Metadata/Program.cs +++ b/Tests/Metadata/Program.cs @@ -11,7 +11,7 @@ using System.Text.RegularExpressions; using System.IO; using System.Diagnostics; -using Microsoft.Scripting.Metadata; +using Riverside.Scripting.Metadata; using System.Security; using System.Security.Policy; using System.Security.Permissions; @@ -100,9 +100,9 @@ private static void DumpNamespaceTree(NamespaceTreeNode node) { private static void DumpNamespaceTree(int level, NamespaceTreeNode node) { string indent = new String(' ', level * 2); - _output.WriteLine("{0}{1}: {2}/{3}", - indent, - node.Name, + _output.WriteLine("{0}{1}: {2}/{3}", + indent, + node.Name, node.GetTypeDefs().Count(), (from def in node.GetTypeDefs() where (def.Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.Public select def).Count() ); @@ -312,14 +312,14 @@ private static void DumpMembers(TypeDef typeDef) { } foreach (MethodDef methodDef in typeDef.Methods) { - _output.WriteLine(" method {0}", methodDef.Name); - + _output.WriteLine(" method {0}", methodDef.Name); + if (Detailed) { _output.WriteLine(" signature: {0}", SignatureToString(methodDef.Signature)); _output.WriteLine(" attributes: {0} {1}", methodDef.Attributes, methodDef.ImplAttributes); DumpCustomAttributes(methodDef.CustomAttributes, " "); DumpGenericParameters(methodDef.GenericParameters, methodDef.Record); - + foreach (ParamDef p in methodDef.Parameters) { _output.WriteLine(" parameter #{0}: {1}", p.Index, p.Name); Debug.Assert(p.FindDeclaringMethod().Record.Equals(methodDef)); @@ -410,7 +410,7 @@ public static void DumpModule(MetadataTables tables) { ModuleDef md = tables.ModuleDef; _output.WriteLine("Module:"); _output.WriteLine(" {0} {1}", md.Name, md.Mvid); - + AssemblyDef adef = tables.AssemblyDef; if (!adef.Record.IsNull) { _output.WriteLine("AssemblyDef:"); @@ -545,7 +545,7 @@ private static void Enumerate(IEnumerable tables) { tree.Add(moduleTables); ModuleEnumerated(moduleTables); } - + Counter_Types += (from ns in tree.GetAllNamespaces() from t in ns.GetTypeDefs() @@ -567,7 +567,7 @@ private static void EnumerateProperties(IEnumerable tables) { foreach (var moduleTables in tables) { Stopwatch swAssociates = new Stopwatch(); Stopwatch swMethodsAndFields = new Stopwatch(); - + int typesWithAssociates = 0; int methodCount = 0, fieldCount = 0; int propertyCount = 0, eventCount = 0; @@ -575,7 +575,7 @@ private static void EnumerateProperties(IEnumerable tables) { int typePropertyCount = 0, typeEventCount = 0; swAssociates.Start(); - + foreach (PropertyDef prop in type.Properties) { typePropertyCount++; } @@ -607,7 +607,7 @@ private static void EnumerateProperties(IEnumerable tables) { Path.GetFileName(moduleTables.Path), swAssociates.ElapsedMilliseconds, swMethodsAndFields.ElapsedMilliseconds, - propertyCount, + propertyCount, eventCount, methodCount, fieldCount, @@ -625,7 +625,7 @@ private static void EnumerateProperties(IEnumerable tables) { 0x00000000, 1, 0x00000080, 1, 0x00000084, 1, - 0x00000098, 1, + 0x00000098, 1, 0x00000108, 2, 0x00000168, 2, 0x00000180, 4, @@ -653,7 +653,7 @@ private unsafe static void FuzzTables(IEnumerable tables) { } private unsafe static void TestCorruptedHeaders(byte[] memory, byte* ptr, MemoryBlock newImage) { - foreach (uint data in new uint[] { 0, 0x0000ffff, 0xffff0000, 0x00ff00ff, 0xff0000ff, 0xff00ff00, 0xffffffff, 0x0100ffff, 0x01010101, + foreach (uint data in new uint[] { 0, 0x0000ffff, 0xffff0000, 0x00ff00ff, 0xff0000ff, 0xff00ff00, 0xffffffff, 0x0100ffff, 0x01010101, (uint)PEMagic.PEMagic64, (uint)PEMagic.PEMagic32}) { for (int i = 0; i < _Offsets.Length; i += 2) { @@ -765,12 +765,12 @@ private static void Measure(Action f) { private static IEnumerable FwAssemblyFiles() { return Directory.GetFiles(Path.GetDirectoryName(typeof(object).Assembly.Location), "*.dll"); } - + static void Main(string[] args) { //Detailed = true; //DumpMembers(typeof(Tests.Class1<,,,,>)); //DumpMembers(typeof(System.Security.Policy.NetCodeGroup), true); - + List argList = new List(args); if (argList.Remove("/?")) { Console.WriteLine("Usage: Metadata.exe [options] [assembly list|*]"); @@ -870,7 +870,7 @@ select Path.Combine(fwDir, fileName) argList.Add(typeof(Regex).Assembly.Location); } - // tables: + // tables: List tables; IEnumerable assemblies; if (loadAssemblies) { @@ -951,7 +951,7 @@ from module in assembly.GetModules(false) File.Delete(tempDumpFile); } } - + return; } diff --git a/Tests/Metadata/RubyModules.cs b/Tests/Metadata/RubyModules.cs index 277916df..85277a6c 100644 --- a/Tests/Metadata/RubyModules.cs +++ b/Tests/Metadata/RubyModules.cs @@ -8,7 +8,7 @@ using System.Diagnostics; using System.Linq.Expressions; -using Microsoft.Scripting.Metadata; +using Riverside.Scripting.Metadata; namespace Metadata { public class RubyContext { @@ -26,7 +26,7 @@ internal void OnAssemblyLoaded(Assembly assembly) { } } } - + internal abstract class ClrModuleInfo { internal abstract void InitializeConstants(RubyContext context, Dictionary constants); } diff --git a/Tests/Metadata/Scripts/coverage.cmd b/Tests/Metadata/Scripts/coverage.cmd index 75cf2de4..c42b68f0 100644 --- a/Tests/Metadata/Scripts/coverage.cmd +++ b/Tests/Metadata/Scripts/coverage.cmd @@ -7,17 +7,17 @@ rmdir /s /y "%DST%" mkdir "%DST%" xcopy /s /y "%SRC%\Metadata.exe" "%DST%" -xcopy /s /y "%SRC%\Microsoft.Dynamic.dll" "%DST%" -xcopy /s /y "%SRC%\Microsoft.Scripting.dll" "%DST%" +xcopy /s /y "%SRC%\Riverside.Dynamic.dll" "%DST%" +xcopy /s /y "%SRC%\Riverside.Scripting.dll" "%DST%" -%VSINSTR% "%SRC%\Microsoft.Dynamic.dll" +%VSINSTR% "%SRC%\Riverside.Dynamic.dll" "%PERF_TOOLS%\vsperfcmd.exe" /start:coverage /OUTPUT:"%DST%\Metadata" "%DST%\Metadata.exe" /f "%DLR_ROOT%\Runtime\Tests\Metadata\TestFiles\1.exe" "%DST%\Metadata.exe" /u /d ponetmd > NUL - + "%PERF_TOOLS%\vsperfcmd.exe" /shutdown @echo Code Coverage results generated to -@echo %DST%\Metadata.coverage \ No newline at end of file +@echo %DST%\Metadata.coverage diff --git a/Tests/Metadata/Sequence.cs b/Tests/Metadata/Sequence.cs index 64666bf5..70a126bd 100644 --- a/Tests/Metadata/Sequence.cs +++ b/Tests/Metadata/Sequence.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; namespace Metadata { // TODO: diff --git a/Tests/Metadata/TypeNestings.cs b/Tests/Metadata/TypeNestings.cs index 8a83def9..649d1ece 100644 --- a/Tests/Metadata/TypeNestings.cs +++ b/Tests/Metadata/TypeNestings.cs @@ -7,8 +7,8 @@ using System.Linq; using System.Text; using System.Reflection; -using Microsoft.Scripting.Metadata; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Metadata; +using Riverside.Scripting.Utils; namespace Metadata { public sealed class TypeNestings { diff --git a/Tests/Metadata/UnitTests.cs b/Tests/Metadata/UnitTests.cs index 749cbd4c..d60bf14e 100644 --- a/Tests/Metadata/UnitTests.cs +++ b/Tests/Metadata/UnitTests.cs @@ -8,7 +8,7 @@ using NUnit.Framework; -using Microsoft.Scripting.Metadata; +using Riverside.Scripting.Metadata; namespace Metadata { [TestFixture] @@ -20,7 +20,7 @@ public unsafe void TestEmpty() { MetadataName e = new MetadataName(fempty, null); Assert.That(e, Is.EqualTo(MetadataName.Empty)); Assert.That(e, Is.EqualTo(MetadataNamePart.Empty)); - + Assert.That(MetadataName.Empty.IsEmpty, Is.True); Assert.That(MetadataName.Empty.GetHashCode(), Is.EqualTo(e.GetHashCode())); Assert.That(MetadataName.Empty, Is.EqualTo(e)); @@ -91,7 +91,7 @@ public unsafe void TestEquals() { byte[] b2 = Encoding.UTF8.GetBytes("__hello__\0"); byte[] b3 = Encoding.UTF8.GetBytes("__hell\0"); byte[] b4 = Encoding.UTF8.GetBytes("\0"); - + fixed (byte* fb1 = &b1[0]) { MetadataName name = new MetadataName(fb1, null); Assert.That(name.Equals(b2, 2, 5), Is.True); diff --git a/Tests/Microsoft.Dynamic.Test/InterpreterTest.cs b/Tests/Riverside.Dynamic.Test/InterpreterTest.cs similarity index 97% rename from Tests/Microsoft.Dynamic.Test/InterpreterTest.cs rename to Tests/Riverside.Dynamic.Test/InterpreterTest.cs index f4671bd0..704c5dad 100644 --- a/Tests/Microsoft.Dynamic.Test/InterpreterTest.cs +++ b/Tests/Riverside.Dynamic.Test/InterpreterTest.cs @@ -2,7 +2,7 @@ using System; using System.Linq.Expressions; -namespace Microsoft.Dynamic.Test { +namespace Riverside.Dynamic.Test { [TestFixture] public class InterpreterTest { public class TestGc { diff --git a/Tests/Microsoft.Dynamic.Test/LightExceptionTests.cs b/Tests/Riverside.Dynamic.Test/LightExceptionTests.cs similarity index 97% rename from Tests/Microsoft.Dynamic.Test/LightExceptionTests.cs rename to Tests/Riverside.Dynamic.Test/LightExceptionTests.cs index 89935a3e..34233a67 100644 --- a/Tests/Microsoft.Dynamic.Test/LightExceptionTests.cs +++ b/Tests/Riverside.Dynamic.Test/LightExceptionTests.cs @@ -9,21 +9,21 @@ using System.Reflection; using System.Runtime.CompilerServices; -using Microsoft.Scripting.Actions; -using Microsoft.Scripting.Generation; -using Microsoft.Scripting.Runtime; +using Riverside.Scripting.Actions; +using Riverside.Scripting.Generation; +using Riverside.Scripting.Runtime; using NUnit.Framework; -namespace Microsoft.Dynamic.Test { +namespace Riverside.Dynamic.Test { [TestFixture] internal class LightExceptionTests { - private Func>[] StatementBuilders = new[] { - new Func>(TryCatchBuilder), - new Func>(TryFinallyBuilder), - new Func>(ThrowBuilder), - new Func>(CallBuilder), - new Func>(ReturnBuilder), + private Func>[] StatementBuilders = new[] { + new Func>(TryCatchBuilder), + new Func>(TryFinallyBuilder), + new Func>(ThrowBuilder), + new Func>(CallBuilder), + new Func>(ReturnBuilder), }; private static ParameterExpression _input = Expression.Parameter(typeof(List), "log"); private static MethodInfo _addLog = typeof(List).GetMethod(nameof(List.Add)); diff --git a/Tests/Microsoft.Dynamic.Test/Microsoft.Dynamic.Test.csproj b/Tests/Riverside.Dynamic.Test/Riverside.Dynamic.Test.csproj similarity index 86% rename from Tests/Microsoft.Dynamic.Test/Microsoft.Dynamic.Test.csproj rename to Tests/Riverside.Dynamic.Test/Riverside.Dynamic.Test.csproj index 1fa19c51..3e5f47bf 100644 --- a/Tests/Microsoft.Dynamic.Test/Microsoft.Dynamic.Test.csproj +++ b/Tests/Riverside.Dynamic.Test/Riverside.Dynamic.Test.csproj @@ -13,7 +13,7 @@ - + diff --git a/Tests/Microsoft.Dynamic.Test/TestReflectionServices.cs b/Tests/Riverside.Dynamic.Test/TestReflectionServices.cs similarity index 99% rename from Tests/Microsoft.Dynamic.Test/TestReflectionServices.cs rename to Tests/Riverside.Dynamic.Test/TestReflectionServices.cs index 457193d3..c65004c1 100644 --- a/Tests/Microsoft.Dynamic.Test/TestReflectionServices.cs +++ b/Tests/Riverside.Dynamic.Test/TestReflectionServices.cs @@ -5,11 +5,11 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; -using Microsoft.Scripting.Utils; +using Riverside.Scripting.Utils; using NUnit.Framework; using Assert = NUnit.Framework.Assert; -namespace Microsoft.Dynamic.Test { +namespace Riverside.Dynamic.Test { [TestFixture] public class TestReflectionServices { [Test] diff --git a/Tests/Microsoft.Dynamic.Test/TestTuple.cs b/Tests/Riverside.Dynamic.Test/TestTuple.cs similarity index 95% rename from Tests/Microsoft.Dynamic.Test/TestTuple.cs rename to Tests/Riverside.Dynamic.Test/TestTuple.cs index e4973bf7..4e05b088 100644 --- a/Tests/Microsoft.Dynamic.Test/TestTuple.cs +++ b/Tests/Riverside.Dynamic.Test/TestTuple.cs @@ -6,10 +6,10 @@ using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; -using Microsoft.Scripting; +using Riverside.Scripting; using NUnit.Framework; -namespace Microsoft.Dynamic.Test { +namespace Riverside.Dynamic.Test { // Strongbox should not ever be sealed class MyStrongBox : StrongBox { @@ -91,14 +91,14 @@ public void VerifyTuple(int size) { Assert.Throws(delegate () { t.GetValue(size); }); } else { /*We're requesting an index in the scope of this tuple but beyond the scope of our - requested capacity (in which case the field's type will be Microsoft.Scripting.None + requested capacity (in which case the field's type will be Riverside.Scripting.None and we won't be able to convert "3" to that). Imagine asking for a tuple of 3 ints, - we'd actually get a Tuple since there is no + we'd actually get a Tuple since there is no Tuple that takes only 3 generic arguments.*/ Assert.Throws(delegate () { t.SetValue(size, 3); }); //Verify the type of the field - Assert.AreEqual(typeof(Microsoft.Scripting.Runtime.DynamicNull), tupleType.GetGenericArguments()[size]); + Assert.AreEqual(typeof(Riverside.Scripting.Runtime.DynamicNull), tupleType.GetGenericArguments()[size]); //Verify the value of the field is null Assert.AreEqual(null, t.GetValue(size)); diff --git a/Tests/Microsoft.Dynamic.Test/Utils/MathUtilsTest.cs b/Tests/Riverside.Dynamic.Test/Utils/MathUtilsTest.cs similarity index 99% rename from Tests/Microsoft.Dynamic.Test/Utils/MathUtilsTest.cs rename to Tests/Riverside.Dynamic.Test/Utils/MathUtilsTest.cs index 44b4574f..eed01121 100644 --- a/Tests/Microsoft.Dynamic.Test/Utils/MathUtilsTest.cs +++ b/Tests/Riverside.Dynamic.Test/Utils/MathUtilsTest.cs @@ -2,7 +2,7 @@ using NUnit.Framework; -namespace Microsoft.Dynamic.Test.Utils +namespace Riverside.Dynamic.Test.Utils { [TestFixture] public class MathUtilsTest { diff --git a/Tests/Microsoft.Scripting.Test/Microsoft.Scripting.Test.csproj b/Tests/Riverside.Scripting.Test/Riverside.Scripting.Test.csproj similarity index 86% rename from Tests/Microsoft.Scripting.Test/Microsoft.Scripting.Test.csproj rename to Tests/Riverside.Scripting.Test/Riverside.Scripting.Test.csproj index 616b0f04..7e7c132d 100644 --- a/Tests/Microsoft.Scripting.Test/Microsoft.Scripting.Test.csproj +++ b/Tests/Riverside.Scripting.Test/Riverside.Scripting.Test.csproj @@ -13,7 +13,7 @@ - + diff --git a/Tests/Microsoft.Scripting.Test/Utils/ArrayUtilsTest.cs b/Tests/Riverside.Scripting.Test/Utils/ArrayUtilsTest.cs similarity index 97% rename from Tests/Microsoft.Scripting.Test/Utils/ArrayUtilsTest.cs rename to Tests/Riverside.Scripting.Test/Utils/ArrayUtilsTest.cs index 1f876b96..37021266 100644 --- a/Tests/Microsoft.Scripting.Test/Utils/ArrayUtilsTest.cs +++ b/Tests/Riverside.Scripting.Test/Utils/ArrayUtilsTest.cs @@ -2,7 +2,7 @@ using NUnit.Framework; -namespace Microsoft.Scripting.Test.Utils +namespace Riverside.Scripting.Test.Utils { [TestFixture] public class ArrayUtilsTest { diff --git a/make.ps1 b/make.ps1 index 8a97f4bf..6e7dc4db 100755 --- a/make.ps1 +++ b/make.ps1 @@ -16,19 +16,7 @@ $_BASEDIR = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent if(!$global:isUnix) { $_VSWHERE = [System.IO.Path]::Combine(${env:ProgramFiles(x86)}, 'Microsoft Visual Studio\Installer\vswhere.exe') - $_VSINSTPATH = '' - - if([System.IO.File]::Exists($_VSWHERE)) { - $_VSINSTPATH = & "$_VSWHERE" -latest -requires Microsoft.Component.MSBuild -property installationPath - } else { - Write-Error "Visual Studio 2019 16.8.0 or later is required" - Exit 1 - } - - if(-not [System.IO.Directory]::Exists($_VSINSTPATH)) { - Write-Error "Could not determine installation path to Visual Studio" - Exit 1 - } + $_VSINSTPATH = 'C:\Program Files\Microsoft Visual Studio\2022\Community' if([System.IO.File]::Exists([System.IO.Path]::Combine($_VSINSTPATH, 'MSBuild\Current\Bin\MSBuild.exe'))) { $_MSBUILDPATH = [System.IO.Path]::Combine($_VSINSTPATH, 'MSBuild\Current\Bin\') @@ -40,7 +28,7 @@ if(!$global:isUnix) { $_defaultFrameworkSettings = @{ "runner" = "dotnet"; - "tests" = @{ "Microsoft.Dynamic.Test" = "Tests/Microsoft.Dynamic.Test"; "Microsoft.Scripting.Test" = "Tests/Microsoft.Scripting.Test"; "Metadata" = "Tests/Metadata" }; + "tests" = @{ "Riverside.Dynamic.Test" = "Tests/Riverside.Dynamic.Test"; "Riverside.Scripting.Test" = "Tests/Riverside.Scripting.Test"; "Metadata" = "Tests/Metadata" }; "args" = @('test', '__BASEDIR__/__TESTFOLDER__', '-f', '__FRAMEWORK__', '-o', '__BASEDIR__/bin/__CONFIGURATION__/__FRAMEWORK__', '-c', '__CONFIGURATION__', '--no-build', '-l', "trx;LogFileName=__FILTERNAME__-__TESTDESC__-__FRAMEWORK__-__CONFIGURATION__-result.trx", '-s', '__RUNSETTINGS__'); "filterArg" = '--filter="__FILTER__"'; "filters" = @{