PL/I has no reserved words, so IBM can extend the language without breaking existing code. However, it is bad form to knowingly use a keyword as a procedure, label or variable name.
-- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Discussion List <[email protected]> on behalf of Paul Gilmartin <[email protected]> Sent: Wednesday, September 2, 2020 8:45 AM To: [email protected] Subject: Re: A little magic from Doug Nadel On Wed, 2 Sep 2020 10:47:05 +0000, Robert Prins wrote: >More than 20 years ago I wrote an edit macro "EDOEND", that lets me exclude, in >PL/I source, all statements other than > >'PACKAGE', >'PROC', >'PROCEDURE', >'DO', >'BEGIN', >'SELECT', and >'END' > This seems to go hand-in-hand with HILITE. Does it understand that PL/I has no reserved words and that any of the above might be merely identifiers? "Language and logic hiliting is not supported for ASCII or UTF-8 editing sessions and the HILITE command is not available during these edit sessions." >and a few days ago, using it again, I realised that it could benefit from >adding >a bit of Doug Nadel magic to it, as the '_' character is not part of the word >character set, and as such the macro will happily un-exclude identifiers like >"list_end" etc. > Might this be extended to other languages such as Rexx, C, bash, ... which have different lexical syntax? '{', '(', ')', and '}' might take the function of DO and END. And FORTRAN, where blanks are ignored? >However, before his MVS goodies page was removed, Doug had put a little routine >on it to include characters into the word character set: > ... >tldp = ptr(ptr(24 + ptr(112 + ptr(132 + ptr(540))))) >tablep = ptr(24 + ptr(20 + ptr(96 + ptr(56 + tldp)))) > >do while wordchars <> "" > parse var wordchars char 2 wordchars > call storage d2x(tablep + c2d(char)),1,"00"x > ... Ouch! Is this zapping vendor code? How robust is it with respect to vendor updates? I see 8 undocumented hard-coded constants. >/* Add the characters you want to be part of a word below. This */ >/* macro only needs to be run once per ISPF session but works fine */ >/* as an initial macro or session macro (see manual for ZUSERMAC) */ > Unfortunate choice of scope (but I suppose there was no choice.) The user can't support different languages in different splits. I'd rather see an RFE allowing the user to specify the definition of WORD, perhaps as a regular expression. But I wouldn't hold my breath. -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
