//
// If true, it means that the compiler is executing as
- // in eval mode.
+ // in eval mode so unresolved variables are resolved in
+ // static classes maintained by the eval engine.
//
static public bool EvalMode;
+ //
+ // If true, the compiler is operating in statement mode,
+ // this currently turns local variable declaration into
+ // static variables of a class
+ //
+ static public bool StatementMode;
+
//
// Whether to allow Unsafe code
//
//
static RootContext ()
{
- Reset ();
+ Reset (true);
}
- public static void Reset ()
+ public static void PartialReset ()
{
- root = new RootTypes ();
+ Reset (false);
+ }
+
+ public static void Reset (bool full)
+ {
+ if (full)
+ root = new RootTypes ();
+
type_container_resolve_order = new ArrayList ();
EntryPoint = null;
- Report.WarningLevel = 3;
+ Report.WarningLevel = 4;
Checked = false;
Unsafe = false;
StdLib = true;
if (ds == null)
return;
- ds.DefineMembers ();
ds.Define ();
}
foreach (TypeContainer tc in type_container_resolve_order)
tc.ResolveType ();
foreach (TypeContainer tc in type_container_resolve_order)
- tc.DefineMembers ();
+ tc.Define ();
}
ArrayList delegates = root.Delegates;
if (delegates != null){
foreach (Delegate d in delegates)
- d.DefineMembers ();
+ d.Define ();
}
//
}
}
- //
- // DefineTypes is used to fill in the members of each type.
- //
- static public void DefineTypes ()
- {
- ArrayList delegates = root.Delegates;
- if (delegates != null){
- foreach (Delegate d in delegates)
- d.Define ();
- }
-
- if (type_container_resolve_order != null){
- foreach (TypeContainer tc in type_container_resolve_order) {
- // When compiling corlib, these types have already been
- // populated from BootCorlib_PopulateCoreTypes ().
- if (!RootContext.StdLib &&
- ((tc.Name == "System.Object") ||
- (tc.Name == "System.Attribute") ||
- (tc.Name == "System.ValueType") ||
- (tc.Name == "System.Runtime.CompilerServices.IndexerNameAttribute")))
- continue;
-
- tc.Define ();
- }
- }
- }
-
static public void EmitCode ()
{
if (type_container_resolve_order != null) {