Incorrect highlighting ("invalid syntax")


#1

I’m seeing a weird error in some game files I’m doing some editing on. In some of the files, a single quote symbol will toggle highlighting.

Looking at the dev tools, the character after a single quote is showing up as “invalid syntax.” For example, look at the “s” on line 984 in this screenshot.

The file in question is at https://github.com/ChangesInBold/cecommpatch/blob/master/scripts/gameobjects/citizen.go, if that helps.

I’m running Win7, with the standard Atom packages.

Thank you.


#2

Where does it start for you in the file?


#3

I see it is everywhere where a single quote ' is used.
For example do not written as don't in example:
https://github.com/ChangesInBold/cecommpatch/blob/master/scripts/gameobjects/citizen.go#L222

Even (standard) vsCode has an issue… there it is even worse. Syntax colouring doesn’t look well there either.

Perhaps the following web search is helpful?..
https://www.google.com/search?q=single+quote+in+go+language

Is the text preceded by -- meant as commentary; instead if using the standard // ?


#4

Line 222 - right after the single quote in “Don’t”:

			return true -- I am okay. Don't need to set up a new job; but you are doing an okay job in the tree right now.

#5

Thank you for the search link regarding the Go language; that’s very helpful.

I think you’ve solved this problem. The file does indeed use – instead of // for inline commentary. I’m thinking of just doing a global replace to fix it.

Thanks again.