Closed ryjer closed 2 years ago
There is a blank line at the end or the flex echoes the EOF error
$ flex test.l
test.l:12: EOF encountered inside an action
A blank line in the rules is fine, as long as there is an ending %%
.
Also, there are some (not many) not-so-well documented features of Flex that RE/flex replicates faithfully. However, bad undocumented (or under documented) features are not replicated because these often cause confusion or result in compilation errors. There are only one or two such cases that I recall are deemed bad.
A missing ending %%
is not a good feature of Flex nor a bad feature of Flex, but an ugly feature of Flex. It fits between these criteria for RE/Flex to replicate or not. I may replicate it in a future release perhaps.
I should add that all Flex features are replicated, but there is at least one bad situation where the interpretation of the Lex/Flex specification is ambiguous when using empty lines or other forms of spacing/indentation. If it's not clearly documented in Flex and the situation is ambiguous then I left it out of reflex. This is what I mean by a "bad" feature.
The second %%
can be omitted in the latest v3.2.2 update.
This is the version
For this file
flex works well but reflex echoes an error. (This file has 13 rows in total, there is a blank line at the end but github not show.)
It sames need a pair of
%%
for reflex.