forked from jasder/antlr
Fix issues in newly generated code
This commit is contained in:
parent
53f2c8f1a6
commit
a14b197714
|
@ -1379,7 +1379,7 @@ namespace Antlr4.Runtime.Atn
|
|||
[return: NotNull]
|
||||
protected internal virtual ATNConfigSet ApplyPrecedenceFilter(ATNConfigSet configs, ParserRuleContext globalContext, PredictionContextCache contextCache)
|
||||
{
|
||||
IDictionary<int, PredictionContext> statesFromAlt1 = new Dictionary<int, PredictionContext>();
|
||||
Dictionary<int, PredictionContext> statesFromAlt1 = new Dictionary<int, PredictionContext>();
|
||||
ATNConfigSet configSet = new ATNConfigSet();
|
||||
foreach (ATNConfig config in configs)
|
||||
{
|
||||
|
@ -1394,7 +1394,7 @@ namespace Antlr4.Runtime.Atn
|
|||
// the configuration was eliminated
|
||||
continue;
|
||||
}
|
||||
statesFromAlt1.Put(config.State.stateNumber, config.Context);
|
||||
statesFromAlt1[config.State.stateNumber] = config.Context;
|
||||
if (updatedContext != config.SemanticContext)
|
||||
{
|
||||
configSet.Add(config.Transform(config.State, updatedContext, false), contextCache);
|
||||
|
@ -1411,8 +1411,8 @@ namespace Antlr4.Runtime.Atn
|
|||
// already handled
|
||||
continue;
|
||||
}
|
||||
PredictionContext context = statesFromAlt1.Get(config_1.State.stateNumber);
|
||||
if (context != null && context.Equals(config_1.Context))
|
||||
PredictionContext context;
|
||||
if (statesFromAlt1.TryGetValue(config_1.State.stateNumber, out context) && context.Equals(config_1.Context))
|
||||
{
|
||||
// eliminated
|
||||
continue;
|
||||
|
|
|
@ -229,8 +229,7 @@ namespace Antlr4.Runtime
|
|||
/// your token objects because you don't have to go modify your lexer
|
||||
/// so that it creates a new Java type.
|
||||
/// </remarks>
|
||||
[Obsolete]
|
||||
[System.ObsoleteAttribute(@"This method is not called by the ANTLR 4 Runtime. Specific implementations of IAntlrErrorStrategy may provide a similar feature when necessary. For example, seeDefaultErrorStrategy.GetTokenErrorDisplay(IToken) .")]
|
||||
[ObsoleteAttribute(@"This method is not called by the ANTLR 4 Runtime. Specific implementations of IAntlrErrorStrategy may provide a similar feature when necessary. For example, see DefaultErrorStrategy.GetTokenErrorDisplay(IToken).")]
|
||||
public virtual string GetTokenErrorDisplay(IToken t)
|
||||
{
|
||||
if (t == null)
|
||||
|
|
Loading…
Reference in New Issue