From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e9f0eae6d714d11c X-Google-Attributes: gid103376,public From: collins@cs.wm.edu (Bob Collins) Subject: Re: Gnat pretty printing Date: 1998/12/11 Message-ID: #1/1 X-Deja-AN: 421192663 References: <74lt16$9r0@romeo.logica.co.uk> <366E9E44.AA7370C7@pwfl.com> <74on70$m9o$1@cnn.Princeton.EDU> <74r7ip$t1@top.mitre.org> X-Complaints-To: news@home.net X-Trace: news.rdc1.va.home.com 913386879 24.2.56.132 (Fri, 11 Dec 1998 06:34:39 PDT) Organization: Computer Science @ William & Mary NNTP-Posting-Date: Fri, 11 Dec 1998 06:34:39 PDT Newsgroups: comp.lang.ada Date: 1998-12-11T00:00:00+00:00 List-Id: In article <74r7ip$t1@top.mitre.org>, mfb@mbunix.mitre.org (Michael F Brenner) wrote: > [Material snipped.] > Here are the requirements for a pretty printer: > [Material snipped.] > (o) It goes without saying that > (A) THEN goes on the same line as the IF when it fits; > (B) IS goes on the same line as CASE when it fits; > (C) IF, ELSIF, ELSE, and END IF are in the same column; > (D) CASE, WHEN, and END CASE are in the same column; My LRM says that "the syntax rules describing structured constructs are presented in a form that corresponds to the recommended paragraphing." [1.1.4 (19)] The grammar for a case statement indicates WHEN should be indented. That seems to indicate that "It goes without saying" is a bit too extreme. > (E) There is NEVER a space before a colon, semicolon, comma, or period; The Ada Style Guide recommends a space before a colon. > (F) There is an optional space before and after assignment operators; > (G) the capitalization for IDs and keywords should default to NOT; This seems contrary to two fairly common practices reserved words are uppercased (GMU group) each subunit of identifiers is capitalized (NYU group) > [Material snipped.] Indeed, the Ada95 Style Guide has many automation hints, and would be a good source for deciding how to pretty-print. -- Bob Collins