diff options
author | John Naylor <john.naylor@postgresql.org> | 2022-09-04 11:33:31 +0700 |
---|---|---|
committer | John Naylor <john.naylor@postgresql.org> | 2022-09-04 12:09:01 +0700 |
commit | dac048f71ebbcf2f980d280711f8ff8001331c5d (patch) | |
tree | 48311f22d4636b6fb12cf2bb43925622521e758a /src/backend/utils/adt/jsonpath_scan.l | |
parent | 80e8450a744b1f6fa75663f37f1db3388995dc67 (diff) | |
download | postgresql-dac048f71ebbcf2f980d280711f8ff8001331c5d.tar.gz postgresql-dac048f71ebbcf2f980d280711f8ff8001331c5d.zip |
Build all Flex files standalone
The proposed Meson build system will need a way to ignore certain
generated files in order to coexist with the autoconf build system,
and C files generated by Flex which are #include'd into .y files make
this more difficult. In similar vein to 72b1e3a21, arrange for all Flex
C files to compile to their own .o targets.
Reviewed by Andres Freund
Discussion: https://www.postgresql.org/message-id/20220810171935.7k5zgnjwqzalzmtm%40awork3.anarazel.de
Discussion: https://www.postgresql.org/message-id/CAFBsxsF8Gc2StS3haXofshHCzqNMRXiSxvQEYGwnFsTmsdwNeg@mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/jsonpath_scan.l')
-rw-r--r-- | src/backend/utils/adt/jsonpath_scan.l | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index 4351f6ec981..ea824bae73e 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -1,4 +1,4 @@ -%{ +%top{ /*------------------------------------------------------------------------- * * jsonpath_scan.l @@ -17,9 +17,18 @@ #include "postgres.h" +/* + * NB: include jsonpath_gram.h only AFTER including jsonpath_internal.h, + * because jsonpath_internal.h contains the declaration for JsonPathString. + */ +#include "jsonpath_internal.h" +#include "jsonpath_gram.h" + #include "mb/pg_wchar.h" #include "nodes/pg_list.h" +} +%{ static JsonPathString scanstring; /* Handles to the buffer that the lexer uses internally */ @@ -142,9 +151,9 @@ hex_fail \\x{hex_dig}{0,1} <xnq,xq,xvq>{hex_char} { parseHexChar(yytext); } -<xnq,xq,xvq>{unicode}*{unicodefail} { yyerror(NULL, "invalid unicode sequence"); } +<xnq,xq,xvq>{unicode}*{unicodefail} { jsonpath_yyerror(NULL, "invalid unicode sequence"); } -<xnq,xq,xvq>{hex_fail} { yyerror(NULL, "invalid hex character sequence"); } +<xnq,xq,xvq>{hex_fail} { jsonpath_yyerror(NULL, "invalid hex character sequence"); } <xnq,xq,xvq>{unicode}+\\ { /* throw back the \\, and treat as unicode */ @@ -154,9 +163,9 @@ hex_fail \\x{hex_dig}{0,1} <xnq,xq,xvq>\\. { addchar(false, yytext[1]); } -<xnq,xq,xvq>\\ { yyerror(NULL, "unexpected end after backslash"); } +<xnq,xq,xvq>\\ { jsonpath_yyerror(NULL, "unexpected end after backslash"); } -<xq,xvq><<EOF>> { yyerror(NULL, "unexpected end of quoted string"); } +<xq,xvq><<EOF>> { jsonpath_yyerror(NULL, "unexpected end of quoted string"); } <xq>\" { yylval->str = scanstring; @@ -178,7 +187,7 @@ hex_fail \\x{hex_dig}{0,1} <xc>\* { } -<xc><<EOF>> { yyerror(NULL, "unexpected end of comment"); } +<xc><<EOF>> { jsonpath_yyerror(NULL, "unexpected end of comment"); } \&\& { return AND_P; } @@ -244,10 +253,10 @@ hex_fail \\x{hex_dig}{0,1} return INT_P; } -{realfail} { yyerror(NULL, "invalid numeric literal"); } -{integer_junk} { yyerror(NULL, "trailing junk after numeric literal"); } -{decimal_junk} { yyerror(NULL, "trailing junk after numeric literal"); } -{real_junk} { yyerror(NULL, "trailing junk after numeric literal"); } +{realfail} { jsonpath_yyerror(NULL, "invalid numeric literal"); } +{integer_junk} { jsonpath_yyerror(NULL, "trailing junk after numeric literal"); } +{decimal_junk} { jsonpath_yyerror(NULL, "trailing junk after numeric literal"); } +{real_junk} { jsonpath_yyerror(NULL, "trailing junk after numeric literal"); } \" { addchar(true, '\0'); |