forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2a7425d
committed
jsonpath scanner: reentrant scanner
Use the flex %option reentrant to make the generated scannerreentrant and thread-safe. Note: The parser was already pure.Simplify flex scan buffer management: Instead of constructing thebuffer from pieces and then using yy_scan_buffer(), we can just useyy_scan_string(), which does the same thing internally. (Actually, weuse yy_scan_bytes() here because we already have the length.)Use flex yyextra to handle context information, instead of globalvariables. This complements the other changes to make the scannerreentrant.Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>Reviewed-by: Andreas Karlsson <andreas@proxel.se>Discussion:https://www.postgresql.org/message-id/flat/eb6faeac-2a8a-4b69-9189-c33c520e5b7b@eisentraut.org1 parent9b25489 commit2a7425d
File tree
4 files changed
+145
-154
lines changed- src/backend
- utils/adt
4 files changed
+145
-154
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
60 | 60 |
| |
61 | 61 |
| |
62 | 62 |
| |
| 63 | + | |
63 | 64 |
| |
64 | 65 |
| |
| 66 | + | |
65 | 67 |
| |
66 | 68 |
| |
67 | 69 |
| |
|
Lines changed: 10 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 |
| |
26 | 31 |
| |
27 | 32 |
| |
28 | 33 |
| |
29 | 34 |
| |
30 |
| - | |
| 35 | + | |
| 36 | + | |
31 | 37 |
| |
32 | 38 |
| |
33 |
| - | |
| 39 | + | |
| 40 | + | |
34 | 41 |
| |
35 | 42 |
| |
| 43 | + | |
36 | 44 |
| |
37 | 45 |
| |
38 | 46 |
|
0 commit comments
Comments
(0)