} /* end PrintSettings */ /* --------------------------------------------------------------------------- * private method SetCapability(option, value) * --------------------------------------------------------------------------- * Sets the capability associated with option to the given value. * ------------------------------------------------------------------------ */ private static void SetCapability(Option option, bool value) { Capability capability; switch (option) { case Option.Synonyms: capability = Capability.Synonyms; break; case Option.OctalLiterals: capability = Capability.OctalLiterals; break; case Option.LowlineIdentifiers: capability = Capability.LowlineIdentifiers; break; case Option.ExplicitCast: capability = Capability.ExplicitCast; break; case Option.Coroutines: capability = Capability.Coroutines; break; case Option.VariantRecords: capability = Capability.VariantRecords; break; case Option.LocalModules: capability = Capability.LocalModules; break; case Option.ToDoStatement: capability = Capability.ToDoStatement; break; default: // not a capability option return; } /* end switch */ if (Dialects.IsMutableCapability(dialect, capability)) { Capabilities.SetCapability(capability, value); } /* end if */ } /* end SetCapability */
} /* end SetOption */ /* --------------------------------------------------------------------------- * method IsMutableOption(option) * --------------------------------------------------------------------------- * Returns true if option is mutable for the current dialect, else false. * ------------------------------------------------------------------------ */ public static bool IsMutableOption(Option option) { Capability capability; switch (option) { case Option.Synonyms: capability = Capability.Synonyms; break; case Option.OctalLiterals: capability = Capability.OctalLiterals; break; case Option.LowlineIdentifiers: capability = Capability.LowlineIdentifiers; break; case Option.ExplicitCast: capability = Capability.ExplicitCast; break; case Option.VariantRecords: capability = Capability.VariantRecords; break; case Option.LocalModules: capability = Capability.LocalModules; break; case Option.ToDoStatement: capability = Capability.ToDoStatement; break; default: return(true); } /* end switch */ return(Dialects.IsMutableCapability(dialect, capability)); } /* end SetCapability */