From 251419e1f0ab8eb04d21287b708b06a552f4c58a Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Mon, 10 Apr 2017 16:49:31 -0400 Subject: Warning resolution --- JPratt/src/main/java/bjc/pratt/TokenStream.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'JPratt/src/main/java/bjc/pratt/TokenStream.java') diff --git a/JPratt/src/main/java/bjc/pratt/TokenStream.java b/JPratt/src/main/java/bjc/pratt/TokenStream.java index d3472a0..e377352 100644 --- a/JPratt/src/main/java/bjc/pratt/TokenStream.java +++ b/JPratt/src/main/java/bjc/pratt/TokenStream.java @@ -69,9 +69,9 @@ public abstract class TokenStream implements Iterator> { String expectedList = StringUtils.toEnglishList(expectedKeys.toArray(), false); throw new ExpectationException("One of '" + expectedList + "' was expected, not " + curKey); - } else { - next(); } + + next(); } /** @@ -88,7 +88,15 @@ public abstract class TokenStream implements Iterator> { public final void expect(K... expectedKeys) throws ExpectationException { expect(new HashSet<>(Arrays.asList(expectedKeys))); } - + + /** + * Check whether the head token is a certain type. + * + * @param val + * The type to check for. + * + * @return Whether or not the head token is of that type. + */ public boolean headIs(K val) { return current().getKey().equals(val); } -- cgit v1.2.3