Author: rafael
Date: 2005-07-05 11:21:32 -0400 (Tue, 05 Jul 2005)
New Revision: 46946

Modified:
   trunk/mcs/class/Mono.GetOptions/ChangeLog
   
trunk/mcs/class/Mono.GetOptions/Mono.GetOptions.Useful/CommonCompilerOptions.cs
   trunk/mcs/class/Mono.GetOptions/Mono.GetOptions/OptionDetails.cs
   trunk/mcs/class/Mono.GetOptions/Mono.GetOptions/OptionList.cs
   trunk/mcs/class/Mono.GetOptions/Mono.GetOptions/Options.cs
Log:
        * Mono.GetOptions/OptionDetails.cs: Checks alternate forms first (new 
method IsAlternate(string compoundArg))
        this allow for '/debug[+|-]' coexisting with independently 
listed/described '/debug:full' and '/debug:pdbonly'
        as needed by mbas. Alternate forms are based on the option long form 
name ('debug' not 'g').
        * Mono.GetOptions/OptionList.cs: Register alternates with 
OptionDetails.LinkAlternatesInsideList(). Same reason.
        * Mono.GetOptions.Useful/CommonCompilerOptions.cs: fix /debug:full and 
/debug:pdbonly semantics while positioning
        the public flags
        * Mono.GetOptions/Options.cs: Implement new standard option 
/debugoptions (/~).
                
2005-06-08  Rafael Teixeira  <[EMAIL PROTECTED]>


Modified: trunk/mcs/class/Mono.GetOptions/ChangeLog
===================================================================
--- trunk/mcs/class/Mono.GetOptions/ChangeLog   2005-07-05 13:23:57 UTC (rev 
46945)
+++ trunk/mcs/class/Mono.GetOptions/ChangeLog   2005-07-05 15:21:32 UTC (rev 
46946)
@@ -1,4 +1,13 @@
 2005-06-08  Rafael Teixeira  <[EMAIL PROTECTED]>
+       * Mono.GetOptions/OptionDetails.cs: Checks alternate forms first (new 
method IsAlternate(string compoundArg))
+       this allow for '/debug[+|-]' coexisting with independently 
listed/described '/debug:full' and '/debug:pdbonly'
+       as needed by mbas. Alternate forms are based on the option long form 
name ('debug' not 'g').
+       * Mono.GetOptions/OptionList.cs: Register alternates with 
OptionDetails.LinkAlternatesInsideList(). Same reason.
+       * Mono.GetOptions.Useful/CommonCompilerOptions.cs: fix /debug:full and 
/debug:pdbonly semantics while positioning
+       the public flags
+       * Mono.GetOptions/Options.cs: Implement new standard option 
/debugoptions (/~).
+               
+2005-06-08  Rafael Teixeira  <[EMAIL PROTECTED]>
        * oops Mono.IsPartOfPackage renamed to Mono.IsPartOfPackageAttribute, 
        as mandates the convention
        

Modified: trunk/mcs/class/Mono.GetOptions/Mono.GetOptions/OptionDetails.cs
===================================================================
--- trunk/mcs/class/Mono.GetOptions/Mono.GetOptions/OptionDetails.cs    
2005-07-05 13:23:57 UTC (rev 46945)
+++ trunk/mcs/class/Mono.GetOptions/Mono.GetOptions/OptionDetails.cs    
2005-07-05 15:21:32 UTC (rev 46946)
@@ -65,6 +65,8 @@
                public bool VBCStyleBoolean;
                public bool SecondLevelHelp;
                public bool Hidden;
+               
+               public OptionDetails NextAlternate  = null;
 
                private string ExtractParamName(string shortDescription)
                {
@@ -87,8 +89,10 @@
 
                public string ParamName { get { return paramName; } }
                                
-               private bool verboseParsing { get { return 
OptionBundle.VerboseParsingOfOptions; } }
+               private bool verboseParsing { get { return 
OptionBundle.VerboseParsingOfOptions || OptionBundle.DebuggingOfOptions; } }
 
+//             private bool debugOptions { get { return 
OptionBundle.DebuggingOfOptions; } }
+
                private OptionsParsingMode parsingMode { get { return 
OptionBundle.ParsingMode; } } 
                
                private bool useGNUFormat { get { return (parsingMode & 
OptionsParsingMode.GNU_DoubleDash) == OptionsParsingMode.GNU_DoubleDash; } } 
@@ -381,8 +385,42 @@
                        return false;
                }
 
+               public static void LinkAlternatesInsideList(ArrayList list)
+               {
+                       Hashtable baseForms = new Hashtable(list.Count);
+                       foreach (OptionDetails option in list) {
+                               if (option.LongForm != null) {
+                                       string[] parts = 
option.LongForm.Split(':');
+                                       if (parts.Length < 2) {
+                                               baseForms.Add(option.LongForm, 
option);
+                                       } else {
+                                               OptionDetails baseForm = 
(OptionDetails)baseForms[parts[0]];
+                                               if (baseForm != null) {
+                                                       // simple linked list
+                                                       option.NextAlternate = 
baseForm.NextAlternate;
+                                                       baseForm.NextAlternate 
= option;
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               private bool IsAlternate(string compoundArg)
+               {
+                       OptionDetails next = NextAlternate;
+                       while (next != null) {
+                               if (next.IsThisOption(compoundArg))
+                                       return true;
+                               next = next.NextAlternate;
+                       }
+                       return false;
+               }
+
                public OptionProcessingResult ProcessArgument(string arg, 
string nextArg)
                {
+                       if (IsAlternate(arg + ":" + nextArg))
+                               return OptionProcessingResult.NotThisOption;
+                               
                        if (IsThisOption(arg))
                        {
                                if (!NeedsParameter)

Modified: trunk/mcs/class/Mono.GetOptions/Mono.GetOptions/OptionList.cs
===================================================================
--- trunk/mcs/class/Mono.GetOptions/Mono.GetOptions/OptionList.cs       
2005-07-05 13:23:57 UTC (rev 46945)
+++ trunk/mcs/class/Mono.GetOptions/Mono.GetOptions/OptionList.cs       
2005-07-05 15:21:32 UTC (rev 46946)
@@ -439,6 +439,8 @@
                        bool OptionWasProcessed;
 
                        list.Sort();
+                       
+                       OptionDetails.LinkAlternatesInsideList(list);
 
                        args = NormalizeArgs(args);
 

Modified: trunk/mcs/class/Mono.GetOptions/Mono.GetOptions/Options.cs
===================================================================
--- trunk/mcs/class/Mono.GetOptions/Mono.GetOptions/Options.cs  2005-07-05 
13:23:57 UTC (rev 46945)
+++ trunk/mcs/class/Mono.GetOptions/Mono.GetOptions/Options.cs  2005-07-05 
15:21:32 UTC (rev 46946)
@@ -162,7 +162,24 @@
                        get { return verboseParsingOfOptions; }
                }
 
+               private bool debuggingOfOptions = false;
+               
+               [Option("Show debugging info while processing options", '~', 
"debugoptions", SecondLevelHelp = true)]
+               public bool DebuggingOfOptions
+               {
+                       set { 
+                               debuggingOfOptions = value; 
+                               if (value) {
+                                       Console.WriteLine("ParsingMode = {0}", 
ParsingMode);
+                                       
Console.WriteLine("BreakSingleDashManyLettersIntoManyOptions = {0}", 
BreakSingleDashManyLettersIntoManyOptions);
+                                       
Console.WriteLine("EndOptionProcessingWithDoubleDash = {0}", 
EndOptionProcessingWithDoubleDash);
+                                       Console.WriteLine("DontSplitOnCommas = 
{0}", DontSplitOnCommas);
+                               }
+                       }
+                       get { return debuggingOfOptions; }
+               }
 
+
        }
        
 }

Modified: 
trunk/mcs/class/Mono.GetOptions/Mono.GetOptions.Useful/CommonCompilerOptions.cs
===================================================================
--- 
trunk/mcs/class/Mono.GetOptions/Mono.GetOptions.Useful/CommonCompilerOptions.cs 
    2005-07-05 13:23:57 UTC (rev 46945)
+++ 
trunk/mcs/class/Mono.GetOptions/Mono.GetOptions.Useful/CommonCompilerOptions.cs 
    2005-07-05 15:21:32 UTC (rev 46946)
@@ -239,15 +239,31 @@
                [Option("Remove integer checks. Default off.", SecondLevelHelp 
= true, VBCStyleBoolean = true)]
                public virtual bool removeintchecks { set { CheckedContext = 
!value; } }
 
-               [Option("Emit debugging information", 'g', "debug", 
VBCStyleBoolean = true)]
+               [Option("Emit full debugging information", 'g', "debug", 
VBCStyleBoolean = true)]
                public bool WantDebuggingSupport = false;
 
                [Option("Emit full debugging information (default)", 
"debug:full", SecondLevelHelp = true)]
-               public bool FullDebugging = false;
-
-               [Option("[IGNORED] Emit PDB file only", "debug:pdbonly", 
SecondLevelHelp = true)]
+               public bool debugfull { 
+                       set { 
+                               WantDebuggingSupport = value; 
+                               FullDebugging = value; 
+                               MdbOnly = !value; 
+                       }
+               }
+               
+               [Option("Emit MDB file only", "debug:pdbonly", SecondLevelHelp 
= true)]
+               public bool debugpdbonly {
+                       set { 
+                               WantDebuggingSupport = value; 
+                               FullDebugging = !value; 
+                               MdbOnly = value; 
+                       }
+               }
+       
                public bool MdbOnly = false;
+               public bool FullDebugging = true;
 
+
                // errors and warnings options
                
//------------------------------------------------------------------
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to