Skip to content

Commit 220439a

Browse files
committed
Merge pull request #6 from wjkohnen/fix-misMatched
Go runtime: Change misMatched to mismatched.
2 parents 3406aca + 7652b9a commit 220439a

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

runtime/Go/src/antlr4/ErrorStrategy.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (this *DefaultErrorStrategy) Recover(recognizer Parser, e RecognitionExcept
185185
// <p><strong>ORIGINS</strong></p>
186186
//
187187
// <p>Previous versions of ANTLR did a poor job of their recovery within loops.
188-
// A single misMatch token or missing token would force the parser to bail
188+
// A single mismatch token or missing token would force the parser to bail
189189
// out of the entire rules surrounding the loop. So, for rule</p>
190190
//
191191
// <pre>
@@ -299,7 +299,7 @@ func (this *DefaultErrorStrategy) ReportNoViableAlternative(recognizer Parser, e
299299
// @param e the recognition exception
300300
//
301301
func (this *DefaultErrorStrategy) ReportInputMisMatch(recognizer Parser, e *InputMisMatchException) {
302-
var msg = "misMatched input " + this.GetTokenErrorDisplay(e.offendingToken) +
302+
var msg = "mismatched input " + this.GetTokenErrorDisplay(e.offendingToken) +
303303
" expecting " + e.getExpectedTokens().StringVerbose(recognizer.GetLiteralNames(), recognizer.GetSymbolicNames(), false)
304304
recognizer.NotifyErrorListeners(msg, e.offendingToken, e)
305305
}
@@ -326,7 +326,7 @@ func (this *DefaultErrorStrategy) ReportFailedPredicate(recognizer Parser, e *Fa
326326
// {@code recognizer} is in error recovery mode.
327327
//
328328
// <p>This method is called when {@link //singleTokenDeletion} identifies
329-
// single-token deletion as a viable recovery strategy for a misMatched
329+
// single-token deletion as a viable recovery strategy for a mismatched
330330
// input error.</p>
331331
//
332332
// <p>The default implementation simply returns if the handler is already in
@@ -355,7 +355,7 @@ func (this *DefaultErrorStrategy) ReportUnwantedToken(recognizer Parser) {
355355
// method returns, {@code recognizer} is in error recovery mode.
356356
//
357357
// <p>This method is called when {@link //singleTokenInsertion} identifies
358-
// single-token insertion as a viable recovery strategy for a misMatched
358+
// single-token insertion as a viable recovery strategy for a mismatched
359359
// input error.</p>
360360
//
361361
// <p>The default implementation simply returns if the handler is already in
@@ -377,7 +377,7 @@ func (this *DefaultErrorStrategy) ReportMissingToken(recognizer Parser) {
377377
recognizer.NotifyErrorListeners(msg, t, nil)
378378
}
379379

380-
// <p>The default implementation attempts to recover from the misMatched input
380+
// <p>The default implementation attempts to recover from the mismatched input
381381
// by using single token insertion and deletion as described below. If the
382382
// recovery attempt fails, this method panics an
383383
// {@link InputMisMatchException}.</p>
@@ -446,7 +446,7 @@ func (this *DefaultErrorStrategy) RecoverInline(recognizer Parser) Token {
446446
//
447447
// This method implements the single-token insertion inline error recovery
448448
// strategy. It is called by {@link //recoverInline} if the single-token
449-
// deletion strategy fails to recover from the misMatched input. If this
449+
// deletion strategy fails to recover from the mismatched input. If this
450450
// method returns {@code true}, {@code recognizer} will be in error recovery
451451
// mode.
452452
//
@@ -458,7 +458,7 @@ func (this *DefaultErrorStrategy) RecoverInline(recognizer Parser) Token {
458458
//
459459
// @param recognizer the parser instance
460460
// @return {@code true} if single-token insertion is a viable recovery
461-
// strategy for the current misMatched input, otherwise {@code false}
461+
// strategy for the current mismatched input, otherwise {@code false}
462462
//
463463
func (this *DefaultErrorStrategy) singleTokenInsertion(recognizer Parser) bool {
464464
var currentSymbolType = recognizer.GetTokenStream().LA(1)
@@ -479,7 +479,7 @@ func (this *DefaultErrorStrategy) singleTokenInsertion(recognizer Parser) bool {
479479

480480
// This method implements the single-token deletion inline error recovery
481481
// strategy. It is called by {@link //recoverInline} to attempt to recover
482-
// from misMatched input. If this method returns nil, the parser and error
482+
// from mismatched input. If this method returns nil, the parser and error
483483
// handler state will not have changed. If this method returns non-nil,
484484
// {@code recognizer} will <em>not</em> be in error recovery mode since the
485485
// returned token was a successful Match.
@@ -492,7 +492,7 @@ func (this *DefaultErrorStrategy) singleTokenInsertion(recognizer Parser) bool {
492492
//
493493
// @param recognizer the parser instance
494494
// @return the successfully Matched {@link Token} instance if single-token
495-
// deletion successfully recovers from the misMatched input, otherwise
495+
// deletion successfully recovers from the mismatched input, otherwise
496496
// {@code nil}
497497
//
498498
func (this *DefaultErrorStrategy) singleTokenDeletion(recognizer Parser) Token {
@@ -659,7 +659,7 @@ func (this *DefaultErrorStrategy) escapeWSAndQuote(s string) string {
659659
// In this case, for input "[]", LA(1) is ']' and in the set, so we would
660660
// not consume anything. After printing an error, rule c would
661661
// return normally. Rule b would not find the required '^' though.
662-
// At this point, it gets a misMatched token error and panics an
662+
// At this point, it gets a mismatched token error and panics an
663663
// exception (since LA(1) is not in the viable following token
664664
// set). The rule exception handler tries to recover, but finds
665665
// the same recovery set and doesn't consume anything. Rule b

runtime/Go/src/antlr4/Errors.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package antlr4
22

3-
import ()
4-
53
// The root of the ANTLR exception hierarchy. In general, ANTLR tracks just
64
// 3 kinds of errors: prediction errors, failed predicate errors, and
7-
// misMatched input errors. In each case, the parser knows where it is
5+
// mismatched input errors. In each case, the parser knows where it is
86
// in the input, where it is in the ATN, the rule invocation stack,
97
// and what kind of problem occurred.
108

@@ -173,7 +171,7 @@ type InputMisMatchException struct {
173171
*BaseRecognitionException
174172
}
175173

176-
// This signifies any kind of misMatched input exceptions such as
174+
// This signifies any kind of mismatched input exceptions such as
177175
// when the current input does not Match the expected token.
178176
//
179177
func NewInputMisMatchException(recognizer Parser) *InputMisMatchException {

runtime/Go/src/antlr4/Parser.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (p *BaseParser) SetErrorHandler(e ErrorStrategy) {
129129
// @return the Matched symbol
130130
// @panics RecognitionException if the current input symbol did not Match
131131
// {@code ttype} and the error strategy could not recover from the
132-
// misMatched symbol
132+
// mismatched symbol
133133

134134
func (p *BaseParser) Match(ttype int) Token {
135135

@@ -175,7 +175,7 @@ func (p *BaseParser) Match(ttype int) Token {
175175
//
176176
// @return the Matched symbol
177177
// @panics RecognitionException if the current input symbol did not Match
178-
// a wildcard and the error strategy could not recover from the misMatched
178+
// a wildcard and the error strategy could not recover from the mismatched
179179
// symbol
180180

181181
func (p *BaseParser) MatchWildcard() Token {

0 commit comments

Comments
 (0)