I don't know about MacOS, but in general there is a thing called "smart quotes".
That is usually in word processing software, where you type 'pascal' and it auto-changes the first apostrophe into a "left single quote" and the one after the word into a "right single quote".
Of course, that is not what you want. The compiler needs to see a straight ' character which is ASCII 39, nothing else will do. Hopefully this is what the ' key on your keyboard will produce when typing in the IDE.