Skip to content

Commit

Permalink
fix token type detection
Browse files Browse the repository at this point in the history
  • Loading branch information
kspalaiologos committed Feb 21, 2023
1 parent faa44fb commit b3a04f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/palaiologos/kamilalisp/atom/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public void skip() {
};
lex.removeErrorListeners();
lex.addErrorListener(new ThrowingErrorListener(0));
return lex.nextToken().getType() == GrammarLexer.NAME;
var tokens = lex.getAllTokens();
return tokens.get(0).getType() == GrammarLexer.NAME && tokens.size() == 1;
} catch(Throwable e) {
return false;
}
Expand Down

0 comments on commit b3a04f3

Please sign in to comment.