diff --git a/utils/java/org.wesnoth.wml/src/org/wesnoth/tests/WMLTests.java b/utils/java/org.wesnoth.wml/src/org/wesnoth/tests/WMLTests.java index e9ce9cb1426..1e375b98449 100644 --- a/utils/java/org.wesnoth.wml/src/org/wesnoth/tests/WMLTests.java +++ b/utils/java/org.wesnoth.wml/src/org/wesnoth/tests/WMLTests.java @@ -77,6 +77,13 @@ public abstract class WMLTests extends AbstractXtextTests } } + protected void showTokenisation(String input) { + List tokens = getTokens(input); + for (int i = 0; i < tokens.size(); i++) { + Token token = tokens.get(i); + System.out.println(getTokenType(token)); + } + } /** * check that an input is not tokenised using a particular terminal rule * */ diff --git a/utils/java/org.wesnoth.wml/src/org/wesnoth/tests/WMLTestsImpl.java b/utils/java/org.wesnoth.wml/src/org/wesnoth/tests/WMLTestsImpl.java index 423d3ab1097..86ed77927d9 100644 --- a/utils/java/org.wesnoth.wml/src/org/wesnoth/tests/WMLTestsImpl.java +++ b/utils/java/org.wesnoth.wml/src/org/wesnoth/tests/WMLTestsImpl.java @@ -24,10 +24,6 @@ public class WMLTestsImpl extends WMLTests checkTokenisation("abc", ID); checkTokenisation("abc123", ID); checkTokenisation("abc_123", ID); - - //fail as entity is a keyword - failTokenisation("entity", ID); - failTokenisation("A", ID); } public void testSLCOMMENT(){ checkTokenisation("#comment", SL_COMMENT); @@ -37,10 +33,10 @@ public class WMLTestsImpl extends WMLTests public void testTokenSequences(){ checkTokenisation("123 abc", ID, WS, ID); - checkTokenisation("123 \t#comment\n abc", INT, WS, SL_COMMENT,WS,ID); + checkTokenisation("123 \t#comment\n abc", ID, WS, SL_COMMENT,WS,ID); //note that no white space is necessary! - checkTokenisation("123abc", INT, ID); + checkTokenisation("123abc", ID); } } \ No newline at end of file