You've already forked linux-packaging-mono
Imported Upstream version 4.8.0.309
Former-commit-id: 5f9c6ae75f295e057a7d2971f3a6df4656fa8850
This commit is contained in:
parent
ee1447783b
commit
94b2861243
@@ -5,3 +5,4 @@ Evaluator/EvaluatorFixture.cs
|
||||
Evaluator/EvaluatorTest.cs
|
||||
Evaluator/ExpressionsTest.cs
|
||||
Evaluator/TypesTest.cs
|
||||
Visit/ASTVisitorTest.cs
|
||||
|
||||
@@ -120,7 +120,8 @@ namespace MonoTests.EvaluatorTest
|
||||
Evaluator.Run ("var a = new int[]{1,2,3};");
|
||||
|
||||
object res = Evaluator.Evaluate ("from x in a select x + 1;");
|
||||
CollectionAssert.AreEqual (new int[] { 2, 3, 4 }, ((IEnumerable<int>) res).ToArray ());
|
||||
|
||||
Assert.AreEqual (new int[] { 2, 3, 4 }, ((IEnumerable<int>) res).ToArray ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -201,4 +202,4 @@ namespace MonoTests.EvaluatorTest
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
60
mcs/class/Mono.CSharp/Test/Visit/ASTVisitorTest.cs
Normal file
60
mcs/class/Mono.CSharp/Test/Visit/ASTVisitorTest.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using NUnit.Framework;
|
||||
using Mono.CSharp;
|
||||
using System.IO;
|
||||
|
||||
namespace MonoTests.Visit
|
||||
{
|
||||
[TestFixture]
|
||||
public class ASTVisitorTest
|
||||
{
|
||||
class TestVisitor : StructuralVisitor
|
||||
{
|
||||
}
|
||||
|
||||
[SetUp]
|
||||
public void Setup ()
|
||||
{
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Simple ()
|
||||
{
|
||||
//string content = @"class A { }";
|
||||
string content = @"
|
||||
|
||||
class Foo
|
||||
{
|
||||
void Bar ()
|
||||
{
|
||||
completionList.Add (""delegate"" + sb, ""md-keyword"", GettextCatalog.GetString (""Creates anonymous delegate.""), ""delegate"" + sb + "" {"" + Document.Editor.EolMarker + stateTracker.Engine.ThisLineIndent + TextEditorProperties.IndentString + ""|"" + Document.Editor.EolMarker + stateTracker.Engine.ThisLineIndent +""};"");
|
||||
}
|
||||
}"
|
||||
;
|
||||
|
||||
|
||||
var stream = new MemoryStream (Encoding.UTF8.GetBytes (content));
|
||||
|
||||
var ctx = new CompilerContext (new CompilerSettings (), new AssertReportPrinter ());
|
||||
|
||||
ModuleContainer module = new ModuleContainer (ctx);
|
||||
var file = new SourceFile ("test", "asdfas", 0);
|
||||
CSharpParser parser = new CSharpParser (
|
||||
new SeekableStreamReader (stream, Encoding.UTF8),
|
||||
new CompilationSourceFile (module, file),
|
||||
ctx.Report,
|
||||
new ParserSession ());
|
||||
|
||||
RootContext.ToplevelTypes = module;
|
||||
Location.Initialize (new List<SourceFile> { file });
|
||||
parser.parse ();
|
||||
|
||||
Assert.AreEqual (0, ctx.Report.Errors);
|
||||
|
||||
module.Accept (new TestVisitor ());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,4 @@
|
||||
#include Mono.CSharp.dll.sources
|
||||
../corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs
|
||||
../corlib/System.Reflection.Emit/FlowControl.cs
|
||||
../corlib/System.Reflection.Emit/OpCode.cs
|
||||
../corlib/System.Reflection.Emit/OpCodeNames.cs
|
||||
../corlib/System.Reflection.Emit/OpCodes.cs
|
||||
../corlib/System.Reflection.Emit/OpCodeType.cs
|
||||
../corlib/System.Reflection.Emit/OperandType.cs
|
||||
../corlib/System.Reflection.Emit/PEFileKinds.cs
|
||||
../corlib/System.Reflection.Emit/Label.cs
|
||||
../corlib/System.Reflection.Emit/MethodToken.cs
|
||||
../corlib/System.Reflection.Emit/StackBehaviour.cs
|
||||
monotouch.cs
|
||||
|
||||
@@ -28,66 +28,6 @@
|
||||
|
||||
namespace System.Reflection.Emit
|
||||
{
|
||||
public class ILGenerator
|
||||
{
|
||||
public void BeginCatchBlock (Type exceptionType)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public Label BeginExceptionBlock ()
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void BeginExceptFilterBlock ()
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void BeginFinallyBlock ()
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public LocalBuilder DeclareLocal (params object[] args)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public Label DefineLabel ()
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void Emit (OpCode opcode)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void Emit (OpCode opcode, object args)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void EmitCall (OpCode opcode, params object[] args)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void EndExceptionBlock ()
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void MarkLabel (Label loc)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public int ILOffset { get; set; }
|
||||
}
|
||||
|
||||
public class TypeBuilder : Type
|
||||
{
|
||||
#region implemented abstract members of MemberInfo
|
||||
@@ -528,230 +468,6 @@ namespace System.Reflection.Emit
|
||||
}
|
||||
}
|
||||
|
||||
public class LocalBuilder : LocalVariableInfo
|
||||
{
|
||||
}
|
||||
|
||||
public class GenericTypeParameterBuilder : Type
|
||||
{
|
||||
#region implemented abstract members of MemberInfo
|
||||
|
||||
public override bool IsDefined (Type attributeType, bool inherit)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override object[] GetCustomAttributes (bool inherit)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override object[] GetCustomAttributes (Type attributeType, bool inherit)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override string Name {
|
||||
get {
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region implemented abstract members of Type
|
||||
|
||||
public override Type GetInterface (string name, bool ignoreCase)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override Type[] GetInterfaces ()
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override Type GetElementType ()
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override EventInfo GetEvent (string name, BindingFlags bindingAttr)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override EventInfo[] GetEvents (BindingFlags bindingAttr)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override FieldInfo GetField (string name, BindingFlags bindingAttr)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override FieldInfo[] GetFields (BindingFlags bindingAttr)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override MemberInfo[] GetMembers (BindingFlags bindingAttr)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
protected override MethodInfo GetMethodImpl (string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override MethodInfo[] GetMethods (BindingFlags bindingAttr)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override Type GetNestedType (string name, BindingFlags bindingAttr)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override Type[] GetNestedTypes (BindingFlags bindingAttr)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override PropertyInfo[] GetProperties (BindingFlags bindingAttr)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
protected override PropertyInfo GetPropertyImpl (string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
protected override TypeAttributes GetAttributeFlagsImpl ()
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
protected override bool HasElementTypeImpl ()
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
protected override bool IsArrayImpl ()
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
protected override bool IsByRefImpl ()
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
protected override bool IsCOMObjectImpl ()
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
protected override bool IsPointerImpl ()
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
protected override bool IsPrimitiveImpl ()
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override ConstructorInfo[] GetConstructors (BindingFlags bindingAttr)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override object InvokeMember (string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, string[] namedParameters)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public override Assembly Assembly {
|
||||
get {
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override string AssemblyQualifiedName {
|
||||
get {
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override Type BaseType {
|
||||
get {
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override string FullName {
|
||||
get {
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override Guid GUID {
|
||||
get {
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override Module Module {
|
||||
get {
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override string Namespace {
|
||||
get {
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override Type UnderlyingSystemType {
|
||||
get {
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void SetCustomAttribute (params object[] args)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void SetGenericParameterAttributes (GenericParameterAttributes genericParameterAttributes)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void SetInterfaceConstraints (params Type[] interfaceConstraints)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void SetBaseTypeConstraint (Type baseTypeConstraint)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public class ConstructorBuilder : MethodBase
|
||||
{
|
||||
#region implemented abstract members of MemberInfo
|
||||
@@ -1087,19 +803,6 @@ namespace System.Reflection.Emit
|
||||
}
|
||||
}
|
||||
|
||||
public class ParameterBuilder : ParameterInfo
|
||||
{
|
||||
public void SetConstant (object arg)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void SetCustomAttribute (params object[] args)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public class EventBuilder
|
||||
{
|
||||
public void SetAddOnMethod (MethodBuilder mdBuilder)
|
||||
@@ -1118,11 +821,4 @@ namespace System.Reflection.Emit
|
||||
}
|
||||
}
|
||||
|
||||
public class CustomAttributeBuilder
|
||||
{
|
||||
public CustomAttributeBuilder (params object[] args)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +1 @@
|
||||
#include mobile_static_Mono.CSharp.dll.sources
|
||||
monotouch.cs
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
#include mobile_static_Mono.CSharp.dll.sources
|
||||
monotouch.cs
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
#include mobile_static_Mono.CSharp.dll.sources
|
||||
monotouch.cs
|
||||
|
||||
Reference in New Issue
Block a user