forked from jasder/antlr
Merge pull request #1685 from KvanTTT/master
Fix C# Pair.cs, Right arrow escaping in XML Comments
This commit is contained in:
commit
1dc70310a3
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2012-2016 The ANTLR Project. All rights reserved.
|
||||
/* Copyright (c) 2012-2016 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
@ -257,8 +257,8 @@ namespace Antlr4.Runtime.Atn
|
|||
* Don't keep around as it wastes huge amounts of memory. DoubleKeyMap
|
||||
* isn't synchronized but we're ok since two threads shouldn't reuse same
|
||||
* parser/atnsim object because it can only handle one input at a time.
|
||||
* This maps graphs a and b to merged result c. (a,b)→c. We can avoid
|
||||
* the merge if we ever see a and b again. Note that (b,a)→c should
|
||||
* This maps graphs a and b to merged result c. (a,b)→c. We can avoid
|
||||
* the merge if we ever see a and b again. Note that (b,a)→c should
|
||||
* also be examined during cache lookup.
|
||||
*/
|
||||
protected MergeCache mergeCache;
|
||||
|
@ -2047,7 +2047,7 @@ namespace Antlr4.Runtime.Atn
|
|||
we don't consider any conflicts that include alternative 2. So, we
|
||||
ignore the conflict between alts 1 and 2. We ignore a set of
|
||||
conflicting alts when there is an intersection with an alternative
|
||||
associated with a single alt state in the state→config-list map.
|
||||
associated with a single alt state in the state→config-list map.
|
||||
|
||||
It's also the case that we might have two conflicting configurations but
|
||||
also a 3rd nonconflicting configuration for a different alternative:
|
||||
|
|
|
@ -2,48 +2,48 @@
|
|||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace Antlr4.Runtime.Misc
|
||||
{
|
||||
|
||||
public class Pair<A, B>
|
||||
{
|
||||
public readonly A a;
|
||||
public readonly B b;
|
||||
public readonly A a;
|
||||
public readonly B b;
|
||||
|
||||
public Pair(A a, B b)
|
||||
{
|
||||
this.a = a;
|
||||
this.b = b;
|
||||
}
|
||||
|
||||
public override bool Equals(Object obj)
|
||||
{
|
||||
if (obj == this)
|
||||
public Pair(A a, B b)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (!(obj is Pair<A, B>)) {
|
||||
return false;
|
||||
this.a = a;
|
||||
this.b = b;
|
||||
}
|
||||
|
||||
Pair <A, B> other = (Pair <A, B>)obj;
|
||||
return a==null ? other.a==null : a.Equals(other.b);
|
||||
}
|
||||
public override bool Equals(Object obj)
|
||||
{
|
||||
if (obj == this)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (!(obj is Pair<A, B>))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
int hash = MurmurHash.Initialize();
|
||||
hash = MurmurHash.Update(hash, a);
|
||||
hash = MurmurHash.Update(hash, b);
|
||||
return MurmurHash.Finish(hash, 2);
|
||||
}
|
||||
Pair<A, B> other = (Pair<A, B>)obj;
|
||||
return (a == null ? other.a == null : a.Equals(other.a)) &&
|
||||
(b == null ? other.b == null : b.Equals(other.b));
|
||||
}
|
||||
|
||||
public override String ToString()
|
||||
{
|
||||
return String.Format("(%s, %s)", a, b);
|
||||
}
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
int hash = MurmurHash.Initialize();
|
||||
hash = MurmurHash.Update(hash, a);
|
||||
hash = MurmurHash.Update(hash, b);
|
||||
return MurmurHash.Finish(hash, 2);
|
||||
}
|
||||
|
||||
}
|
||||
public override String ToString()
|
||||
{
|
||||
return String.Format("({0}, {1})", a, b);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue