Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: here document within a switch fails to parse.



On 2021-01-08 11:56 a.m., Bart Schaefer wrote:
Another approach you might consider:
(( dothis )) && {
   # all the code you want to skip over
}

That is so much better when it's not a comment block but a code variation, as when debugging something:

test1 ()
{
	(( 0 ))&&\
	{
		echo "Version #1 of some huge block of code that is buggy and I want to 'back and forth' between it and some alternate"
		# Only correct code tho, this is parsed!
	}
	(( 1 ))&&\
	{
		echo "Version #2 of some huge block of code that is buggy and I want to 'back and forth' between it and some alternate"
		# Only correct code tho, this is parsed!
	}
}

... or both can be 'off' or both can be active!  She is a dominatrix, but if you submit, pleasure awaits.  Still, the here document method is preferred for actual long comments because it colorizes differently so the eye quickly passes over in in the editor.  But slowly the Tao is revealed.  Thank you Sensei.





Messages sorted by: Reverse Date, Date, Thread, Author