Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions runtime/JavaScript/src/antlr4/Parser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export declare class Parser extends Recognizer<Token> {
matchedEOF: boolean;
buildParseTrees: boolean;
printer?: Printer;
syntaxErrorsCount: number;

constructor(input: TokenStream);
match(ttype: number): Token;
Expand All @@ -40,4 +41,5 @@ export declare class Parser extends Recognizer<Token> {
setTokenStream(input: TokenStream): void;
notifyErrorListeners(msg: string, offendingToken: Token, err: RecognitionException | undefined): void;
getCurrentToken(): Token;

}
9 changes: 9 additions & 0 deletions runtime/JavaScript/src/antlr4/Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,15 @@ export default class Parser extends Recognizer {
this._input = input;
}

/**
* Gets the number of syntax errors reported during parsing. This value is
* incremented each time {@link //notifyErrorListeners} is called.
*/
get syntaxErrorsCount() {
return this._syntaxErrors;
}


/**
* Match needs to return the current input symbol, which gets put
* into the label for the associated token ref; e.g., x=ID.
Expand Down