Changeset 108049 in vbox
- Timestamp:
- Feb 4, 2025 6:01:30 AM (2 weeks ago)
- svn:sync-xref-src-repo-rev:
- 167328
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/script.h
r108014 r108049 309 309 310 310 /** Default lexer config flags. */ 311 #define RTSCRIPT_LEX_CFG_F_DEFAULT 0311 #define RTSCRIPT_LEX_CFG_F_DEFAULT 0 312 312 /** Case insensitive lexing, keywords and so on must be used lowercase to match 313 313 * as the lexer will convert everything to lowercase internally. */ 314 #define RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE RT_BIT(0) 314 #define RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_LOWER RT_BIT(0) 315 /** Case insensitive lexing, keywords and so on must be used uppercase to match 316 * as the lexer will convert everything to uppercase internally. */ 317 #define RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_UPPER RT_BIT(1) 315 318 316 319 -
trunk/src/VBox/Disassembler/testcase/tstDisasmArmv8-1.cpp
r106805 r108049 127 127 "ARMv8 disassembler lexer", 128 128 /** fFlags */ 129 RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE ,129 RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_LOWER, 130 130 /** pszWhitespace */ 131 131 NULL, -
trunk/src/VBox/Runtime/common/script/scriptlex.cpp
r108028 r108049 589 589 AssertPtrReturn(pCfg, VERR_INVALID_POINTER); 590 590 591 /* Case insensitivity with internal lower or upper case conversion is mutually exclusive. */ 592 AssertReturn( (pCfg->fFlags & (RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_LOWER | RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_UPPER)) 593 != (RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_LOWER | RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_UPPER), VERR_INVALID_PARAMETER); 594 591 595 if (!cchBuf) 592 596 cchBuf = _16K; … … 853 857 } 854 858 855 if ( (pThis->pCfg->fFlags & RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE) 856 && !(fFlags & RTSCRIPT_LEX_CONV_F_NOTHING)) 857 ch = RT_C_TO_LOWER(ch); 859 if (!(fFlags & RTSCRIPT_LEX_CONV_F_NOTHING)) 860 { 861 if (pThis->pCfg->fFlags & RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_LOWER) 862 ch = RT_C_TO_LOWER(ch); 863 else if (pThis->pCfg->fFlags & RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_UPPER) 864 ch = RT_C_TO_UPPER(ch); 865 } 858 866 859 867 return ch; … … 923 931 /* Some hex prefix? */ 924 932 char chNext = RTScriptLexPeekCh(hScriptLex, 1); 925 if (chNext == 'x' )933 if (chNext == 'x' || chNext == 'X') 926 934 { 927 935 uBase = 16; … … 938 946 { 939 947 if ( (ch < '0' || ch > '9') 940 && (ch < 'a' || ch > 'f' || uBase == 10)) 948 && ( ( !(ch >= 'a' && ch <= 'f') 949 && !(ch >= 'A' && ch <= 'F')) 950 || uBase == 10)) 941 951 { 942 952 if (pTok->Type.Number.enmType == RTSCRIPTLEXTOKNUMTYPE_INTEGER) … … 955 965 Assert(uBase == 16); 956 966 u64 = (u64 << 4) + 10 + (ch - 'a'); 967 } 968 else if (ch >= 'A' && ch <= 'F') 969 { 970 Assert(uBase == 16); 971 u64 = (u64 << 4) + 10 + (ch - 'A'); 957 972 } 958 973
Note:
See TracChangeset
for help on using the changeset viewer.