Example #1
0
 public override void VisitRaise(RaiseStatement raise)
 {
     raise.Value.Accept(this);
     if (raise.Value.NodeType == typeManager.StrType) {
         Type etype = typeof(Exception);
         ConstructorInfo constructor =
             etype.GetConstructor(new Type[] { typeof(string) });
         ilGenerator.Emit(OpCodes.Newobj, constructor);
     }
     ilGenerator.Emit(OpCodes.Throw);
 }
Example #2
0
 public override void VisitRaise(RaiseStatement raise)
 {
     raise.Value.Accept(this);
     if (raise.Value.NodeType != typeManager.StrType &&
         !raise.Value.NodeType.IsSubtypeOf(typeManager.ExceptionType)) {
         report.Error(raise.Location, "exception expected");
     }
 }
Example #3
0
File: node.cs Project: shugo/babel
 public virtual void VisitRaise(RaiseStatement raise)
 {
 }