Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvergnaud committed Mar 15, 2024
1 parent e81e6b1 commit 4e8a6bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void matchesExpectation(Path expectations) throws Exception {
lexer.setTokenFactory(CommonTokenWithStatesFactory.DEFAULT);
TokenStream stream = new CommonTokenStream(lexer);
JavaParser parser = new JavaParser(stream);
parser.setStateListener(new TokenStateRecorder(stream));
parser.setStateListener(new TokenStatesRecorder(stream));
RuleContext context = parser.compilationUnit();
Pair<RuleContext, IntervalSet> contextsAndIntervals = parser.getExpectedTokensAt(context, expectation.line, expectation.column);
Set<String> actual = contextsAndIntervals.b.toSet().stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
/* we take advantage of the fact that each successful match is followed by a setState(int state) */
/* however there may be numerous setState following a match, so we only register the first state change */

public class TokenStateRecorder implements StateListener {
public class TokenStatesRecorder implements StateListener {

final TokenStream _tokenStream;
public TokenStateRecorder(TokenStream tokenStream) {
public TokenStatesRecorder(TokenStream tokenStream) {
this._tokenStream = tokenStream;
}

Expand Down

0 comments on commit 4e8a6bb

Please sign in to comment.