Skip to content

Commit 8d53e36

Browse files
authored
Commit 5: Port missing POSIX-bracket parse cases from PR #22200
Add corpus cases: bare [:alpha:], mid-pattern a[:b:]c, POSIX class as range endpoint [[:alpha:]-z], malformed [[:alpha], leading literal ] combined with a POSIX class []a[:alpha:]], three POSIX classes in one class, additional names [[:xdigit:]] / [[:blank:]] / [[:cntrl:]] / [[:graph:]], and the integration case combining all of the above. The regenerated parse.expected reveals genuine mis-parses that this commit deliberately records (fixes in Commit 6): - unnested [:alpha:] and [:b:] are treated as RegExpNamedCharacterProperty even though POSIX brackets are only valid inside a character class, - [[:alpha:]-z] emits a spurious [RegExpCharacterRange] ":]-z" instead of a POSIX class + literal '-' + 'z'. Bundle: github/codeql-action codeql-bundle-v2.26.1 (CodeQL CLI 2.26.1).
1 parent 8aa1a7b commit 8d53e36

4 files changed

Lines changed: 437 additions & 143 deletions

File tree

Lines changed: 87 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,87 @@
1-
| test.cpp:144:23:144:23 | a | 22 | 0 | 1 | 23 | 23 |
2-
| test.cpp:144:23:144:24 | a+ | 22 | 0 | 2 | 23 | 24 |
3-
| test.cpp:144:23:144:25 | a+b | 22 | 0 | 3 | 23 | 25 |
4-
| test.cpp:144:25:144:25 | b | 22 | 2 | 3 | 25 | 25 |
5-
| test.cpp:147:23:147:23 | a | 20 | 0 | 1 | 23 | 23 |
6-
| test.cpp:147:23:147:24 | a+ | 20 | 0 | 2 | 23 | 24 |
7-
| test.cpp:147:23:147:25 | a+b | 20 | 0 | 3 | 23 | 25 |
8-
| test.cpp:147:25:147:25 | b | 20 | 2 | 3 | 25 | 25 |
9-
| test.cpp:150:24:150:25 | \\s | 21 | 0 | 2 | 24 | 25 |
10-
| test.cpp:150:24:150:26 | \\s+ | 21 | 0 | 3 | 24 | 26 |
11-
| test.cpp:150:24:150:27 | \\s+$ | 21 | 0 | 4 | 24 | 27 |
12-
| test.cpp:150:27:150:27 | $ | 21 | 3 | 4 | 27 | 27 |
13-
| test.cpp:153:24:153:25 | \\( | 21 | 0 | 2 | 24 | 25 |
14-
| test.cpp:153:24:153:37 | \\(([,\\w]+)+\\)$ | 21 | 0 | 14 | 24 | 37 |
15-
| test.cpp:153:26:153:33 | ([,\\w]+) | 21 | 2 | 10 | 26 | 33 |
16-
| test.cpp:153:26:153:34 | ([,\\w]+)+ | 21 | 2 | 11 | 26 | 34 |
17-
| test.cpp:153:27:153:31 | [,\\w] | 21 | 3 | 8 | 27 | 31 |
18-
| test.cpp:153:27:153:32 | [,\\w]+ | 21 | 3 | 9 | 27 | 32 |
19-
| test.cpp:153:28:153:28 | , | 21 | 4 | 5 | 28 | 28 |
20-
| test.cpp:153:29:153:30 | \\w | 21 | 5 | 7 | 29 | 30 |
21-
| test.cpp:153:35:153:36 | \\) | 21 | 11 | 13 | 35 | 36 |
22-
| test.cpp:153:37:153:37 | $ | 21 | 13 | 14 | 37 | 37 |
23-
| test.cpp:156:25:156:25 | a | 21 | 0 | 1 | 25 | 25 |
24-
| test.cpp:156:25:156:26 | a+ | 21 | 0 | 2 | 25 | 26 |
25-
| test.cpp:156:25:156:27 | a+b | 21 | 0 | 3 | 25 | 27 |
26-
| test.cpp:156:27:156:27 | b | 21 | 2 | 3 | 27 | 27 |
27-
| test.cpp:159:24:159:24 | a | 22 | 0 | 1 | 24 | 24 |
28-
| test.cpp:159:24:159:25 | a+ | 22 | 0 | 2 | 24 | 25 |
29-
| test.cpp:159:24:159:26 | a+b | 22 | 0 | 3 | 24 | 26 |
30-
| test.cpp:159:26:159:26 | b | 22 | 2 | 3 | 26 | 26 |
31-
| test.cpp:162:30:162:30 | a | 26 | 0 | 1 | 30 | 30 |
32-
| test.cpp:162:30:162:31 | a+ | 26 | 0 | 2 | 30 | 31 |
33-
| test.cpp:162:30:162:32 | a+b | 26 | 0 | 3 | 30 | 32 |
34-
| test.cpp:162:32:162:32 | b | 26 | 2 | 3 | 32 | 32 |
35-
| test.cpp:166:22:166:23 | \\s | 21 | 0 | 2 | 22 | 23 |
36-
| test.cpp:166:22:166:24 | \\s+ | 21 | 0 | 3 | 22 | 24 |
37-
| test.cpp:169:22:169:22 | a | 21 | 0 | 1 | 22 | 22 |
38-
| test.cpp:169:22:169:25 | a\\.b | 21 | 0 | 4 | 22 | 25 |
39-
| test.cpp:169:23:169:24 | \\. | 21 | 1 | 3 | 23 | 24 |
40-
| test.cpp:169:25:169:25 | b | 21 | 3 | 4 | 25 | 25 |
1+
| test.cpp:143:24:143:32 | [[:alpha] | 23 | 0 | 9 | 24 | 32 |
2+
| test.cpp:143:25:143:25 | [ | 23 | 1 | 2 | 25 | 25 |
3+
| test.cpp:143:26:143:26 | : | 23 | 2 | 3 | 26 | 26 |
4+
| test.cpp:143:27:143:27 | a | 23 | 3 | 4 | 27 | 27 |
5+
| test.cpp:143:28:143:28 | l | 23 | 4 | 5 | 28 | 28 |
6+
| test.cpp:143:29:143:29 | p | 23 | 5 | 6 | 29 | 29 |
7+
| test.cpp:143:30:143:30 | h | 23 | 6 | 7 | 30 | 30 |
8+
| test.cpp:143:31:143:31 | a | 23 | 7 | 8 | 31 | 31 |
9+
| test.cpp:146:24:146:36 | []a[:alpha:]] | 23 | 0 | 13 | 24 | 36 |
10+
| test.cpp:146:25:146:25 | ] | 23 | 1 | 2 | 25 | 25 |
11+
| test.cpp:146:26:146:26 | a | 23 | 2 | 3 | 26 | 26 |
12+
| test.cpp:146:27:146:35 | [:alpha:] | 23 | 3 | 12 | 27 | 35 |
13+
| test.cpp:149:25:149:53 | [[:alpha:][:digit:][:space:]] | 24 | 0 | 29 | 25 | 53 |
14+
| test.cpp:149:26:149:34 | [:alpha:] | 24 | 1 | 10 | 26 | 34 |
15+
| test.cpp:149:35:149:43 | [:digit:] | 24 | 10 | 19 | 35 | 43 |
16+
| test.cpp:149:44:149:52 | [:space:] | 24 | 19 | 28 | 44 | 52 |
17+
| test.cpp:152:25:152:36 | [[:xdigit:]] | 24 | 0 | 12 | 25 | 36 |
18+
| test.cpp:152:26:152:35 | [:xdigit:] | 24 | 1 | 11 | 26 | 35 |
19+
| test.cpp:153:25:153:35 | [[:blank:]] | 24 | 0 | 11 | 25 | 35 |
20+
| test.cpp:153:26:153:34 | [:blank:] | 24 | 1 | 10 | 26 | 34 |
21+
| test.cpp:154:25:154:35 | [[:cntrl:]] | 24 | 0 | 11 | 25 | 35 |
22+
| test.cpp:154:26:154:34 | [:cntrl:] | 24 | 1 | 10 | 26 | 34 |
23+
| test.cpp:155:25:155:35 | [[:graph:]] | 24 | 0 | 11 | 25 | 35 |
24+
| test.cpp:155:26:155:34 | [:graph:] | 24 | 1 | 10 | 26 | 34 |
25+
| test.cpp:158:25:158:25 | ^ | 24 | 0 | 1 | 25 | 25 |
26+
| test.cpp:158:25:158:92 | ^([[:alpha:]]+[[:digit:]]*[[:space:]]?)+([[:punct:]]\|[[:xdigit:]])+$ | 24 | 0 | 68 | 25 | 92 |
27+
| test.cpp:158:26:158:63 | ([[:alpha:]]+[[:digit:]]*[[:space:]]?) | 24 | 1 | 39 | 26 | 63 |
28+
| test.cpp:158:26:158:64 | ([[:alpha:]]+[[:digit:]]*[[:space:]]?)+ | 24 | 1 | 40 | 26 | 64 |
29+
| test.cpp:158:27:158:37 | [[:alpha:]] | 24 | 2 | 13 | 27 | 37 |
30+
| test.cpp:158:27:158:38 | [[:alpha:]]+ | 24 | 2 | 14 | 27 | 38 |
31+
| test.cpp:158:27:158:62 | [[:alpha:]]+[[:digit:]]*[[:space:]]? | 24 | 2 | 38 | 27 | 62 |
32+
| test.cpp:158:28:158:36 | [:alpha:] | 24 | 3 | 12 | 28 | 36 |
33+
| test.cpp:158:39:158:49 | [[:digit:]] | 24 | 14 | 25 | 39 | 49 |
34+
| test.cpp:158:39:158:50 | [[:digit:]]* | 24 | 14 | 26 | 39 | 50 |
35+
| test.cpp:158:40:158:48 | [:digit:] | 24 | 15 | 24 | 40 | 48 |
36+
| test.cpp:158:51:158:61 | [[:space:]] | 24 | 26 | 37 | 51 | 61 |
37+
| test.cpp:158:51:158:62 | [[:space:]]? | 24 | 26 | 38 | 51 | 62 |
38+
| test.cpp:158:52:158:60 | [:space:] | 24 | 27 | 36 | 52 | 60 |
39+
| test.cpp:158:65:158:90 | ([[:punct:]]\|[[:xdigit:]]) | 24 | 40 | 66 | 65 | 90 |
40+
| test.cpp:158:65:158:91 | ([[:punct:]]\|[[:xdigit:]])+ | 24 | 40 | 67 | 65 | 91 |
41+
| test.cpp:158:66:158:76 | [[:punct:]] | 24 | 41 | 52 | 66 | 76 |
42+
| test.cpp:158:66:158:89 | [[:punct:]]\|[[:xdigit:]] | 24 | 41 | 65 | 66 | 89 |
43+
| test.cpp:158:67:158:75 | [:punct:] | 24 | 42 | 51 | 67 | 75 |
44+
| test.cpp:158:78:158:89 | [[:xdigit:]] | 24 | 53 | 65 | 78 | 89 |
45+
| test.cpp:158:79:158:88 | [:xdigit:] | 24 | 54 | 64 | 79 | 88 |
46+
| test.cpp:158:92:158:92 | $ | 24 | 67 | 68 | 92 | 92 |
47+
| test.cpp:163:21:163:26 | \\u9879 | 20 | 0 | 6 | 21 | 26 |
48+
| test.cpp:171:23:171:23 | a | 22 | 0 | 1 | 23 | 23 |
49+
| test.cpp:171:23:171:24 | a+ | 22 | 0 | 2 | 23 | 24 |
50+
| test.cpp:171:23:171:25 | a+b | 22 | 0 | 3 | 23 | 25 |
51+
| test.cpp:171:25:171:25 | b | 22 | 2 | 3 | 25 | 25 |
52+
| test.cpp:174:23:174:23 | a | 20 | 0 | 1 | 23 | 23 |
53+
| test.cpp:174:23:174:24 | a+ | 20 | 0 | 2 | 23 | 24 |
54+
| test.cpp:174:23:174:25 | a+b | 20 | 0 | 3 | 23 | 25 |
55+
| test.cpp:174:25:174:25 | b | 20 | 2 | 3 | 25 | 25 |
56+
| test.cpp:177:24:177:25 | \\s | 21 | 0 | 2 | 24 | 25 |
57+
| test.cpp:177:24:177:26 | \\s+ | 21 | 0 | 3 | 24 | 26 |
58+
| test.cpp:177:24:177:27 | \\s+$ | 21 | 0 | 4 | 24 | 27 |
59+
| test.cpp:177:27:177:27 | $ | 21 | 3 | 4 | 27 | 27 |
60+
| test.cpp:180:24:180:25 | \\( | 21 | 0 | 2 | 24 | 25 |
61+
| test.cpp:180:24:180:37 | \\(([,\\w]+)+\\)$ | 21 | 0 | 14 | 24 | 37 |
62+
| test.cpp:180:26:180:33 | ([,\\w]+) | 21 | 2 | 10 | 26 | 33 |
63+
| test.cpp:180:26:180:34 | ([,\\w]+)+ | 21 | 2 | 11 | 26 | 34 |
64+
| test.cpp:180:27:180:31 | [,\\w] | 21 | 3 | 8 | 27 | 31 |
65+
| test.cpp:180:27:180:32 | [,\\w]+ | 21 | 3 | 9 | 27 | 32 |
66+
| test.cpp:180:28:180:28 | , | 21 | 4 | 5 | 28 | 28 |
67+
| test.cpp:180:29:180:30 | \\w | 21 | 5 | 7 | 29 | 30 |
68+
| test.cpp:180:35:180:36 | \\) | 21 | 11 | 13 | 35 | 36 |
69+
| test.cpp:180:37:180:37 | $ | 21 | 13 | 14 | 37 | 37 |
70+
| test.cpp:183:25:183:25 | a | 21 | 0 | 1 | 25 | 25 |
71+
| test.cpp:183:25:183:26 | a+ | 21 | 0 | 2 | 25 | 26 |
72+
| test.cpp:183:25:183:27 | a+b | 21 | 0 | 3 | 25 | 27 |
73+
| test.cpp:183:27:183:27 | b | 21 | 2 | 3 | 27 | 27 |
74+
| test.cpp:186:24:186:24 | a | 22 | 0 | 1 | 24 | 24 |
75+
| test.cpp:186:24:186:25 | a+ | 22 | 0 | 2 | 24 | 25 |
76+
| test.cpp:186:24:186:26 | a+b | 22 | 0 | 3 | 24 | 26 |
77+
| test.cpp:186:26:186:26 | b | 22 | 2 | 3 | 26 | 26 |
78+
| test.cpp:189:30:189:30 | a | 26 | 0 | 1 | 30 | 30 |
79+
| test.cpp:189:30:189:31 | a+ | 26 | 0 | 2 | 30 | 31 |
80+
| test.cpp:189:30:189:32 | a+b | 26 | 0 | 3 | 30 | 32 |
81+
| test.cpp:189:32:189:32 | b | 26 | 2 | 3 | 32 | 32 |
82+
| test.cpp:193:22:193:23 | \\s | 21 | 0 | 2 | 22 | 23 |
83+
| test.cpp:193:22:193:24 | \\s+ | 21 | 0 | 3 | 22 | 24 |
84+
| test.cpp:196:22:196:22 | a | 21 | 0 | 1 | 22 | 22 |
85+
| test.cpp:196:22:196:25 | a\\.b | 21 | 0 | 4 | 22 | 25 |
86+
| test.cpp:196:23:196:24 | \\. | 21 | 1 | 3 | 23 | 24 |
87+
| test.cpp:196:25:196:25 | b | 21 | 3 | 4 | 25 | 25 |

0 commit comments

Comments
 (0)