gdb/fortran: Cleanup code for parsing logical constants
authorAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 16 Jan 2019 13:36:46 +0000 (13:36 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 6 Mar 2019 18:11:30 +0000 (18:11 +0000)
commitdd9f2c763b325227a3721eaf4006db67b37f3b13
treef758a098af7793cdcb7be768e8148e94474fbe00
parent84ec972406ec519b509f986780481899115847c2
gdb/fortran: Cleanup code for parsing logical constants

This patch cleans up the code used for parsing the Fortran logical
constants '.TRUE.' and '.FALSE.'.  Instead of listing both upper and
lowercase versions of these strings we now use strncasecmp.

I've also switched to use ARRAY_SIZE for the array iteration, and I've
cleaned up whitespace in the vicinity of the code I've changed.

Finally, I've added a test to ensure that both the upper and lower
case versions of the logical constants are understood by GDB,
something that was missing previously.

There should be no user visible changes after this commit.

gdb/ChangeLog:

* f-exp.y (struct f77_boolean_val): Add comments.
(boolean_values): Remove uppercase versions, and end marker.
(yylex): Use ARRAY_SIZE for iterating over boolean_values array,
and use strncasecmp to achieve case insensitivity.  Additionally,
perform whitespace cleanup around this code.

gdb/testsuite/ChangeLog:

* gdb.fortran/types.exp (test_logical_literal_types_accepted):
Check upper and lower case logical literals.
gdb/ChangeLog
gdb/f-exp.y
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.fortran/types.exp
This page took 0.024293 seconds and 4 git commands to generate.