private RunNode ParseRunNode(RunCommandType cmdType, RunAction runAction) { StyleToken runCommandToken = tokenStream.Current; CommandNode command; if (AdvanceIfTokenType(StyleTokenType.Animation)) { command = StyleASTNodeFactory.AnimationCommandNode(ParseIdentifierInParentheses(), cmdType, runAction); } else if (AdvanceIfTokenType(StyleTokenType.Sound)) { command = StyleASTNodeFactory.SoundCommandNode(ParseIdentifierInParentheses(), cmdType, runAction); } else { throw new ParseException(runCommandToken, $"Only animation and sound run commands are supported. Found {runCommandToken}"); } command.WithLocation(tokenStream.Current); AssertTokenTypeAndAdvance(StyleTokenType.EndStatement); RunNode runNode = StyleASTNodeFactory.RunNode(command); runNode.WithLocation(runCommandToken); return(runNode); }