Sometimes this error can occur if the *.pas file contains strange (invisible) characters. Perhaps you can use a text editor that can display invisible control codes and then remove them. Of course, back up the *.pas file first so that nothing else gets broken.
https://en.delphipraxis.net/topic/11014-ummmm-what/?do=findComment&comment=87699