gdb/fortran: Simplify handling of Fortran dot operations and keywords
authorAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 16 Jan 2019 15:30:54 +0000 (15:30 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 6 Mar 2019 18:11:31 +0000 (18:11 +0000)
commitc8f9160408315deceee5e8776f0b1c4d9cba4398
treeb85ad39685b0f4670f47d2714d8020bc93eaa27d
parentdd9f2c763b325227a3721eaf4006db67b37f3b13
gdb/fortran: Simplify handling of Fortran dot operations and keywords

Use strncasecmp to compare Fortran dot operations (like .AND.) and for
the keywords list.  This allows for some duplication to be removed
from the token arrays.  I've also performed whitespace cleanup around
the code I've changed.

I have added some tests to ensure that upper and lowercase dot
operations are correctly tested.  The keywords list remains always
lowercase for now.

There should be no user visible changes after this commit.

gdb/ChangeLog:

* f-exp.y (struct token): Add comments.
(dot_ops): Remove uppercase versions and the end marker.
(f77_keywords): Likewise.
(yylex): Use ARRAY_SIZE to iterate over dot_ops, assert all
entries in the dot_ops array are case insensitive, and use
strncasecmp to compare strings.  Also some whitespace cleanup in
this area.  Similar for the f77_keywords array, except entries in
this list might be case sensitive.

gdb/testsuite/ChangeLog:

* gdb.fortran/dot-ops.exp: New file.
gdb/ChangeLog
gdb/f-exp.y
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.fortran/dot-ops.exp [new file with mode: 0644]
This page took 0.02457 seconds and 4 git commands to generate.