I’m working on improving Clarion folding support for VS Code and need to ensure that all block structures requiring an explicit END are properly handled.
What I Need Help With
I’m looking for a definitive list of Clarion statements that introduce a block structure that must be explicitly closed with an END.
Here’s what I have so far:
CASE ... END
IF ... END
LOOP ... END
WINDOW ... END
SHEET ... END
TAB ... END
QUEUE ... END
CLASS ... END
MAP ... END
FILE ... END
RECORD ... END
VIEW ... END
JOIN ... END (inside VIEW)
INTERFACE ... END
Clarifications:
I’m looking for blocks that require a closing END to be valid. I’m looking for any missing structures that follow this pattern.
Are there any other statements that start a block requiring an END that I’ve missed?
GROUP (in Data, and a control in a window, if context matters)
ITEMIZE
EXECUTE
BEGIN
REPORT
FORM
DETAIL
HEADER
FOOTER
BREAK(Variable) (when inside of a report) vs. the statement inside of a loop that does not have an end
TOOLBAR
MODULE (as mentioned by Rick)
MENUBAR
MENU
OPTION (as mentioned by Rick)
ACCEPT
APPLICATION (an MDI frame)
OLE
NOTE: The end of a LOOP can be END | UNTIL | WHILE
and of course, it is allowed to still use a period ‘.’ in place of an END
– Which is something that I removed from my code due to code folding complications
Personally I don’t have a problem with ignoring periods as terminators
I’m sure it must make the parsing a fair bit harder, as there more contexts to track.
If you can handle easliy handle some cases, then why not write them?
But if it’s bogging you down, then just leave those cases as TODOs.
IMO If someone really wants code folding to support period as END, then let them write the TODOs.
Because of my history with other editors that fail to handle periods in place of END for code folding, I’ve personally come to consider a period as an END as a code smell. So much so that I’ve considered asking for a pragma that removes support for periods as END, but SV has much higher priorities and I don’t want to distract them.
Just my 1/50 of a dollar
(strange, I had to hit refresh, for a typo fix to appear)
Yes! I use the Clarion package and works very well (thanks, fushnisoft!)
I use the code folding some times, when I want to read my code on a higher level…
On the old 2k years, I used TextPad and it had Clarion definition files. They are from 2000, but maybe could be of any help…
Here: TextPad addons