Re: Style(9): Allow // comments

From: Julian H. Stacey <jhs_at_berklix.com>
Date: Mon, 08 Aug 2022 00:01:49 UTC
Hi Stefan & arch@
(Apologies for delay, traveling)

Stefan Esser wrote: Sun, 31 Jul 2022 07:42:44 +0200

> Am 31.07.22 um 01:25 schrieb Julian H. Stacey:
> > Beware // as a delimeter in calendar files, exaples below.
> >   Nov 5	Fireworks in UK https://en.wikipedia.org/wiki/Guy_Fawkes_Night
> >
> > I have 248 lines match on
> >   http://berklix.com/~jhs/src/bsd/fixes/freebsd/src/gen/usr.bin/calendar/
> >   find . -type f | xargs grep // | grep http | grep -v /no_customise/ | wc -l
> >
> > Most http[s]:// are in commented out blocks, but some are uncommented, eg:
> >
> > Oct Sun-1	Munich Oktoberfest ends http://www.oktoberfest.de
> > 		/* Not sure if exact algorithm, probably first Sun. in Oct,
> > 		 * but might be  Sunday of 1st full weekend in Oct?
> > 		 * I've kept a log to later deduce, see
> > 		 *	http://www.berklix.com/~jhs/src/bsd/fixes/freebsd/src/gen/usr.bin/calendar/calendars/de_DE.ISO8859-1/bavaria/munich/calendar.other
> > 		 * Start date is more problematic, being
> > 		 * Saturday with 16 days to end on Sunday.
> > 		 * & Parade as Friday with 17 days before end,
> > 		 * An easter-16 type fuctionality would be nice.
> > 		 */
>
> I am not sure what you are trying to say with your comment ...
>
> For one thing, calendar files are not C source code, which is the subject
> of the proposed change to allow C++ style single line commends.

OK Thanks


> And I did not see any issues with the use of // in URLs in calendar files
> in my testing.

I had problems before with numerous of my own calendar files 
	(on hosts from 9.2-rel to current), & some were // related, (
	Maybe I'd re-introduced // usage in my calendars, hoping
	to migrate my old hosts to newer releases, then got stuck
	on old releases.
	Now I'm travelling with laptop, other (non calendar) problems
	forced me back from current to stable, & stable to 12.3-release,
	with a 9.3 fallback bootble, & no up to date current.  When
	I return I'll have a 9.2 as well again, & a current sometime
	later again. )

Before my earlier post, I checked man calendar (on 12.3-rel, & as //
wasn't listed, just /* */, & as I want my calendars to run on 9.2
(& way older back to 4.11 & 6.4) through current, I purged all my //
comments leaving just // as text in http://www etc.


> I had extended the parsing of calendar files to reintroduce conditional
> sections, definitions, and comments as previously implemented by processing
> by the traditional C preprocessor,

Nice. I'd half forgotten that.


> and I have been waiting for your feedback
> on whether these features work correctly.

Apologies, I've been distracted by constant time wasters starting
with Brexit.  I trawled my mail archive, & found one mail to you re.
calendar of Sun, 25 Oct 2020 01:35:07 +0200, if there's others you'r
waiting on, please resend to me.


> The calendar program treats // as the start of a comment only at the beginning
> of a line or if it follows white space. This detail was missing in the calendar
> man page and I have just added it on -CURRENT.

Useful, Noted to my ~/.calendar/calendar so I see it on older releases.


> Please let me know if calendar files are not parsed as expected and as
> documented.

Thanks, will do.

> Regards, STefan

Cheers,
-- 
Julian Stacey  http://berklix.com/jhs/ http://stolenVotes.uk
Arm Ukraine, Zap killer Putin, grain & fuel loss hits poorest.