Kaynağa Gözat

Support for C# language.

avkonst 12 yıl önce
ebeveyn
işleme
fb4e1b80bd

+ 3 - 0
mainline/core/db/loader.py

@@ -115,6 +115,7 @@ class FileRegionData(LoadableData):
         STRUCT    = 0x04
         NAMESPACE = 0x08
         FUNCTION  = 0x10
+        INTERFACE = 0x20
         ANY       = 0xFFFFFFFF
         
         def to_str(self, group):
@@ -130,6 +131,8 @@ class FileRegionData(LoadableData):
                 return "namespace"
             elif group == self.FUNCTION:
                 return "function"
+            elif group == self.INTERFACE:
+                return "interface"
             else:
                 assert(False)
     

+ 5 - 3
mainline/ext/std/code/cpp.py

@@ -60,6 +60,7 @@ class CppCodeParser(object):
                                                                       # NOTE: end of line is NOT consumed
                                                                       # NOTE: ([\\](?:\n|\r|\r\n))* for new line separators,
                                                                       # Need to support new line separators in expense of efficiency?
+                | /\*\*/                                              # Match C style comments (empty comment line)
                 | /([\\](?:\n|\r|\r\n))*\*.*?\*([\\](?:\n|\r|\r\n))*/ # Match C style comments
                 | \'(?:\\.|[^\\\'])*\'                                # Match quoted strings
                 | "(?:\\.|[^\\"])*"                                   # Match double quoted strings
@@ -251,8 +252,7 @@ class CppCodeParser(object):
                     indent_current = 0
 
             # Potential namespace, struct, class
-            elif text[m.start():m.end()].startswith(('class','struct','namespace')) == True \
-                and m.group('fn_name') == None: # function name can start with keyword, for example class_id_type()
+            elif m.group('block_type') != None:
                 if next_block['name'] == "":
                     # - 'name'
                     next_block['name'] = m.group('block_name').strip()
@@ -267,7 +267,7 @@ class CppCodeParser(object):
                     # - 'start' detected earlier
 
             # Potential function name detected...
-            else:
+            elif m.group('fn_name') != None:
                 # ... if outside of a function (do not detect enclosed functions, unless classes are matched)
                 if blocks[curblk]['type'] != 'function' and (next_block['name'] == "" or next_block['type'] != 'function'):
                     # - 'name'
@@ -281,6 +281,8 @@ class CppCodeParser(object):
                     # - 'type'
                     next_block['type'] = 'function'
                     # - 'start' detected earlier
+            else:
+                assert(len("Unknown match by regular expression") == 0)
 
         while indent_current > 0:
             # log all

+ 38 - 17
mainline/ext/std/code/cs.py

@@ -55,34 +55,49 @@ class Plugin(core.api.Plugin, core.api.Parent, core.api.IParser, core.api.IConfi
 class CppCodeParser(object):
     
     regex_cpp = re.compile(r'''
-                   /([\\](?:\n|\r|\r\n))*/(?=\n|\r|\r\n)              # Match C++ style comments (empty comment line)
-                |  /([\\](?:\n|\r|\r\n))*/.*?[^\\](?=\n|\r|\r\n)      # Match C++ style comments
+                   //(?=\n|\r|\r\n)                                   # Match C# style comments (empty comment line)
+                |  //.*?(?=\n|\r|\r\n)                                # Match C# style comments
                                                                       # NOTE: end of line is NOT consumed
-                                                                      # NOTE: ([\\](?:\n|\r|\r\n))* for new line separators,
-                                                                      # Need to support new line separators in expense of efficiency?
-                | /([\\](?:\n|\r|\r\n))*\*.*?\*([\\](?:\n|\r|\r\n))*/ # Match C style comments
+                                                                      # NOTE: it is slightly different in C++
+                | /\*\*/                                              # Match C style comments (empty comment line)
+                                                                      # NOTE: it is slightly different in C++
+                | /\*.*?\*/                                           # Match C style comments
+                                                                      # NOTE: it is slightly different in C++
                 | \'(?:\\.|[^\\\'])*\'                                # Match quoted strings
                 | "(?:\\.|[^\\"])*"                                   # Match double quoted strings
-                | (((?<=\n|\r)|^)[ \t]*[#].*?[^\\](?=\n|\r|\r\n))     # Match preprocessor
+                | (((?<=\n|\r)|^)[ \t]*[#].*?(?=\n|\r|\r\n))          # Match preprocessor
                                                                       # NOTE: end of line is NOT consumed
                                                                       # NOTE: beginning of line is NOT consumed
+                                                                      # NOTE: C# does not support backslashing as C++ does
                 | (?P<fn_name>
-                      (operator(                                      # Match C++ operator ...
-                         (\s+[_a-zA-Z][_a-zA-Z0-9]*(\s*\[\s*\])?)     # - cast, new and delete operators
+                      (operator(                                      # Match C# operator ...
+                         (\s+[_a-zA-Z][_a-zA-Z0-9]*(\s*\[\s*\])?)     # - cast, true, false operators
                        | (\s*\[\s*\])                                 # - operator []
                        | (\s*\(\s*\))                                 # - operator ()
                        | (\s*[+-\\*/=<>!%&^|~,?.]{1,3})               # - other operators (from 1 to 3 symbols)
+                                                                      #   NOTE: maybe dot and ? should not be in the list...
                       ))                                               
-                    | ([~]?[_a-zA-Z][_a-zA-Z0-9]*)                    # ... or function or constructor
-                  )\s*[(]                                             # LIMITATION: if there are comments after function name
+                    | (([~]\s*)?[_a-zA-Z][_a-zA-Z0-9]*
+                       ([.][a-zA-Z_][a-zA-Z0-9_]*)*)                  # ... or function or constructor
+                                                                      # NOTE: C# destructor can have spaces in name after ~
+                                                                      # NOTE: explicit interface implementation method has got a dot
+                    | (?P<prop_setget>get|set)                        # ... or property setter/getter
+                  )\s*(?(prop_setget)(?=[{])|[(<])
+                                                                      # LIMITATION: if there are comments after function name
                                                                       # and before '(', it is not detected
                                                                       # LIMITATION: if there are comments within operator definition,
                                                                       # if may be not detected
-                | ((?P<block_type>class|struct|namespace)             # Match C++ class or struct
-                    (?P<block_name>((\s+[a-zA-Z_][a-zA-Z0-9_]*)|(?=\s*[{])))) # noname is supported, symbol '{' is not consumed
+                                                                      # LIMITATION: if there are comments after set|get keyword,
+                                                                      # if may be not detected
+                | ((?P<block_type>class|struct|namespace|interface)   # Match class or struct or interface or namespace
+                    (?P<block_name>(\s+[a-zA-Z_][a-zA-Z0-9_]*)([.][a-zA-Z_][a-zA-Z0-9_]*)*))
+                                                                      # NOTE: noname instances are impossible in C#
+                                                                      # NOTE: names can have sub-names separated by dots
                                                                       # LIMITATION: if there are comments between keyword and name,
                                                                       # it is not detected
-                | [<>{};:]                                            # Match block start/end, brackets and statement separator
+                | [{};]                                               # Match block start/end and statement separator
+                                                                      # NOTE: C++ parser includes processing of <> and : 
+                                                                      #       to handle template definitions, it is easier in C#
                 | ((?:\n|\r|\r\n)\s*(?:\n|\r|\r\n))                   # Match double empty line
             ''',
             re.DOTALL | re.MULTILINE | re.VERBOSE
@@ -137,6 +152,8 @@ class CppCodeParser(object):
                     return data.get_region_types().STRUCT
                 elif named_type == "namespace":
                     return data.get_region_types().NAMESPACE
+                elif named_type == "interface":
+                    return data.get_region_types().INTERFACE
                 elif named_type == "__global__":
                     return data.get_region_types().GLOBAL
                 else:
@@ -189,6 +206,7 @@ class CppCodeParser(object):
 
             # Template argument closing bracket
             elif text[m.start()] == '>':
+                assert(False) # TODO should not happen
                 # Reset next block name and start (in order to skip class names in templates), if has not been confirmed before
                 if next_block['confirmed'] == False and (next_block['type'] == 'class' or next_block['type'] == 'struct'):
                     next_block['name'] = ""
@@ -196,6 +214,7 @@ class CppCodeParser(object):
                     
             # Template argument opening bracket or after class inheritance specification
             elif text[m.start()] == ':' or text[m.start()] == '<':
+                assert(False) # TODO should not happen
                 # .. if goes after calss definition
                 if next_block['type'] == 'class' or next_block['type'] == 'struct':
                     next_block['confirmed'] = True
@@ -250,13 +269,13 @@ class CppCodeParser(object):
                     count_mismatched_brackets += 1
                     indent_current = 0
 
-            # Potential namespace, struct, class
-            elif text[m.start():m.end()].startswith(('class','struct','namespace')) == True \
-                and m.group('fn_name') == None: # function name can start with keyword, for example class_id_type()
+            # Potential namespace, struct, class, interface
+            elif m.group('block_type') != None:
                 if next_block['name'] == "":
                     # - 'name'
                     next_block['name'] = m.group('block_name').strip()
                     if next_block['name'] == "":
+                        assert(False) # impossible in C#
                         next_block['name'] = '__noname__'
                     # - 'cursor'
                     cursor_current += len(self.regex_ln.findall(text, cursor_last_pos, m.start('block_name')))
@@ -267,7 +286,7 @@ class CppCodeParser(object):
                     # - 'start' detected earlier
 
             # Potential function name detected...
-            else:
+            elif m.group('fn_name') != None:
                 # ... if outside of a function (do not detect enclosed functions, unless classes are matched)
                 if blocks[curblk]['type'] != 'function' and (next_block['name'] == "" or next_block['type'] != 'function'):
                     # - 'name'
@@ -281,6 +300,8 @@ class CppCodeParser(object):
                     # - 'type'
                     next_block['type'] = 'function'
                     # - 'start' detected earlier
+            else:
+                assert(len("Unknown match by regular expression") == 0)
 
         while indent_current > 0:
             # log all

+ 2 - 1
mainline/tests/common.py

@@ -82,6 +82,7 @@ class ToolRunner(object):
         self.save_prev = save_prev
         
     def run(self):
+        logging.debug(self.get_description())
         child = subprocess.Popen(self.call_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                                  cwd=os.path.join(self.suite_location, self.cwd))
         (child_stdout, child_stderr) =  child.communicate()
@@ -187,7 +188,7 @@ class ToolRunner(object):
         return self.cmd    
 
     def get_description(self):
-        return self.get_message() + "\nProcess: " + self.get_cmd()  + "\nCWD: " + self.cwd       
+        return self.get_message() + "\nProcess: " + self.get_cmd()  + "\nCWD: " + os.path.join(self.suite_location, self.cwd)       
 
     def get_dbfile(self):
         return self.dbfile

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_collect_default_stderr.gold.txt

@@ -2,4 +2,4 @@
 [LOG]: INFO:	Excluding: ./.unused.cpp
 [LOG]: INFO:	Skipping: ./dummy.txt
 [LOG]: INFO:	Processing: ./simple.cpp
-[LOG]: WARNING:	Exit code: 0. Time spent: 0.1 seconds. Done
+[LOG]: WARNING:	Exit code: 0. Time spent: 0.11 seconds. Done

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_limit_default_stderr.gold.txt

@@ -1,4 +1,4 @@
 [LOG]: WARNING:	Logging enabled with INFO level
 [LOG]: INFO:	Processing: 
 [LOG]: INFO:	Applying limit: namespace 'std.code.complexity', filter '('cyclomatic', '>', 0.0)'
-[LOG]: WARNING:	Exit code: 4. Time spent: 0.0 seconds. Done
+[LOG]: WARNING:	Exit code: 4. Time spent: 0.01 seconds. Done

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_limit_second_warn_touched_stderr.gold.txt

@@ -2,4 +2,4 @@
 [LOG]: INFO:	Identifying changed files...
 [LOG]: INFO:	Processing: 
 [LOG]: INFO:	Applying limit: namespace 'std.code.complexity', filter '('cyclomatic', '>', 0.0)'
-[LOG]: WARNING:	Exit code: 4. Time spent: 0.02 seconds. Done
+[LOG]: WARNING:	Exit code: 4. Time spent: 0.01 seconds. Done

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
mainline/tests/general/test_std_code_cpp/sources/test.c


+ 2 - 2
mainline/tests/general/test_std_code_cpp/test_parser_export_files_stdout.gold.txt

@@ -727,10 +727,10 @@ data:
 .   .   .   .   info: 
 .   .   .   .   .   cursor="0"
 .   .   .   .   .   name="__global__"
-.   .   .   .   .   offset_end="8250"
+.   .   .   .   .   offset_end="8296"
 .   .   .   .   .   line_begin="1"
 .   .   .   .   .   type="global"
-.   .   .   .   .   line_end="351"
+.   .   .   .   .   line_end="359"
 .   .   .   .   .   offset_begin="0"
 .   .   .   .   data: 
 .   .   

+ 9 - 1
mainline/tests/general/test_std_code_cs.py

@@ -19,6 +19,7 @@
 
 
 import unittest
+import os
 
 import tests.common
 
@@ -32,9 +33,16 @@ class Test(tests.common.TestCase):
         runner = tests.common.ToolRunner('export', ['--general.nest-regions'])
         self.assertExec(runner.run())
 
+        dirs_list = [os.path.join('.', each) for each in os.listdir(self.get_content_paths().cwd)]
+        runner = tests.common.ToolRunner('export',
+                                         opts_list=['--general.nest-regions', '--general.format=txt'],
+                                         dirs_list=dirs_list,
+                                         prefix='files')
+        self.assertExec(runner.run())
+
         runner = tests.common.ToolRunner('limit',
                                          ['--general.max-limit=std.code.complexity:cyclomatic:0'],
-                                         exit_code=11)
+                                         exit_code=0)
         self.assertExec(runner.run())
 
 if __name__ == '__main__':

+ 24 - 0
mainline/tests/general/test_std_code_cs/readme.txt

@@ -0,0 +1,24 @@
+#
+#    Metrix++, Copyright 2009-2013, Metrix++ Project
+#    Link: http://metrixplusplus.sourceforge.net
+#    
+#    This file is a part of Metrix++ Tool.
+#    
+#    Metrix++ is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, version 3 of the License.
+#    
+#    Metrix++ is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#    GNU General Public License for more details.
+#    
+#    You should have received a copy of the GNU General Public License
+#    along with Metrix++.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+===============================================================================
+
+NOTE: Some code samples are copied from other open source projects
+
+===============================================================================

+ 441 - 0
mainline/tests/general/test_std_code_cs/sources/File.cs

@@ -0,0 +1,441 @@
+/*
+ * File.cs - Implementation of the "Microsoft.VisualBasic.File" class.
+ *
+ * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+namespace Microsoft.VisualBasic
+{
+
+using System;
+using System.IO;
+using System.Reflection;
+using System.Text;
+using Microsoft.VisualBasic.CompilerServices;
+
+internal sealed class File // surprise
+: public other_template<param>
+{
+	// Internal state.
+	private FileTable table;
+	private int number;
+	private OpenMode mode;
+	internal int recordLength;
+	internal FileStream stream;
+	internal int lineLength;
+	internal int linePosn;
+	private BinaryWriter writer;
+	private BinaryReader reader;
+	private long nextRecord;
+	private Encoding encoding;
+	private bool sawEOF;
+	private static FileTable fileTables;
+
+	// Maximum number of files that can be used by any given assembly.
+	private const int MaxFiles = 255;
+
+	// Constructor.
+	public File /*surprise*/ (FileTable table, int number, OpenMode mode)
+			{
+				this.table = table;
+				this.number = number;
+				this.mode = mode;
+				this.nextRecord = -1;
+			}
+
+	// Get the file open mode.
+	public OpenMode Mode
+			{
+				get /*surprise */
+				//ss
+				//
+				{
+					return mode;
+				}
+			}
+
+	// Determine if we are at the end of the file.
+	public bool EOF
+			{
+				get
+				{
+					if(mode == OpenMode.Random)
+					{
+						return (stream.Position == stream.Length);
+					}
+					else if(mode == OpenMode.Output ||
+							mode == OpenMode.Append)
+					{
+						return true;
+					}
+					else
+					{
+						return sawEOF;
+					}
+				}
+			}
+
+	// Get the current file location.
+	public long Location
+			{
+				get
+				{
+					if(mode == OpenMode.Binary)
+					{
+						// Binary files return the actual byte position.
+						return stream.Position;
+					}
+					else if(mode == OpenMode.Random)
+					{
+						// Random files return the record position.
+						return (stream.Position + recordLength - 1)
+									/ recordLength;
+					}
+					else
+					{
+						// Sequential files return the position rounded
+						// to the next 128 byte boundary.
+						return (stream.Position + 127) / 128;
+					}
+				}
+			}
+
+	// Get a binary writer, wrapped around the underlying stream.
+	public BinaryWriter Writer
+			{
+				get
+				{
+					if(writer != null)
+					{
+						return writer;
+					}
+					writer = new BinaryWriter(stream);
+					return writer;
+				}
+			}
+
+	// Get a binary reader, wrapped around the underlying stream.
+	public BinaryReader Reader
+			{
+				get
+				{
+					if(reader != null)
+					{
+						return reader;
+					}
+					reader = new BinaryReader(stream);
+					return reader;
+				}
+			}
+
+	// Get the encoding that is in use by this file.
+	public Encoding Encoding
+			{
+				get
+				{
+					if(encoding != null)
+					{
+						return encoding;
+					}
+					encoding = Encoding.Default;
+					return encoding;
+				}
+			}
+
+	// Close this file and free it from its file table.
+	public void Close()
+			{
+				// Close the underlying stream and its attached object's.
+				if(stream != null)
+				{
+					stream.Close();
+					stream = null;
+				}
+				if(writer != null)
+				{
+					((IDisposable)writer).Dispose();
+					writer = null;
+				}
+				if(reader != null)
+				{
+					((IDisposable)reader).Dispose();
+					reader = null;
+				}
+
+				// Remove the file from its file table.
+				lock(typeof(File))
+				{
+					if(table.table[number - 1] == this)
+					{
+						table.table[number - 1] = null;
+					}
+				}
+			}
+
+	// Set the record number for this file.
+	public void SetRecord(long recordNumber)
+			{
+				if(recordNumber == -1)
+				{
+					if(mode == OpenMode.Random && nextRecord != -1)
+					{
+						recordNumber = nextRecord;
+					}
+					else
+					{
+						return;
+					}
+				}
+				if(recordNumber < 1)
+				{
+					// Bad record number.
+					Utils.ThrowException(63);
+				}
+				if(mode == OpenMode.Binary)
+				{
+					stream.Position = recordNumber - 1;
+					return;
+				}
+				try
+				{
+					checked
+					{
+						stream.Position = (recordNumber - 1) * recordLength;
+						nextRecord = recordNumber + 1;
+					}
+				}
+				catch(OverflowException)
+				{
+					// Seek position is out of range.
+					Utils.ThrowException(63);
+				}
+			}
+
+	// File table for an assembly.
+	internal sealed class FileTable
+	{
+		public Assembly assembly;
+		public File[] table;
+		public FileTable next;
+
+		public FileTable(Assembly assembly, FileTable next)
+				{
+					this.assembly = assembly;
+					this.table = new File [MaxFiles];
+					this.next = next;
+				}
+
+	}; // class FileTable
+
+	// Get a particular file for the specified assembly.
+	public static File GetFile(int number, Assembly assembly)
+			{
+				if(number < 1 || number > MaxFiles)
+				{
+					Utils.ThrowException(52);	// IOException
+				}
+				lock(typeof(File))
+				{
+					// Find the assembly's file table.
+					FileTable table = fileTables;
+					while(table != null)
+					{
+						if(table.assembly == assembly)
+						{
+							File file = table.table[number - 1];
+							if(file != null)
+							{
+								return file;
+							}
+							else
+							{
+								Utils.ThrowException(52);	// IOException
+							}
+						}
+						table = table.next;
+					}
+				}
+				Utils.ThrowException(52);	// IOException
+				return null;
+			}
+
+	// Get a file and check that it has one of the specified modes.
+	public static File GetFile(int number, Assembly assembly, OpenMode modes)
+			{
+				File file = GetFile(number, assembly);
+				if((file.Mode & modes) == 0)
+				{
+					Utils.ThrowException(54);	// IOException - invalid mode.
+				}
+				return file;
+			}
+
+	// Allocate a new file entry.
+	public static File AllocateFile
+				(int number, OpenMode mode, Assembly assembly)
+			{
+				if(number < 1 || number > MaxFiles)
+				{
+					Utils.ThrowException(52);	// IOException
+				}
+				lock(typeof(File))
+				{
+					// Find the assembly's file table.
+					FileTable table = fileTables;
+					File file;
+					while(table != null)
+					{
+						if(table.assembly == assembly)
+						{
+							file = table.table[number - 1];
+							if(file != null)
+							{
+								Utils.ThrowException(52);	// IOException
+							}
+							else
+							{
+								file = new File(table, number, mode);
+								table.table[number - 1] = file;
+								return file;
+							}
+						}
+						table = table.next;
+					}
+					table = new FileTable(assembly, fileTables);
+					fileTables = table;
+					file = new File(table, number, mode);
+					table.table[number - 1] = file;
+					return file;
+				}
+			}
+
+	// Find a free file number.
+	public static int FindFreeFile(Assembly assembly)
+			{
+				lock(typeof(File))
+				{
+					// Find the assembly's file table.
+					FileTable table = fileTables;
+					while(table != null)
+					{
+						if(table.assembly == assembly)
+						{
+							int number = 0;
+							while(number < MaxFiles &&
+								  table.table[number] != null)
+							{
+								++number;
+							}
+							if(number < MaxFiles)
+							{
+								return number + 1;
+							}
+							else
+							{
+								Utils.ThrowException(67);	// IOException
+							}
+						}
+						table = table.next;
+					}
+
+					// No file table yet, so assume that file number 1 is free.
+					return 1;
+				}
+			}
+
+	// Close all files in a particular assembly's file table.
+	public static void CloseAll(Assembly assembly)
+			{
+				lock(typeof(File))
+				{
+					// Find the assembly's file table.
+					FileTable table = fileTables;
+					while(table != null)
+					{
+						if(table.assembly == assembly)
+						{
+							int number = 0;
+							File file;
+							while(number < MaxFiles)
+							{
+								// Close all open files in this table.
+								file = table.table[number];
+								if(file != null)
+								{
+									file.Close();
+								}
+								++number;
+							}
+						}
+						table = table.next;
+					}
+				}
+			}
+
+	// Write a string to this file.
+	[TODO]
+	public void Write(String str)
+			{
+				// TODO
+			}
+
+	// Write an end of line sequence to this file.
+	[TODO]
+	public void WriteLine()
+			{
+				// TODO
+			}
+
+	// Perform a TAB operation.
+	[TODO]
+	public void Tab(TabInfo tab)
+			{
+				// TODO
+			}
+
+	// Output spaces to this file.
+	[TODO]
+	public void Space(SpcInfo spc)
+			{
+				// TODO
+			}
+
+	// Lock a region of this file.
+	[TODO]
+	public void Lock(long fromRecord, long toRecord)
+			{
+				// TODO
+			}
+
+	// Unlock a region of this file.
+	[TODO]
+	public void Unlock(long fromRecord, long toRecord)
+			{
+				// TODO
+			}
+
+}; // class File
+
+f2/*surprise*/
+//sss
+
+ ()/*surprise*/
+// ss
+{}
+
+
+}; // namespace Microsoft.VisualBasic

+ 105 - 0
mainline/tests/general/test_std_code_cs/sources/Generics.cs

@@ -0,0 +1,105 @@
+?// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
+// 
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this
+// software and associated documentation files (the "Software"), to deal in the Software
+// without restriction, including without limitation the rights to use, copy, modify, merge,
+// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+// to whom the Software is furnished to do so, subject to the following conditions:
+// 
+// The above copyright notice and this permission notice shall be included in all copies or
+// substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+
+public static class Generics
+{
+	public class MyArray<T>
+	{
+		public class NestedClass<Y>
+		{
+			public T Item1;
+			public Y Item2;
+		}
+		
+		public enum NestedEnum
+		{
+			A,
+			B
+		}
+		
+		private T[] arr;
+		
+		public MyArray(int capacity)
+		{
+			this.arr = new T[capacity];
+		}
+		
+		public void Size(int capacity)
+		{
+			Array.Resize<T>(ref this.arr, capacity);
+		}
+		
+		public void Grow(int capacity)
+		{
+			if (capacity >= this.arr.Length)
+			{
+				this.Size(capacity);
+			}
+		}
+	}
+	
+	public interface IInterface
+	{
+		void Method1<T>() where T : class;
+		void Method2<T>() where T : class;
+	}
+	
+	public abstract class Base : Generics.IInterface
+	{
+		// constraints must be repeated on implicit interface implementation
+		public abstract void Method1<T>() where T : class;
+		
+		// constraints must not be specified on explicit interface implementation
+		void Generics.IInterface.Method2<T>()
+		{
+		}
+	}
+	
+	public class Derived : Generics.Base
+	{
+		// constraints are inherited automatically and must not be specified
+		public override void Method1<T>()
+		{
+		}
+	}
+	
+	private const Generics.MyArray<string>.NestedEnum enumVal = Generics.MyArray<string>.NestedEnum.A;
+	private static Type type1 = typeof(List<>);
+	private static Type type2 = typeof(Generics.MyArray<>);
+	private static Type type3 = typeof(List<>.Enumerator);
+	private static Type type4 = typeof(Generics.MyArray<>.NestedClass<>);
+	private static Type type5 = typeof(List<int>[]);
+	private static Type type6 = typeof(Generics.MyArray<>.NestedEnum);
+	
+	public static void MethodWithConstraint<T, S>() where T : class, S where S : ICloneable, new()
+	{
+	}
+	
+	public static void MethodWithStructConstraint<T>() where T : struct
+	{
+	}
+	
+	public static Dictionary<string, string>.KeyCollection.Enumerator GetEnumerator(Dictionary<string, string> d, Generics.MyArray<string>.NestedClass<int> nc)
+	{
+		// Tests references to inner classes in generic classes
+		return d.Keys.GetEnumerator();
+	}
+}

+ 217 - 0
mainline/tests/general/test_std_code_cs/sources/interface.cs

@@ -0,0 +1,217 @@
+/*
+ * IDeserializationCallback.cs - Implementation of the
+ *          "System.Runtime.Serialization.IDeserializationCallback" interface.
+ *
+ * Copyright (C) 2002  Southern Storm Software, Pty Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+namespace System.Runtime.Serialization
+{
+
+#if CONFIG_SERIALIZATION
+public
+#else
+internal
+#endif
+interface IDeserializationCallback
+{
+
+    void OnDeserialization(Object sender);
+
+}; // interface IDeserializationCallback
+
+}; // namespace System.Runtime.Serialization
+
+
+
+/*
+ * TextInfo.cs - Implementation of the "System.TextInfo" class.
+ *
+ * Copyright (C) 2001, 2002  Southern Storm Software, Pty Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+namespace System.Globalization
+{
+
+using System;
+using System.Runtime.Serialization;
+using System.Runtime.CompilerServices;
+using System.Text;
+
+public class TextInfo : IDeserializationCallback
+{
+
+    // Internal state.
+    private int culture;
+
+    // Programmers cannot create instances of this class according
+    // to the specification, even though it has virtual methods!
+    // In fact, we _can_ inherit it through "_I18NTextInfo", but
+    // that is private to this implementation and should not be
+    // used by application programmers.
+    internal TextInfo(int culture)
+            {
+                this.culture = culture;
+            }
+
+    // Get the ANSI code page for this object.
+    public virtual int ANSICodePage
+            {
+                get
+                {
+                    // Return the invariant code page by default.
+                    return 1252;
+                }
+            }
+
+    // Get the EBCDIC code page for this object.
+    public virtual int EBCDICCodePage
+            {
+                get
+                {
+                    // Return the invariant code page by default.
+                    return 37;
+                }
+            }
+
+    // Get the Mac code page for this object.
+    public virtual int MacCodePage
+            {
+                get
+                {
+                    // Return the invariant code page by default.
+                    return 10000;
+                }
+            }
+
+    // Get the OEM code page for this object.
+    public virtual int OEMCodePage
+            {
+                get
+                {
+                    // Return the invariant code page by default.
+                    return 437;
+                }
+            }
+
+    // Get the list separator string.
+    public virtual String ListSeparator
+            {
+                get
+                {
+                    return ",";
+                }
+            }
+
+    // Determine if two TextInfo objects are equal or not.
+    public override bool Equals(Object obj)
+            {
+                TextInfo other = (obj as TextInfo);
+                if(other != null)
+                {
+                    return (culture == other.culture);
+                }
+                else
+                {
+                    return false;
+                }
+            }
+
+    // Get the hash code for this object.
+    public override int GetHashCode()
+            {
+                return culture;
+            }
+
+    // Convert characters or strings to lower case.
+    [MethodImpl(MethodImplOptions.InternalCall)]
+    extern public virtual char ToLower(char c);
+
+    [MethodImpl(MethodImplOptions.InternalCall)]
+    extern public virtual String ToLower(String str);
+
+    // Convert characters or strings to upper case.
+    [MethodImpl(MethodImplOptions.InternalCall)]
+    extern public virtual char ToUpper(char c);
+
+    [MethodImpl(MethodImplOptions.InternalCall)]
+    extern public virtual String ToUpper(String str);
+
+    // Convert a string to title case.
+    public String ToTitleCase(String str)
+            {
+                if(str == null)
+                {
+                    throw new ArgumentNullException("str");
+                }
+                StringBuilder builder = new StringBuilder(str.Length);
+                bool wordStart = true;
+                foreach(char ch in str)
+                {
+                    if(Char.IsSeparator(ch))
+                    {
+                        wordStart = true;
+                        builder.Append(ch);
+                    }
+                    else if(wordStart)
+                    {
+                        wordStart = false;
+                        builder.Append(ToUpper(ch));
+                    }
+                    else
+                    {
+                        builder.Append(ToLower(ch));
+                    }
+                }
+                return builder.ToString();
+            }
+
+    // Implement IDeserializationCallback.
+    void global::I.Deserialization.Callback.OnDeserialization(Object sender)
+            {
+                // Nothing to do here.
+            }
+
+    // Convert this object into a string.
+    public override String ToString()
+            {
+                return "TextInfo - " + culture.ToString();
+            }
+
+    // Implement IDeserializationCallback.
+    void IDeserializationCallback.OnDeserialization(Object sender)
+            {
+                // Nothing to do here.
+            }
+
+}; // class TextInfo
+
+}; // namespace System.Globalization

+ 1 - 1
mainline/tests/general/test_std_code_cs/test_parser_export_default_stdout.gold.txt

@@ -10,7 +10,7 @@
         </subdirs>
         <aggregated-data>
             <std.code.complexity>
-                <cyclomatic max="2" total="15.0" avg="0.180722891566" min="0" />
+                <cyclomatic max="None" total="0.0" avg="None" min="None" />
             </std.code.complexity>
         </aggregated-data>
     </data>

+ 501 - 0
mainline/tests/general/test_std_code_cs/test_parser_export_files_stdout.gold.txt

@@ -0,0 +1,501 @@
+================================================================================
+Export
+________________________________________________________________________________
+
+--------------------------------------------------------------------------------
+data:  
+.   info: 
+.   .   path=".\File.cs"
+.   .   id="1"
+.   file-data:  
+.   .   regions:
+.   .   
+.   .   .   region:  
+.   .   .   .   info: 
+.   .   .   .   .   cursor="0"
+.   .   .   .   .   name="__global__"
+.   .   .   .   .   offset_end="9063"
+.   .   .   .   .   line_begin="1"
+.   .   .   .   .   type="global"
+.   .   .   .   .   line_end="442"
+.   .   .   .   .   offset_begin="0"
+.   .   .   .   data: 
+.   .   .   .   subregions:
+.   .   .   .   
+.   .   .   .   .   subregion:  
+.   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   cursor="21"
+.   .   .   .   .   .   .   name="Microsoft.VisualBasic"
+.   .   .   .   .   .   .   offset_end="9026"
+.   .   .   .   .   .   .   line_begin="21"
+.   .   .   .   .   .   .   type="namespace"
+.   .   .   .   .   .   .   line_end="441"
+.   .   .   .   .   .   .   offset_begin="855"
+.   .   .   .   .   .   data: 
+.   .   .   .   .   .   subregions:
+.   .   .   .   .   .   
+.   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   cursor="31"
+.   .   .   .   .   .   .   .   .   name="other_template"
+.   .   .   .   .   .   .   .   .   offset_end="8959"
+.   .   .   .   .   .   .   .   .   line_begin="30"
+.   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   line_end="431"
+.   .   .   .   .   .   .   .   .   offset_begin="1012"
+.   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="229"
+.   .   .   .   .   .   .   .   .   .   .   name="FileTable"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="5103"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="228"
+.   .   .   .   .   .   .   .   .   .   .   type="class"
+.   .   .   .   .   .   .   .   .   .   .   line_end="242"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="4797"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   .   .   cursor="235"
+.   .   .   .   .   .   .   .   .   .   .   .   .   name="FileTable"
+.   .   .   .   .   .   .   .   .   .   .   .   .   offset_end="5099"
+.   .   .   .   .   .   .   .   .   .   .   .   .   line_begin="235"
+.   .   .   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   .   .   line_end="240"
+.   .   .   .   .   .   .   .   .   .   .   .   .   offset_begin="4943"
+.   .   .   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   .   .   subregions:
+.   subfiles:
+.   subdirs:
+.   aggregated-data:  
+.   .   std.code.complexity:  
+.   .   .   cyclomatic: 
+.   .   .   .   max="None"
+.   .   .   .   total="0.0"
+.   .   .   .   avg="None"
+.   .   .   .   min="None"
+================================================================================
+--------------------------------------------------------------------------------
+data:  
+.   info: 
+.   .   path=".\Generics.cs"
+.   .   id="2"
+.   file-data:  
+.   .   regions:
+.   .   
+.   .   .   region:  
+.   .   .   .   info: 
+.   .   .   .   .   cursor="0"
+.   .   .   .   .   name="__global__"
+.   .   .   .   .   offset_end="3134"
+.   .   .   .   .   line_begin="1"
+.   .   .   .   .   type="global"
+.   .   .   .   .   line_end="106"
+.   .   .   .   .   offset_begin="0"
+.   .   .   .   data: 
+.   .   .   .   subregions:
+.   .   .   .   
+.   .   .   .   .   subregion:  
+.   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   cursor="22"
+.   .   .   .   .   .   .   name="Generics"
+.   .   .   .   .   .   .   offset_end="3133"
+.   .   .   .   .   .   .   line_begin="22"
+.   .   .   .   .   .   .   type="class"
+.   .   .   .   .   .   .   line_end="105"
+.   .   .   .   .   .   .   offset_begin="1182"
+.   .   .   .   .   .   data: 
+.   .   .   .   .   .   subregions:
+.   .   .   .   .   .   
+.   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   cursor="24"
+.   .   .   .   .   .   .   .   .   name="MyArray"
+.   .   .   .   .   .   .   .   .   offset_end="1664"
+.   .   .   .   .   .   .   .   .   line_begin="24"
+.   .   .   .   .   .   .   .   .   type="class"
+.   .   .   .   .   .   .   .   .   line_end="57"
+.   .   .   .   .   .   .   .   .   offset_begin="1214"
+.   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="26"
+.   .   .   .   .   .   .   .   .   .   .   name="NestedClass"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="1316"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="26"
+.   .   .   .   .   .   .   .   .   .   .   type="class"
+.   .   .   .   .   .   .   .   .   .   .   line_end="30"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="1243"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="40"
+.   .   .   .   .   .   .   .   .   .   .   name="MyArray"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="1458"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="40"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="43"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="1391"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="45"
+.   .   .   .   .   .   .   .   .   .   .   name="Size"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="1546"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="45"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="48"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="1464"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="50"
+.   .   .   .   .   .   .   .   .   .   .   name="Grow"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="1661"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="50"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="56"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="1552"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   
+.   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   cursor="59"
+.   .   .   .   .   .   .   .   .   name="IInterface"
+.   .   .   .   .   .   .   .   .   offset_end="1775"
+.   .   .   .   .   .   .   .   .   line_begin="59"
+.   .   .   .   .   .   .   .   .   type="interface"
+.   .   .   .   .   .   .   .   .   line_end="63"
+.   .   .   .   .   .   .   .   .   offset_begin="1668"
+.   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   
+.   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   cursor="65"
+.   .   .   .   .   .   .   .   .   name="Base"
+.   .   .   .   .   .   .   .   .   offset_end="2084"
+.   .   .   .   .   .   .   .   .   line_begin="65"
+.   .   .   .   .   .   .   .   .   type="class"
+.   .   .   .   .   .   .   .   .   line_end="74"
+.   .   .   .   .   .   .   .   .   offset_begin="1779"
+.   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="71"
+.   .   .   .   .   .   .   .   .   .   .   name="Generics.IInterface.Method2"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="2081"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="70"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="73"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="1960"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   
+.   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   cursor="76"
+.   .   .   .   .   .   .   .   .   name="Derived"
+.   .   .   .   .   .   .   .   .   offset_end="2245"
+.   .   .   .   .   .   .   .   .   line_begin="76"
+.   .   .   .   .   .   .   .   .   type="class"
+.   .   .   .   .   .   .   .   .   line_end="82"
+.   .   .   .   .   .   .   .   .   offset_begin="2088"
+.   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="79"
+.   .   .   .   .   .   .   .   .   .   .   name="Method1"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="2242"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="78"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="81"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="2130"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   
+.   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   cursor="92"
+.   .   .   .   .   .   .   .   .   name="MethodWithConstraint"
+.   .   .   .   .   .   .   .   .   offset_end="2798"
+.   .   .   .   .   .   .   .   .   line_begin="92"
+.   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   line_end="94"
+.   .   .   .   .   .   .   .   .   offset_begin="2698"
+.   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   
+.   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   cursor="96"
+.   .   .   .   .   .   .   .   .   name="MethodWithStructConstraint"
+.   .   .   .   .   .   .   .   .   offset_end="2875"
+.   .   .   .   .   .   .   .   .   line_begin="96"
+.   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   line_end="98"
+.   .   .   .   .   .   .   .   .   offset_begin="2802"
+.   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   
+.   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   cursor="100"
+.   .   .   .   .   .   .   .   .   name="Dictionary"
+.   .   .   .   .   .   .   .   .   offset_end="3131"
+.   .   .   .   .   .   .   .   .   line_begin="100"
+.   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   line_end="104"
+.   .   .   .   .   .   .   .   .   offset_begin="2879"
+.   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   subregions:
+.   subfiles:
+.   subdirs:
+.   aggregated-data:  
+.   .   std.code.complexity:  
+.   .   .   cyclomatic: 
+.   .   .   .   max="None"
+.   .   .   .   total="0.0"
+.   .   .   .   avg="None"
+.   .   .   .   min="None"
+================================================================================
+--------------------------------------------------------------------------------
+data:  
+.   info: 
+.   .   path=".\interface.cs"
+.   .   id="3"
+.   file-data:  
+.   .   regions:
+.   .   
+.   .   .   region:  
+.   .   .   .   info: 
+.   .   .   .   .   cursor="0"
+.   .   .   .   .   name="__global__"
+.   .   .   .   .   offset_end="6535"
+.   .   .   .   .   line_begin="1"
+.   .   .   .   .   type="global"
+.   .   .   .   .   line_end="218"
+.   .   .   .   .   offset_begin="0"
+.   .   .   .   data: 
+.   .   .   .   subregions:
+.   .   .   .   
+.   .   .   .   .   subregion:  
+.   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   cursor="22"
+.   .   .   .   .   .   .   name="System.Runtime.Serialization"
+.   .   .   .   .   .   .   offset_end="1139"
+.   .   .   .   .   .   .   line_begin="22"
+.   .   .   .   .   .   .   type="namespace"
+.   .   .   .   .   .   .   line_end="37"
+.   .   .   .   .   .   .   offset_begin="918"
+.   .   .   .   .   .   data: 
+.   .   .   .   .   .   subregions:
+.   .   .   .   .   .   
+.   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   cursor="30"
+.   .   .   .   .   .   .   .   .   name="IDeserializationCallback"
+.   .   .   .   .   .   .   .   .   offset_end="1097"
+.   .   .   .   .   .   .   .   .   line_begin="25"
+.   .   .   .   .   .   .   .   .   type="interface"
+.   .   .   .   .   .   .   .   .   line_end="35"
+.   .   .   .   .   .   .   .   .   offset_begin="960"
+.   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   subregions:
+.   .   .   .   
+.   .   .   .   .   subregion:  
+.   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   cursor="61"
+.   .   .   .   .   .   .   name="System.Globalization"
+.   .   .   .   .   .   .   offset_end="6499"
+.   .   .   .   .   .   .   line_begin="61"
+.   .   .   .   .   .   .   type="namespace"
+.   .   .   .   .   .   .   line_end="217"
+.   .   .   .   .   .   .   offset_begin="2040"
+.   .   .   .   .   .   data: 
+.   .   .   .   .   .   subregions:
+.   .   .   .   .   .   
+.   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   cursor="69"
+.   .   .   .   .   .   .   .   .   name="TextInfo"
+.   .   .   .   .   .   .   .   .   offset_end="6477"
+.   .   .   .   .   .   .   .   .   line_begin="69"
+.   .   .   .   .   .   .   .   .   type="class"
+.   .   .   .   .   .   .   .   .   line_end="215"
+.   .   .   .   .   .   .   .   .   offset_begin="2183"
+.   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="80"
+.   .   .   .   .   .   .   .   .   .   .   name="TextInfo"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="2687"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="75"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="83"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="2288"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="88"
+.   .   .   .   .   .   .   .   .   .   .   name="get"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="2940"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="88"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="92"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="2802"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="98"
+.   .   .   .   .   .   .   .   .   .   .   name="get"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="3209"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="98"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="102"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="3073"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="108"
+.   .   .   .   .   .   .   .   .   .   .   name="get"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="3475"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="108"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="112"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="3336"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="118"
+.   .   .   .   .   .   .   .   .   .   .   name="get"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="3739"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="118"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="122"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="3602"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="128"
+.   .   .   .   .   .   .   .   .   .   .   name="get"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="3934"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="128"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="131"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="3863"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="135"
+.   .   .   .   .   .   .   .   .   .   .   name="Equals"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="4348"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="134"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="146"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="3954"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="149"
+.   .   .   .   .   .   .   .   .   .   .   name="GetHashCode"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="4489"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="148"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="152"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="4354"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="169"
+.   .   .   .   .   .   .   .   .   .   .   name="ToTitleCase"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="5940"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="168"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="195"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="5003"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="198"
+.   .   .   .   .   .   .   .   .   .   .   name="I.Deserialization.Callback.OnDeserialization"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="6128"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="197"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="201"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="5946"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="204"
+.   .   .   .   .   .   .   .   .   .   .   name="ToString"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="6296"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="203"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="207"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="6134"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   .   .   .   .   .   .   .   
+.   .   .   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   .   .   cursor="210"
+.   .   .   .   .   .   .   .   .   .   .   name="IDeserializationCallback.OnDeserialization"
+.   .   .   .   .   .   .   .   .   .   .   offset_end="6474"
+.   .   .   .   .   .   .   .   .   .   .   line_begin="209"
+.   .   .   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   .   .   line_end="213"
+.   .   .   .   .   .   .   .   .   .   .   offset_begin="6302"
+.   .   .   .   .   .   .   .   .   .   data: 
+.   .   .   .   .   .   .   .   .   .   subregions:
+.   subfiles:
+.   subdirs:
+.   aggregated-data:  
+.   .   std.code.complexity:  
+.   .   .   cyclomatic: 
+.   .   .   .   max="None"
+.   .   .   .   total="0.0"
+.   .   .   .   avg="None"
+.   .   .   .   min="None"
+================================================================================
+
+

+ 0 - 88
mainline/tests/general/test_std_code_cs/test_parser_limit_default_stdout.gold.txt

@@ -1,88 +0,0 @@
-./operator_test.hpp:6: warning: Metric 'std.code.complexity/cyclomatic' for region 'policy_mcr' exceeds the limit.
-	Metric name    : std.code.complexity/cyclomatic
-	Region name    : policy_mcr
-	Metric value   : 2
-	Modified       : None
-	Change trend   : None
-	Limit          : 0.0
-
-./operator_test.hpp:71: warning: Metric 'std.code.complexity/cyclomatic' for region 'operator &&' exceeds the limit.
-	Metric name    : std.code.complexity/cyclomatic
-	Region name    : operator &&
-	Metric value   : 1
-	Modified       : None
-	Change trend   : None
-	Limit          : 0.0
-
-./operator_test.hpp:72: warning: Metric 'std.code.complexity/cyclomatic' for region 'operator ||' exceeds the limit.
-	Metric name    : std.code.complexity/cyclomatic
-	Region name    : operator ||
-	Metric value   : 1
-	Modified       : None
-	Change trend   : None
-	Limit          : 0.0
-
-./test.c:147: warning: Metric 'std.code.complexity/cyclomatic' for region 'uppercase' exceeds the limit.
-	Metric name    : std.code.complexity/cyclomatic
-	Region name    : uppercase
-	Metric value   : 2
-	Modified       : None
-	Change trend   : None
-	Limit          : 0.0
-
-./test.c:216: warning: Metric 'std.code.complexity/cyclomatic' for region 'reset' exceeds the limit.
-	Metric name    : std.code.complexity/cyclomatic
-	Region name    : reset
-	Metric value   : 1
-	Modified       : None
-	Change trend   : None
-	Limit          : 0.0
-
-./test.c:296: warning: Metric 'std.code.complexity/cyclomatic' for region 'save' exceeds the limit.
-	Metric name    : std.code.complexity/cyclomatic
-	Region name    : save
-	Metric value   : 1
-	Modified       : None
-	Change trend   : None
-	Limit          : 0.0
-
-./test.c:332: warning: Metric 'std.code.complexity/cyclomatic' for region 'main' exceeds the limit.
-	Metric name    : std.code.complexity/cyclomatic
-	Region name    : main
-	Metric value   : 2
-	Modified       : None
-	Change trend   : None
-	Limit          : 0.0
-
-./test2.cpp:7: warning: Metric 'std.code.complexity/cyclomatic' for region 'A' exceeds the limit.
-	Metric name    : std.code.complexity/cyclomatic
-	Region name    : A
-	Metric value   : 1
-	Modified       : None
-	Change trend   : None
-	Limit          : 0.0
-
-./test3.cpp:39: warning: Metric 'std.code.complexity/cyclomatic' for region 'doColor' exceeds the limit.
-	Metric name    : std.code.complexity/cyclomatic
-	Region name    : doColor
-	Metric value   : 1
-	Modified       : None
-	Change trend   : None
-	Limit          : 0.0
-
-./test3.cpp:53: warning: Metric 'std.code.complexity/cyclomatic' for region 'doFont' exceeds the limit.
-	Metric name    : std.code.complexity/cyclomatic
-	Region name    : doFont
-	Metric value   : 1
-	Modified       : None
-	Change trend   : None
-	Limit          : 0.0
-
-./test3.cpp:72: warning: Metric 'std.code.complexity/cyclomatic' for region 'doFont222' exceeds the limit.
-	Metric name    : std.code.complexity/cyclomatic
-	Region name    : doFont222
-	Metric value   : 2
-	Modified       : None
-	Change trend   : None
-	Limit          : 0.0
-