|
1 | | -from mypyc.ir.deps import ( |
2 | | - BYTES_WRITER_EXTRA_OPS, |
3 | | - CODEPOINT_EXTRA_OPS, |
4 | | - LIBRT_STRINGS, |
5 | | - STRING_WRITER_EXTRA_OPS, |
6 | | -) |
| 1 | +from mypyc.ir.deps import BYTES_WRITER_EXTRA_OPS, LIBRT_STRINGS, STRING_WRITER_EXTRA_OPS |
7 | 2 | from mypyc.ir.ops import ERR_MAGIC, ERR_MAGIC_OVERLAPPING, ERR_NEVER |
8 | 3 | from mypyc.ir.rtypes import ( |
9 | 4 | bool_rprimitive, |
|
402 | 397 | return_type=bool_rprimitive, |
403 | 398 | c_function_name="LibRTStrings_IsSpace", |
404 | 399 | error_kind=ERR_NEVER, |
405 | | - dependencies=[LIBRT_STRINGS, CODEPOINT_EXTRA_OPS], |
| 400 | + dependencies=[LIBRT_STRINGS], |
406 | 401 | ) |
407 | 402 |
|
408 | 403 | function_op( |
|
411 | 406 | return_type=bool_rprimitive, |
412 | 407 | c_function_name="LibRTStrings_IsDigit", |
413 | 408 | error_kind=ERR_NEVER, |
414 | | - dependencies=[LIBRT_STRINGS, CODEPOINT_EXTRA_OPS], |
| 409 | + dependencies=[LIBRT_STRINGS], |
415 | 410 | ) |
416 | 411 |
|
417 | 412 | function_op( |
|
420 | 415 | return_type=bool_rprimitive, |
421 | 416 | c_function_name="LibRTStrings_IsAlnum", |
422 | 417 | error_kind=ERR_NEVER, |
423 | | - dependencies=[LIBRT_STRINGS, CODEPOINT_EXTRA_OPS], |
| 418 | + dependencies=[LIBRT_STRINGS], |
424 | 419 | ) |
425 | 420 |
|
426 | 421 | function_op( |
|
429 | 424 | return_type=bool_rprimitive, |
430 | 425 | c_function_name="LibRTStrings_IsAlpha", |
431 | 426 | error_kind=ERR_NEVER, |
432 | | - dependencies=[LIBRT_STRINGS, CODEPOINT_EXTRA_OPS], |
| 427 | + dependencies=[LIBRT_STRINGS], |
| 428 | +) |
| 429 | + |
| 430 | +# isidentifier checks XID_Start semantics for a single codepoint, matching |
| 431 | +# str.isidentifier() on a 1-character string. The non-ASCII path allocates |
| 432 | +# and aborts via CPyError_OutOfMemory on failure, so this stays ERR_NEVER. |
| 433 | +function_op( |
| 434 | + name="librt.strings.isidentifier", |
| 435 | + arg_types=[int32_rprimitive], |
| 436 | + return_type=bool_rprimitive, |
| 437 | + c_function_name="LibRTStrings_IsIdentifier", |
| 438 | + error_kind=ERR_NEVER, |
| 439 | + dependencies=[LIBRT_STRINGS], |
433 | 440 | ) |
0 commit comments