Flex generates a lot of functions that are not actually used. In order
to avoid coverage figures being ruined by that, mark up the part of the
.l files where the generated code appears by lcov exclusion markers.
That way, lcov will typically only reported on coverage for the .l file,
which is under our control, but not for the .c file.
Reviewed-by: Michael Paquier <[email protected]>
* contrib/cube/cubescan.l
*/
+/* LCOV_EXCL_START */
+
/* No reason to constrain amount of data slurped */
#define YY_READ_BUF_SIZE 16777216
%%
+/* LCOV_EXCL_STOP */
+
/* result is not used, but Bison expects this signature */
void
yyerror(NDBOX **result, const char *message)
* A scanner for EMP-style numeric ranges
*/
+/* LCOV_EXCL_START */
+
/* No reason to constrain amount of data slurped */
#define YY_READ_BUF_SIZE 16777216
%%
+/* LCOV_EXCL_STOP */
+
void
yyerror(SEG *result, const char *message)
{
/* Not needed now that this file is compiled as part of bootparse. */
/* #include "bootparse.h" */
+/* LCOV_EXCL_START */
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
#undef fprintf
%%
+/* LCOV_EXCL_STOP */
+
void
yyerror(const char *message)
{
}
%{
+
+/* LCOV_EXCL_START */
+
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
#undef fprintf
#define fprintf(file, fmt, msg) fprintf_to_ereport(fmt, msg)
%%
+/* LCOV_EXCL_STOP */
+
/*
* Arrange access to yyextra for subroutines of the main yylex() function.
* We expect each subroutine to have a yyscanner parameter. Rather than
static void addlit(char *ytext, int yleng);
static void addlitchar(unsigned char ychar);
+/* LCOV_EXCL_START */
+
%}
%option 8bit
}
%%
+/* LCOV_EXCL_STOP */
static void
startlit(void)
static StringInfoData xdbuf;
+/* LCOV_EXCL_START */
+
%}
%option 8bit
. { return JUNK; }
%%
+/* LCOV_EXCL_STOP */
/* Needs to be here for access to yytext */
void
static int GUC_flex_fatal(const char *msg);
static char *GUC_scanstr(const char *s);
+/* LCOV_EXCL_START */
+
%}
%option 8bit
%%
-
+/* LCOV_EXCL_STOP */
/*
* Exported function to read and process the configuration file. The
extern int expr_yyget_column(yyscan_t yyscanner);
extern void expr_yyset_column(int column_no, yyscan_t yyscanner);
+/* LCOV_EXCL_START */
+
%}
/* Except for the prefix, these options should match psqlscan.l */
%%
+/* LCOV_EXCL_STOP */
+
void
expr_yyerror_more(yyscan_t yyscanner, const char *message, const char *more)
{
extern int slash_yyget_column(yyscan_t yyscanner);
extern void slash_yyset_column(int column_no, yyscan_t yyscanner);
+/* LCOV_EXCL_START */
+
%}
/* Except for the prefix, these options should match psqlscan.l */
%%
+/* LCOV_EXCL_STOP */
+
/*
* Scan the command name of a psql backslash command. This should be called
* after psql_scan() returns PSCAN_BACKSLASH. It is assumed that the input
extern int psql_yyget_column(yyscan_t yyscanner);
extern void psql_yyset_column(int column_no, yyscan_t yyscanner);
+/* LCOV_EXCL_START */
+
%}
%option reentrant
%%
+/* LCOV_EXCL_STOP */
+
/*
* Create a lexer working state struct.
*
short else_branch;
} stacked_if_value[MAX_NESTED_IF];
+/* LCOV_EXCL_START */
+
%}
%option 8bit
}
}
<INITIAL>{other}|\n { mmfatal(PARSE_ERROR, "internal error: unreachable state; please report this to <
[email protected]>"); }
+
%%
+
+/* LCOV_EXCL_STOP */
+
void
lex_init(void)
{
static void addlitchar(char c);
+/* LCOV_EXCL_START */
+
%}
%option 8bit
}
%%
+/* LCOV_EXCL_STOP */
+
static void
addlitchar(char c)
{