Recent

Author Topic: Not allow “do;“  (Read 5632 times)

Kraig

  • New Member
  • *
  • Posts: 27
Re: Not allow “do;“
« Reply #15 on: September 03, 2023, 04:09:48 pm »
Interesting, thanks I’ll look

Kays

  • Hero Member
  • *****
  • Posts: 614
  • Whasup!?
    • KaiBurghardt.de
Re: Not allow “do;“
« Reply #16 on: September 03, 2023, 09:42:14 pm »
I just spent a lot of time […] I’d like to suggest that putting a semicolon after do should generate a compile error […]
Yeah, PEBCAK. There are many code samples that may have limited usefulness, but are allowed and syntactically correct, examples:
Code: Pascal  [Select][+][-]
  1. ;;;;;;;;;;;;;;;;       { extraneous empty statements }
  2. ++-+-+---+-+----+-+-42 { superfluous unary operators }
  3. @myPointerVariable^    { instead of _just_ `myPointerVariable` }
Still I disapprove emission of warnings in such cases: It adds complexity to the compiler at minimal benefit. On top of that it’s difficult to formally codify the threshold that something deserves a warning.
Yours Sincerely
Kai Burghardt

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10698
  • Debugger - SynEdit - and more
    • wiki
Re: Not allow “do;“
« Reply #17 on: September 03, 2023, 11:24:19 pm »
There are many code samples that may have limited usefulness, but are allowed and syntactically correct, examples:
Code: Pascal  [Select][+][-]
  1. ;;;;;;;;;;;;;;;;       { extraneous empty statements }
  2. ++-+-+---+-+----+-+-42 { superfluous unary operators }

And that means that this is valid code:
Code: Pascal  [Select][+][-]
  1. while ++i < c do ;

;) ;)

 

TinyPortal © 2005-2018