Page 1 of 1

Who would like syntax definition to include formatting

Posted: Tue Feb 03, 2004 4:40 pm
by space cadet
Basically a rip from visual studio - that is run time code formatting

This formatting would mean that IF's CASE's and loops could be defined with tab/space settings

eg The line after a line that starts IF is automatically tabbed in once then if a line starts with ELSE or END then the line is tabbed back to be inline with the initial IF after the return key is pressed

Similar settings could be defined for CASE and SWITCH conditionals

Just a thought really

Posted: Wed Feb 04, 2004 10:09 am
by ramonsky
You're talking about smart indentation, aren't you?

Presumably this could be done just by considering braces ({ and }). You wouldn't also need to consider keywords - at least, not in C++. (Python is another matter).

I haven't voted yet, because I haven't properly understood what you want. May I assume that when you say "CASE" you actually mean "case" (etc.), or are you talking about some different language which uses uppercase keywords and with which I am unfamiliar?

Jill

Posted: Wed Feb 04, 2004 5:23 pm
by space cadet
yeah smart indentation - if you've used visual studio then you will know what i mean.

With regards to CASE - i tend to capatalise keywords just to make them stand out a bit better, i wasn't refering to case sensitive formatting i meant CASE as in

Code: Select all

CASE var1
   when var1 = 1 then ...
   when var1 = 2 then...
ELSE
...
END
So the syntax definition would need to include something for indenting on these conditions
EG: [CASE(0)|WHEN(+3)|ELSE(0)|END(0)]

could define how to format a CASE WHEN ELSE END structure.[/code]