示例#1
0
文件: codegen.cs 项目: shugo/babel
 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);
 }
示例#2
0
文件: typecheck.cs 项目: shugo/babel
 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");
     }
 }
示例#3
0
文件: node.cs 项目: shugo/babel
 public virtual void VisitRaise(RaiseStatement raise)
 {
 }