• Comment Error
    4 replies, posted
I'm pretty sure you're thinking "what is this retard doing", it's probably something easy I overlooked but. I get the error [ERROR] addons/darkrpmodification/lua/darkrp_customthings/shipments.lua:45: '=' expected near '}' 1. unknown - addons/darkrpmodification/lua/darkrp_customthings/shipments.lua:0 C Line 45 is a comment. My code is here [url]http://pastebin.com/5REve0pr[/url]
[del]You have a syntax error somewhere before line 45.[/del] [editline]12th April 2014[/editline] Actually, just retype two lines around the line 45.
I actually mentioned this about 2 years ago but never confirmed it, C-style comments with more than 2 new-lines within them cause syntax errors to report on the wrong line. They probably just break the line counter in the parser or something like that. They don't necessarily cause the error to report on a lower line either, it depends on the amount of code before them as well.
[QUOTE=Willox;44528683]I actually mentioned this about 2 years ago but never confirmed it, C-style comments with more than 2 new-lines within them cause syntax errors to report on the wrong line. They probably just break the line counter in the parser or something like that. They don't necessarily cause the error to report on a lower line either, it depends on the amount of code before them as well.[/QUOTE] Seems to be the case, but I just tried his code and it works perfectly, so I guess this is one of those moments when Lua decides it doesn't like a specific line and you have to retype it from scratch in order to fix it. It happened numerous times to me in the past, and I don't know what causes it, probably some weird byte in the file that is not supposed to be there.
I removed the comments and it works now. Thanks
Sorry, you need to Log In to post a reply to this thread.