peter klausler 189c0833df [flang] Fix edge case with Hollerith
To prevent mistokenization of CHARACTER*2HXY as a Hollerith
literal constant while allowing it in DATA A/2*2HXY/, there's
a little state that tracks whether a / has been seen earlier
in the same statement.  But it was being reset on each line,
not statement, so Hollerith in a DATA statement continuation
line was incorrectly tokenized.  Fixed.

Differential Revision: https://reviews.llvm.org/D85571
2020-08-10 11:31:41 -07:00

15 lines
270 B
Fortran

! RUN: %f18 -E %s 2>&1 | FileCheck %s
! CHECK: character*1hi
! CHECK: dataa/1*1h /
! CHECK: datab/1*1h /
! CHECK: do1h=1,2
CHARACTER*1H I
CHARACTER*1 A,B
INTEGER H
DATA A/1*1H /
DATA B/
+1*1H /
DO1H =1,2
1 CONTINUE
END