MCPcopy Create free account
hub / github.com/atas76/openengine / expectDirective

Method expectDirective

src/main/java/org/ttn/parser/ParserUtil.java:319–333  ·  view source on GitHub ↗
(String directive)

Source from the content-addressed store, hash-verified

317 }
318
319 private static MatchDataElement.DirectiveType expectDirective(String directive) throws ParserException {
320 return switch(directive) {
321 case "phase" -> INPLAY_PHASE;
322 case "intention" -> INTENTION;
323 case "set" -> SET_PIECE_EXECUTION_BLOCK;
324 case "break" -> BREAK;
325 case "HT" -> HALF_TIME;
326 case "possessor" -> POSSESSOR_DEFINITION;
327 case "transition" -> TRANSITION_CHAIN_BLOCK;
328 case "substitution" -> SUBSTITUTION;
329 case "fair_play" -> FAIR_PLAY;
330 case "injury" -> INJURY;
331 default -> throw new ParserException("Keyword expected");
332 };
333 }
334
335 private static void expectToken(String token, String currentToken) throws ParserException {
336 if (!token.equals(currentToken)) {

Callers 1

parseDirectiveMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected