Improvement request lazarus / 64-FPC development ---------------------------------------------------------------------- 440bx · 2024-02-10 14:06 Hello, FPC v3.2.2 currently emits an "Error: Illegal expression" message when it encounters an assignment statement with a missing ":", i.e, Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i SomeVar = avalue;   { illegal expression - note missing ":" } This is an easy mistake to make when porting C code to Pascal.  More often than not, the cause of the problem is evident (the missing ":") but, on occasion, after porting many lines of code, the reason can be overlooked resulting in a waste of time. The request is therefore: if at all possible improve the error message to something along the lines of "possible ":" missing in assignment statement" or something along those lines. Thank you. ---------------------------------------------------------------------- Kays · 2024-02-10 22:40 The word note is in the imperative mood. “Pay attention!” Maybe you can’t see it but there ain’t no colon. Your wording on the other hand is pretty suggestive. We don’t know what’s missing; there are multiple valid hypotheses. ---------------------------------------------------------------------- 440bx · 2024-02-10 23:41 Quote from: Kays on February 10, 2024, 11:40:02 pmthere are multiple valid hypotheses. My hypothesis is that you should follow Lincoln's advice.  It would serve you well. ---------------------------------------------------------------------- Leledumbo · 2024-02-15 15:40 Quote from: 440bx on February 10, 2024, 03:06:55 pmThe request is therefore: if at all possible improve the error message to something along the lines of "possible ":" missing in assignment statement" or something along those lines. In theory, it should be possible, as an explicitly handled case, like this one where it specifically handles proc():=. In this case, instead of falling into an else clause of a case statement, a case to handle _EQ should be added. ---------------------------------------------------------------------- Thaddy · 2024-02-15 17:34 That is not an improvement, it is a fallacy. "Fixing" mistakes by changing syntax is a mistake. Not to mention that assignment does not  equal equality. The same is the case in C , = vs ==. so shut up is the most kind expression I could find. ---------------------------------------------------------------------- xixixi · 2024-02-15 19:33 I think it's a great improvement. If the statement is an (illegal) equality expression, a note could be added to "Illegal expression", like "Did you mean an assignment ':='?". ---------------------------------------------------------------------- 440bx · 2024-02-15 20:35 Quote from: Thaddy on February 15, 2024, 06:34:39 pmThat is not an improvement, it is a fallacy. You and Kay should get a room... make each other happy ---------------------------------------------------------------------- Thaddy · 2024-02-15 20:48 Quote from: 440bx on February 15, 2024, 09:35:52 pmQuote from: Thaddy on February 15, 2024, 06:34:39 pmThat is not an improvement, it is a fallacy. You and Kay should get a room... make each other happy And you should be able to distinguish between assignment and comparison. ---------------------------------------------------------------------- dbannon · 2024-02-16 02:09 Oh, come on, 440bx is not suggesting the compiler should go off and edit your source or anything like that. Just issue a more meaningful message. One that would be more helpful in the vast majority of cases. Davo