Beispiel #1
0
 public static ResolveResult Value(object value, NProject compiler)
 {
     if (value == null)
     {
         return(Null());
     }
     return(new ConstantResolveResult(compiler.Compilation.FindType(value.GetType()), value));
 }
Beispiel #2
0
        public static bool IsAutomatic(this IEvent ev, NProject project)
        {
            var decl = NProjectExtensions.GetDeclaration(ev.AddAccessor);

            return(decl == null);
            //if (decl != null)
            //    return decl is EventDeclaration; //manual events return 'Accessor' type in declaration
            //throw new NotImplementedException();
        }
Beispiel #3
0
        public static ResolveResult GetParent(this ResolveResult res, NProject project)
        {
            var node = res.GetFirstNode();

            if (node == null)
            {
                return(null);
            }
            var parent = node.Parent;

            if (parent == null)
            {
                return(null);
            }
            return(parent.Resolve());
        }
Beispiel #4
0
 public static IType BooleanType(NProject compiler)
 {
     return(compiler.Compilation.FindType(KnownTypeCode.Boolean));
 }
Beispiel #5
0
 public static IType CharType(NProject compiler)
 {
     return(compiler.Compilation.FindType(KnownTypeCode.Char));
 }
Beispiel #6
0
 public static OperatorResolveResult NotEqual(this ResolveResult left, ResolveResult right, NProject compiler)
 {
     return(left.Binary(System.Linq.Expressions.ExpressionType.NotEqual, right, BooleanType(compiler)));
 }
Beispiel #7
0
 public static bool IsGenerated(this IEntity me, NProject project)
 {
     return(me.IsCompilerGenerated());
     //throw new NotImplementedException();
 }