Show line numbers in CTF parser errors
[babeltrace.git] / formats / ctf / metadata / ctf-lexer.l
index 26aa1bce2322d2571a9b57b24d614484009e3cdc..905da9916711831c1680479444f5b2898f88d846 100644 (file)
@@ -31,7 +31,7 @@
 #include "ctf-parser.h"
 #include "ctf-ast.h"
 
-__attribute__((visibility("hidden")))
+BT_HIDDEN
 void setstring(struct ctf_scanner *scanner, YYSTYPE *lvalp, const char *src);
 
 static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
@@ -64,11 +64,11 @@ ESCSEQ                              \\(\'|\"|\?|\\|a|b|f|n|r|t|v|{OCTALDIGIT}{1,3}|u{HEXDIGIT}{4}|U{HEXDIG
 "/*"                           BEGIN(comment_ml);
 <comment_ml>[^*\n]*            /* eat anything that's not a '*' */
 <comment_ml>"*"+[^*/\n]*       /* eat up '*'s not followed by '/'s */
-<comment_ml>\n                 ++yylineno;
+<comment_ml>\n
 <comment_ml>"*"+"/"            BEGIN(INITIAL);
 
 "//"                           BEGIN(comment_sl);
-<comment_sl>[^\n]*\n           ++yylineno; BEGIN(INITIAL);
+<comment_sl>[^\n]*\n           BEGIN(INITIAL);
 
 L\'                            BEGIN(char_const); return CHARACTER_CONSTANT_START;
 \'                             BEGIN(char_const); return CHARACTER_CONSTANT_START;
@@ -133,6 +133,6 @@ _Imaginary                  setstring(yyextra, yylval, yytext); return _IMAGINARY;
 0{OCTALDIGIT}*{INTEGER_SUFFIX}?        setstring(yyextra, yylval, yytext); return OCTAL_CONSTANT;
 0[xX]{HEXDIGIT}+{INTEGER_SUFFIX}?      setstring(yyextra, yylval, yytext); return HEXADECIMAL_CONSTANT;
 {IDENTIFIER}                   printf_debug("<IDENTIFIER %s>\n", yytext); setstring(yyextra, yylval, yytext); if (is_type(yyextra, yytext)) return ID_TYPE; else return IDENTIFIER;
-[ \t\n]+                       ; /* ignore */
+[ \t\n\r]+                     ; /* ignore */
 .                              return ERROR;
 %%
This page took 0.024654 seconds and 4 git commands to generate.