* [Ada] Parser and lexer cleanup
@ 2022-09-12 8:19 Marc Poulhiès
0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2022-09-12 8:19 UTC (permalink / raw)
To: gcc-patches; +Cc: Bob Duff
[-- Attachment #1: Type: text/plain, Size: 1203 bytes --]
This patch makes various minor cleanup changes to the parser.
No change in behavior.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* par-tchk.adb, par-util.adb, prep.adb, prepcomp.adb, scng.adb:
Use "in" instead of chains of "=" connected with "or else".
Likewise for "not in", "/=", "and then". Misc cleanup.
* par-ch10.adb, par-ch12.adb, par-ch13.adb, par-ch4.adb: Likewise.
* par-ch8.adb, par-ch9.adb, par-endh.adb, par-sync.adb: Likewise.
* par.adb
(Pf_Rec): Remove filler, which was added August 25, 1993 to get
around a compiler limitation that no longer exists. Minor cleanup.
Remove useless qualfications.
* par-ch3.adb: Remove redundant return statements.
(Component_Scan_Loop): Remove loop name; there are no nested
loops, so it's unnecessary and possibly misleading, and it causes
too-long lines.
* par-ch5.adb: DRY: Remove comments that repeat the comments in
par.adb.
(P_Sequence_Of_Statements): It is better to initialize things on
the declaration. And constants are better than variables.
(Test_Statement_Required): Remove unnecessary insertion of a null
statement.
* par-ch6.adb, par-ch7.adb: DRY: Remove comments that repeat the
comments in par.adb.
[-- Attachment #2: patch.diff.gz --]
[-- Type: application/gzip, Size: 18788 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-12 8:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-12 8:19 [Ada] Parser and lexer cleanup Marc Poulhiès
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).