[Repo Assist] improve: add l_isblank, l_iscntrl, l_isgraph, l_ispunct, l_isascii#163
Draft
github-actions[bot] wants to merge 1 commit into
Draft
Conversation
Complete the ctype-equivalent function set. Five standard character classification functions were missing from l_os.h: l_isblank - blank characters (space and tab) l_iscntrl - control characters (0x00-0x1F and 0x7F) l_isgraph - printable non-space characters (0x21-0x7E) l_ispunct - printable non-space non-alphanumeric characters l_isascii - 7-bit ASCII characters (0x00-0x7F) Without L_DONTOVERRIDE each is also macro-aliased to its standard name (isblank, iscntrl, isgraph, ispunct, isascii). l_isblank, l_iscntrl, l_isgraph, l_isascii are implemented as one-liners early in the file alongside l_isprint/l_isxdigit. l_ispunct is placed after l_isalnum (on which it depends). Tests added in tests/test_strings.c::test_ctype_extended(). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Adds five missing
<ctype.h>-equivalent functions tol_os.h, completing the character classification API:l_isblank(c)cis space or tabl_iscntrl(c)cis a control character (0x00–0x1F or 0x7F)l_isgraph(c)cis a printable non-space character (0x21–0x7E)l_ispunct(c)cis a printable non-space non-alphanumeric characterl_isascii(c)cis a 7-bit ASCII character (0x00–0x7F)Without
L_DONTOVERRIDE, each is macro-aliased to its standard name (isblank,iscntrl,isgraph,ispunct,isascii).Rationale
l_os.hcoveredisalpha,isalnum,isdigit,isspace,isupper,islower,toupper,tolower,isprint, andisxdigit— but the five functions above were missing. Any code that includes the header withoutL_DONTOVERRIDEand callsispunct,isgraph,iscntrl,isblank, orisasciiwould fail to compile (undeclared identifier). This PR closes that gap.Implementation Details
l_isblank,l_iscntrl,l_isgraph, andl_isasciiare one-liners in the early "platform-independent" block alongsidel_isprint/l_isxdigit(no dependencies on otherl_*functions).l_ispunctis placed afterl_isalnum(which it calls) to respect the top-to-bottom ordering convention.L_DONTOVERRIDE:#define isblank l_isblanketc. added to the macro-alias block.Test Status
✅ Linux gcc: 1550 assertions passed
✅ Linux clang: 1548 assertions passed
⏭️ ARM/AArch64: cross-compilers not available in this environment (SKIP)
⏭️ Windows: not available in this environment (SKIP)
New test function
test_ctype_extended()intests/test_strings.ccovers all five functions with boundary and edge cases.