diff options
author | dgp <dgp@users.sourceforge.net> | 2020-04-09 17:30:06 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2020-04-09 17:30:06 (GMT) |
commit | e2b3b1edf02e0c1ab06cfe784d6a7bd76e8050d8 (patch) | |
tree | 18f2f6548b58be30c2a8ec13c42375ddb5802e94 /generic/tclInt.h | |
parent | 77dbe8dc087788e733edf13dedd31202b18fded4 (diff) | |
download | tcl-e2b3b1edf02e0c1ab06cfe784d6a7bd76e8050d8.zip tcl-e2b3b1edf02e0c1ab06cfe784d6a7bd76e8050d8.tar.gz tcl-e2b3b1edf02e0c1ab06cfe784d6a7bd76e8050d8.tar.bz2 |
Guarantee TclNeedSpace and TclFindElement have common definition of whitespace
by having both call the same routine. Create a macro form to contain
performance costs and adapt callers.
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index 06cff60..15bc000 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2608,7 +2608,6 @@ MODULE_SCOPE void TclInitNotifier(void); MODULE_SCOPE void TclInitObjSubsystem(void); MODULE_SCOPE void TclInitSubsystems(void); MODULE_SCOPE int TclInterpReady(Tcl_Interp *interp); -MODULE_SCOPE int TclIsSpaceProc(char byte); MODULE_SCOPE int TclIsBareword(char byte); MODULE_SCOPE int TclJoinThread(Tcl_ThreadId id, int *result); MODULE_SCOPE void TclLimitRemoveAllHandlers(Tcl_Interp *interp); @@ -2800,6 +2799,16 @@ MODULE_SCOPE Tcl_Obj * TclDisassembleByteCodeObj(Tcl_Obj *objPtr); MODULE_SCOPE int TclUtfCasecmp(CONST char *cs, CONST char *ct); /* + * Many parsing tasks need a common definition of whitespace. + * Use this routine and macro to achieve that and place + * optimization (fragile on changes) in one place. + */ + +MODULE_SCOPE int TclIsSpaceProc(char byte); +# define TclIsSpaceProcM(byte) \ + (((byte) > 0x20) ? 0 : TclIsSpaceProc(byte)) + +/* *---------------------------------------------------------------- * Command procedures in the generic core: *---------------------------------------------------------------- |