[Ada] Parser and lexer cleanup
commit272ada7499e6ce8e1a8bd3f82c1cc030a51d074e
authorBob Duff <duff@adacore.com>
Wed, 17 Aug 2022 16:50:42 +0000 (17 12:50 -0400)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 12 Sep 2022 08:16:49 +0000 (12 10:16 +0200)
tree24451793bc0d5f11414bed202922dc3440a49392
parentdad0ebe674d495a7e032a123d2d60c090729ef2c
[Ada] Parser and lexer cleanup

This patch makes various minor cleanup changes to the parser.
No change in behavior.

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.
18 files changed:
gcc/ada/par-ch10.adb
gcc/ada/par-ch12.adb
gcc/ada/par-ch13.adb
gcc/ada/par-ch3.adb
gcc/ada/par-ch4.adb
gcc/ada/par-ch5.adb
gcc/ada/par-ch6.adb
gcc/ada/par-ch7.adb
gcc/ada/par-ch8.adb
gcc/ada/par-ch9.adb
gcc/ada/par-endh.adb
gcc/ada/par-sync.adb
gcc/ada/par-tchk.adb
gcc/ada/par-util.adb
gcc/ada/par.adb
gcc/ada/prep.adb
gcc/ada/prepcomp.adb
gcc/ada/scng.adb