forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7b27f5f
committed
plpgsql: pure parser and reentrant scanner
The plpgsql scanner is a wrapper around the core scanner, whichalready uses the flex %option reentrant. This patch only pushes up afew levels the place where the scanner handle is allocated. Before,it was allocated in pl_scanner.c in a global variable, so to theoutside the scanner was not reentrant. Now, it is allocated inpl_comp.c and is passed as an argument to yyparse(), similar to how itis handled in other reentrant scanners.Also use flex yyextra to handle context information, instead of globalvariables. Again, this uses the existing yyextra support in the corescanner. This complements the other changes to make the scannerreentrant.The bison option %pure-parser is used to make the generated parserpure. This happens in the usual way, since plpgsql has its own bisonparser definition.Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>Discussion:https://www.postgresql.org/message-id/flat/eb6faeac-2a8a-4b69-9189-c33c520e5b7b@eisentraut.org1 parentb18464f commit7b27f5f
File tree
5 files changed
+598
-537
lines changed- src/pl/plpgsql/src
5 files changed
+598
-537
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
|
Lines changed: 30 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
237 | 237 |
| |
238 | 238 |
| |
239 | 239 |
| |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
240 | 246 |
| |
241 | 247 |
| |
242 | 248 |
| |
| |||
269 | 275 |
| |
270 | 276 |
| |
271 | 277 |
| |
| 278 | + | |
272 | 279 |
| |
273 | 280 |
| |
274 | 281 |
| |
275 | 282 |
| |
276 | 283 |
| |
277 | 284 |
| |
278 | 285 |
| |
| 286 | + | |
279 | 287 |
| |
280 | 288 |
| |
281 | 289 |
| |
| |||
290 | 298 |
| |
291 | 299 |
| |
292 | 300 |
| |
293 |
| - | |
294 |
| - | |
295 |
| - | |
| 301 | + | |
296 | 302 |
| |
297 | 303 |
| |
298 | 304 |
| |
299 |
| - | |
| 305 | + | |
300 | 306 |
| |
301 | 307 |
| |
302 | 308 |
| |
303 | 309 |
| |
304 | 310 |
| |
305 | 311 |
| |
| 312 | + | |
| 313 | + | |
306 | 314 |
| |
307 |
| - | |
| 315 | + | |
308 | 316 |
| |
309 | 317 |
| |
310 | 318 |
| |
| |||
779 | 787 |
| |
780 | 788 |
| |
781 | 789 |
| |
782 |
| - | |
| 790 | + | |
783 | 791 |
| |
784 | 792 |
| |
785 | 793 |
| |
786 | 794 |
| |
787 |
| - | |
| 795 | + | |
788 | 796 |
| |
789 | 797 |
| |
790 | 798 |
| |
| |||
841 | 849 |
| |
842 | 850 |
| |
843 | 851 |
| |
| 852 | + | |
844 | 853 |
| |
845 | 854 |
| |
| 855 | + | |
846 | 856 |
| |
847 | 857 |
| |
848 | 858 |
| |
849 | 859 |
| |
850 | 860 |
| |
851 | 861 |
| |
852 |
| - | |
853 |
| - | |
854 |
| - | |
| 862 | + | |
855 | 863 |
| |
856 |
| - | |
| 864 | + | |
857 | 865 |
| |
858 | 866 |
| |
859 | 867 |
| |
860 | 868 |
| |
861 | 869 |
| |
862 | 870 |
| |
| 871 | + | |
| 872 | + | |
863 | 873 |
| |
864 |
| - | |
| 874 | + | |
865 | 875 |
| |
866 | 876 |
| |
867 | 877 |
| |
| |||
935 | 945 |
| |
936 | 946 |
| |
937 | 947 |
| |
938 |
| - | |
| 948 | + | |
939 | 949 |
| |
940 | 950 |
| |
941 | 951 |
| |
942 | 952 |
| |
943 |
| - | |
| 953 | + | |
944 | 954 |
| |
945 | 955 |
| |
946 | 956 |
| |
| |||
978 | 988 |
| |
979 | 989 |
| |
980 | 990 |
| |
981 |
| - | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
982 | 995 |
| |
983 | 996 |
| |
984 | 997 |
| |
985 | 998 |
| |
986 | 999 |
| |
987 |
| - | |
| 1000 | + | |
988 | 1001 |
| |
989 | 1002 |
| |
990 | 1003 |
| |
| |||
995 | 1008 |
| |
996 | 1009 |
| |
997 | 1010 |
| |
998 |
| - | |
| 1011 | + | |
999 | 1012 |
| |
1000 | 1013 |
| |
1001 | 1014 |
| |
|
0 commit comments
Comments
(0)