Skip to content

Commit

Permalink
Merge pull request #1685 from KvanTTT/master
Browse files Browse the repository at this point in the history
Fix C# Pair.cs, Right arrow escaping in XML Comments
  • Loading branch information
parrt authored Feb 22, 2017
2 parents 780262a + f24b19f commit 1dc7031
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -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.
*/
Expand Down Expand Up @@ -257,8 +257,8 @@ public class ParserATNSimulator : ATNSimulator
* 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;
Expand Down Expand Up @@ -2047,7 +2047,7 @@ among the configurations are all non-epsilon transitions. That means
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 stateconfig-list map.
It's also the case that we might have two conflicting configurations but
also a 3rd nonconflicting configuration for a different alternative:
Expand Down
66 changes: 33 additions & 33 deletions runtime/CSharp/runtime/CSharp/Antlr4.Runtime/Misc/Pair.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 Pair(A a, B b)
{
this.a = a;
this.b = b;
}
public readonly A a;
public readonly 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;
}

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 int GetHashCode()
{
int hash = MurmurHash.Initialize();
hash = MurmurHash.Update(hash, a);
hash = MurmurHash.Update(hash, b);
return MurmurHash.Finish(hash, 2);
}
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("(%s, %s)", a, b);
public override String ToString()
{
return String.Format("({0}, {1})", a, b);
}
}
}

}
}

0 comments on commit 1dc7031

Please sign in to comment.