Just a guess, but it could be just a text formatting problem? Try replacing the rule "->" symbols by typing "->" again, and then see if the code runs? Alternatively, copy and paste the text to a plain text editor first and check if the code still looks alright and then copy it to Mathematica.