Commit 2287060
committed
ParseXS: make most ENABLE keywords stricter
These four keywords are supposed to have only ENABLE or DISABLE
as their value:
EXPORT_XSUB_SYMBOLS:
SCOPE:
VERSIONCHECK:
PROTOTYPES:
It turns out that the XS parser is very lax and allows all sorts of
rubbish as the keyword's value. For example all these are valid, and
the first of them was originally interpreted as *DISABLE*, due to
case-insensitive validation, but case-sensitive value interpretation:
KEYWORD: Enable
KEYWORD: ENABLE;
KEYWORD: ENABLE # comment
KEYWORD: ENABLE the quick brown fox
An earlier commit in this branch, in the course of refactoring, silently
made the value matching to be case insensitive for *all* keywords
(originally it was only CI for SCOPE).
So originally,
PROTOTYPES: Enable
actually disabled prototypes; now it enables them. This commit and the
next will restore the original behaviour and/or make things stricter.
This commit makes all such keywords stricter, apart from PROTOTYPES,
which is much more widely used (often incorrectly) and will require more
careful backwards-compatibility handling. It's behaviour is left
untouched by this commit; the next commit will update it.
For the first three keywords, this commit makes the only acceptable
values to match be /^(ENABLE|DISABLE)\s*$/.1 parent e2cc3db commit 2287060
File tree
2 files changed
+79
-22
lines changed- dist/ExtUtils-ParseXS
- lib/ExtUtils/ParseXS
- t
2 files changed
+79
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3422 | 3422 | | |
3423 | 3423 | | |
3424 | 3424 | | |
3425 | | - | |
3426 | | - | |
3427 | | - | |
3428 | | - | |
3429 | | - | |
3430 | | - | |
| 3425 | + | |
| 3426 | + | |
| 3427 | + | |
| 3428 | + | |
| 3429 | + | |
| 3430 | + | |
| 3431 | + | |
| 3432 | + | |
| 3433 | + | |
| 3434 | + | |
| 3435 | + | |
| 3436 | + | |
| 3437 | + | |
| 3438 | + | |
| 3439 | + | |
| 3440 | + | |
| 3441 | + | |
3431 | 3442 | | |
3432 | | - | |
| 3443 | + | |
3433 | 3444 | | |
3434 | 3445 | | |
3435 | 3446 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4279 | 4279 | | |
4280 | 4280 | | |
4281 | 4281 | | |
4282 | | - | |
| 4282 | + | |
4283 | 4283 | | |
4284 | 4284 | | |
4285 | 4285 | | |
4286 | 4286 | | |
4287 | 4287 | | |
4288 | 4288 | | |
4289 | | - | |
| 4289 | + | |
4290 | 4290 | | |
4291 | | - | |
| 4291 | + | |
4292 | 4292 | | |
4293 | | - | |
| 4293 | + | |
| 4294 | + | |
| 4295 | + | |
| 4296 | + | |
| 4297 | + | |
| 4298 | + | |
| 4299 | + | |
| 4300 | + | |
| 4301 | + | |
| 4302 | + | |
| 4303 | + | |
| 4304 | + | |
| 4305 | + | |
| 4306 | + | |
| 4307 | + | |
4294 | 4308 | | |
4295 | 4309 | | |
4296 | 4310 | | |
| |||
4316 | 4330 | | |
4317 | 4331 | | |
4318 | 4332 | | |
4319 | | - | |
| 4333 | + | |
4320 | 4334 | | |
4321 | 4335 | | |
4322 | 4336 | | |
4323 | | - | |
| 4337 | + | |
| 4338 | + | |
| 4339 | + | |
| 4340 | + | |
| 4341 | + | |
| 4342 | + | |
| 4343 | + | |
| 4344 | + | |
4324 | 4345 | | |
4325 | 4346 | | |
4326 | 4347 | | |
4327 | | - | |
| 4348 | + | |
4328 | 4349 | | |
4329 | 4350 | | |
4330 | 4351 | | |
4331 | 4352 | | |
| 4353 | + | |
| 4354 | + | |
| 4355 | + | |
| 4356 | + | |
| 4357 | + | |
| 4358 | + | |
| 4359 | + | |
| 4360 | + | |
| 4361 | + | |
4332 | 4362 | | |
4333 | 4363 | | |
4334 | 4364 | | |
| |||
4358 | 4388 | | |
4359 | 4389 | | |
4360 | 4390 | | |
4361 | | - | |
| 4391 | + | |
4362 | 4392 | | |
4363 | 4393 | | |
4364 | 4394 | | |
4365 | 4395 | | |
4366 | 4396 | | |
4367 | | - | |
4368 | | - | |
| 4397 | + | |
4369 | 4398 | | |
4370 | 4399 | | |
4371 | | - | |
| 4400 | + | |
4372 | 4401 | | |
4373 | 4402 | | |
4374 | 4403 | | |
4375 | 4404 | | |
4376 | 4405 | | |
4377 | | - | |
4378 | | - | |
| 4406 | + | |
| 4407 | + | |
| 4408 | + | |
| 4409 | + | |
| 4410 | + | |
| 4411 | + | |
| 4412 | + | |
| 4413 | + | |
| 4414 | + | |
| 4415 | + | |
| 4416 | + | |
| 4417 | + | |
| 4418 | + | |
| 4419 | + | |
| 4420 | + | |
| 4421 | + | |
| 4422 | + | |
| 4423 | + | |
| 4424 | + | |
4379 | 4425 | | |
4380 | 4426 | | |
4381 | 4427 | | |
4382 | 4428 | | |
4383 | 4429 | | |
4384 | | - | |
| 4430 | + | |
4385 | 4431 | | |
4386 | 4432 | | |
4387 | 4433 | | |
| |||
4395 | 4441 | | |
4396 | 4442 | | |
4397 | 4443 | | |
4398 | | - | |
| 4444 | + | |
4399 | 4445 | | |
4400 | 4446 | | |
4401 | 4447 | | |
| |||
0 commit comments