1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-03-21 21:47:43 +02:00
ferret/pkg/compiler/listener.go
Tim Voronov 742bdae0ae
Feature/#263 waitfor event (#590)
* Added new WAITFOR syntax

* Added support of event options

* Added support of options

* Added support of using WAITFOR EVENT in variable assignment
2021-07-13 21:34:22 -04:00

27 lines
722 B
Go

package compiler
import (
"github.com/antlr/antlr4/runtime/Go/antlr"
"github.com/pkg/errors"
)
type errorListener struct {
*antlr.DiagnosticErrorListener
}
func newErrorListener() *errorListener {
return &errorListener{
antlr.NewDiagnosticErrorListener(false),
}
}
func (d *errorListener) ReportAttemptingFullContext(_ antlr.Parser, _ *antlr.DFA, _, _ int, _ *antlr.BitSet, _ antlr.ATNConfigSet) {
}
func (d *errorListener) ReportContextSensitivity(_ antlr.Parser, _ *antlr.DFA, _, _, _ int, _ antlr.ATNConfigSet) {
}
func (d *errorListener) SyntaxError(_ antlr.Recognizer, _ interface{}, line, column int, msg string, _ antlr.RecognitionException) {
panic(errors.Errorf("%s at %d:%d", msg, line, column))
}