Mark Sharpen classes internal where possible

This commit is contained in:
Sam Harwell 2014-04-28 08:25:21 -05:00 committed by Sam Harwell
parent 484ae78936
commit 984261221c
11 changed files with 22 additions and 21 deletions

View File

@ -2,7 +2,7 @@
{ {
using System; using System;
public class CRC32 : Checksum internal class CRC32 : Checksum
{ {
private uint _crc; private uint _crc;

View File

@ -1,6 +1,6 @@
namespace Sharpen namespace Sharpen
{ {
public interface Checksum internal interface Checksum
{ {
long Value long Value
{ {

View File

@ -10,7 +10,6 @@
using Antlr4.Runtime.Misc; using Antlr4.Runtime.Misc;
using Antlr4.Runtime.Tree; using Antlr4.Runtime.Tree;
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using Arrays = Sharpen.Arrays;
using BitSet = Sharpen.BitSet; using BitSet = Sharpen.BitSet;
using Checksum = Sharpen.Checksum; using Checksum = Sharpen.Checksum;
using CRC32 = Sharpen.CRC32; using CRC32 = Sharpen.CRC32;
@ -252,8 +251,10 @@
sharedParsers[0].Atn.ClearDFA(); sharedParsers[0].Atn.ClearDFA();
} }
Arrays.Fill(sharedLexers, null); for (int j = 0; j < sharedLexers.Length; j++)
Arrays.Fill(sharedParsers, null); sharedLexers[j] = null;
for (int j = 0; j < sharedParsers.Length; j++)
sharedParsers[j] = null;
} }
parse2(factory, sources); parse2(factory, sources);
@ -1053,7 +1054,7 @@
} }
} }
protected class ChecksumParseTreeListener : IParseTreeListener internal class ChecksumParseTreeListener : IParseTreeListener
{ {
private const int VISIT_TERMINAL = 1; private const int VISIT_TERMINAL = 1;
private const int VISIT_ERROR_NODE = 2; private const int VISIT_ERROR_NODE = 2;

View File

@ -33,7 +33,7 @@ namespace Sharpen
using System.Collections.Generic; using System.Collections.Generic;
using StringBuilder = System.Text.StringBuilder; using StringBuilder = System.Text.StringBuilder;
public static class Arrays internal static class Arrays
{ {
public static T[] CopyOf<T>(T[] array, int newSize) public static T[] CopyOf<T>(T[] array, int newSize)
{ {

View File

@ -33,7 +33,7 @@ using System.Collections;
namespace Sharpen namespace Sharpen
{ {
public interface IStructuralComparable { internal interface IStructuralComparable {
int CompareTo (object other, IComparer comparer); int CompareTo (object other, IComparer comparer);
} }
} }

View File

@ -33,7 +33,7 @@ using System.Collections;
namespace Sharpen namespace Sharpen
{ {
public interface IStructuralEquatable { internal interface IStructuralEquatable {
bool Equals (object other, IEqualityComparer comparer); bool Equals (object other, IEqualityComparer comparer);
int GetHashCode (IEqualityComparer comparer); int GetHashCode (IEqualityComparer comparer);

View File

@ -32,7 +32,7 @@ using System;
namespace Sharpen namespace Sharpen
{ {
public static class Tuple internal static class Tuple
{ {
public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8>> Create<T1, T2, T3, T4, T5, T6, T7, T8> public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8>> Create<T1, T2, T3, T4, T5, T6, T7, T8>
( (

View File

@ -35,7 +35,7 @@ using System.Collections.Generic;
namespace Sharpen namespace Sharpen
{ {
public partial class Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> internal partial class Tuple<T1, T2, T3, T4, T5, T6, T7, TRest>
{ {
public Tuple (T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest) public Tuple (T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest)
{ {
@ -64,7 +64,7 @@ namespace Sharpen
/* The rest is generated by the script at the bottom */ /* The rest is generated by the script at the bottom */
[Serializable] [Serializable]
public class Tuple<T1> : IStructuralEquatable, IStructuralComparable, IComparable internal class Tuple<T1> : IStructuralEquatable, IStructuralComparable, IComparable
{ {
T1 item1; T1 item1;
@ -195,7 +195,7 @@ namespace Sharpen
} }
[Serializable] [Serializable]
public class Tuple<T1, T2, T3> : IStructuralEquatable, IStructuralComparable, IComparable internal class Tuple<T1, T2, T3> : IStructuralEquatable, IStructuralComparable, IComparable
{ {
T1 item1; T1 item1;
T2 item2; T2 item2;
@ -276,7 +276,7 @@ namespace Sharpen
} }
[Serializable] [Serializable]
public class Tuple<T1, T2, T3, T4> : IStructuralEquatable, IStructuralComparable, IComparable internal class Tuple<T1, T2, T3, T4> : IStructuralEquatable, IStructuralComparable, IComparable
{ {
T1 item1; T1 item1;
T2 item2; T2 item2;
@ -367,7 +367,7 @@ namespace Sharpen
} }
[Serializable] [Serializable]
public class Tuple<T1, T2, T3, T4, T5> : IStructuralEquatable, IStructuralComparable, IComparable internal class Tuple<T1, T2, T3, T4, T5> : IStructuralEquatable, IStructuralComparable, IComparable
{ {
T1 item1; T1 item1;
T2 item2; T2 item2;
@ -468,7 +468,7 @@ namespace Sharpen
} }
[Serializable] [Serializable]
public class Tuple<T1, T2, T3, T4, T5, T6> : IStructuralEquatable, IStructuralComparable, IComparable internal class Tuple<T1, T2, T3, T4, T5, T6> : IStructuralEquatable, IStructuralComparable, IComparable
{ {
T1 item1; T1 item1;
T2 item2; T2 item2;
@ -579,7 +579,7 @@ namespace Sharpen
} }
[Serializable] [Serializable]
public class Tuple<T1, T2, T3, T4, T5, T6, T7> : IStructuralEquatable, IStructuralComparable, IComparable internal class Tuple<T1, T2, T3, T4, T5, T6, T7> : IStructuralEquatable, IStructuralComparable, IComparable
{ {
T1 item1; T1 item1;
T2 item2; T2 item2;
@ -700,7 +700,7 @@ namespace Sharpen
} }
[Serializable] [Serializable]
public partial class Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> : IStructuralEquatable, IStructuralComparable, IComparable internal partial class Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> : IStructuralEquatable, IStructuralComparable, IComparable
{ {
T1 item1; T1 item1;
T2 item2; T2 item2;

View File

@ -31,7 +31,7 @@ namespace Sharpen
{ {
using System.Collections.Generic; using System.Collections.Generic;
public static class DictionaryExtensions internal static class DictionaryExtensions
{ {
public static TValue Get<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key) public static TValue Get<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key)
where TValue : class where TValue : class

View File

@ -31,7 +31,7 @@ namespace Sharpen
{ {
using System.Collections.Generic; using System.Collections.Generic;
public static class ListExtensions internal static class ListExtensions
{ {
public static T Set<T>(this IList<T> list, int index, T value) public static T Set<T>(this IList<T> list, int index, T value)
where T : class where T : class

View File

@ -3,7 +3,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
public class SequenceEqualityComparer<T> : EqualityComparer<IEnumerable<T>> internal class SequenceEqualityComparer<T> : EqualityComparer<IEnumerable<T>>
{ {
private static readonly SequenceEqualityComparer<T> _default = new SequenceEqualityComparer<T>(); private static readonly SequenceEqualityComparer<T> _default = new SequenceEqualityComparer<T>();