Is there a way to configure/modify yylineno
to recognize a single \r
(carriage return) character as newline?
Ultimately, I'd like to use yylineno
for 3 different types of file:
\n
: Unix-like\r\n
: Windows-based (will be recognized as a single newline, not two, i.e.\r
+\n
)\r
: e.g. classic Mac OS
I know that I'm able to define my own variable to keep track of the line number in Flex and increment it everytime one of the newline characters (\r|\n|\r\n)
is found, but I'd prefer to use the built-in Flex feature if it's available.
Thank you.