<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style='font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif;'><div>I'm not going to kick you, Mark, as your comments are spot on. <br></div><div><br></div><div>What I think wold be very helpful to the FPC community is a warning that is issued when a semi-colon is immediately followed by a "begin" as that is an unusual construct and, as shown in the example here, an indicator of a likely mistake.<br></div><div><br></div><div>Doug C.<br></div><div><br></div><div class="zmail_extra"><div id="1"><div><br></div><div>---- On Mon, 16 Jan 2017 03:27:25 -0500 <b>Mark Morgan Lloyd via Lazarus <lazarus@lists.lazarus-ide.org></b> wrote ----<br></div></div><div><br></div><blockquote style="border-left: 1px solid #cccccc; padding-left: 6px; margin:0 0 0 5px"><div><div>On 16/01/17 07:30, Lars via Lazarus wrote:<br></div><div>> On Sun, January 15, 2017 3:30 pm, VojtÄch Äihák via Lazarus wrote:> Hello, has Lazarus (CodeTools) or FPC some checking for empty commands? I> accidentally did this stupid mistake: > if ... then begin>> end else;> begin> ...> exit;> end;><br></div><div>> Yikes! I think you just discovered a bug in the pascal language itselfthat was not thought of... as when using a text editor it's easy to leavea semi colon laying around by accident some times.<br></div><div>> I wonder if Oberon solves this issue, or semi-colon-less languages haveany advantage. If you remove the begin from a language (Wirth did in hislater languages) you get rid of some issues.-- _______________________________________________Lazarus mailing <a href="mailto:listLazarus@lists.lazarus-ide.orghttp" target="_blank">listLazarus@lists.lazarus-ide.orghttp</a>://lists.lazarus-ide.org/listinfo/lazarus<br></div><div><br></div><div>It's one of a number of known nasties in the language definition. This <br></div><div>is controversial, but Pascal was defined with ; being a /separator/ not <br></div><div>a /terminator/, so strictly a semicolon is not needed before end else <br></div><div>until etc. and in my experience only using it where necessary is a good <br></div><div>habit to get into ( ;until was a syntax error in at least some versions <br></div><div>of Turbo Pascal).<br></div><div><br></div><div>One other thing that helps in a very small way is to use <br></div><div>case-otherwise-end rather than case-else-end, since it reduces the <br></div><div>number of ambiguities.<br></div><div><br></div><div>Apart from that Wirth deserves no credit at all for leaving the <br></div><div>dangling-else ambiguity in Pascal when it had been recognised and <br></div><div>eliminated in ALGOL-68.<br></div><div><br></div><div>I expect to get kicked for all of the above. They are my opinions only, <br></div><div>and might not be aligned with e.g. the coding style expected in patches <br></div><div>submitted to the FPC or Lazarus projects.<br></div><div><br></div><div>-- <br></div><div>Mark Morgan Lloyd<br></div><div>markMLl .AT. telemetry.co .DOT. uk<br></div><div><br></div><div>[Opinions above are the author's, not those of his employers or colleagues]<br></div><div>-- <br></div><div>_______________________________________________<br></div><div>Lazarus mailing list<br></div><div><a href="mailto:Lazarus@lists.lazarus-ide.org" target="_blank">Lazarus@lists.lazarus-ide.org</a><br></div><div><a href="http://lists.lazarus-ide.org/listinfo/lazarus" target="_blank">http://lists.lazarus-ide.org/listinfo/lazarus</a><br></div></div></blockquote></div><div><br></div></div></body></html>