Changeset 108280 in vbox for trunk/include
- Timestamp:
- Feb 19, 2025 9:28:41 AM (2 months ago)
- svn:sync-xref-src-repo-rev:
- 167622
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/script.h
r108049 r108280 98 98 /** Some punctuator. */ 99 99 RTSCRIPTLEXTOKTYPE_PUNCTUATOR, 100 /** A single line comment. */ 101 RTSCRIPTLEXTOKTYPE_COMMENT_SINGLE_LINE, 102 /** A multi line comment. */ 103 RTSCRIPTLEXTOKTYPE_COMMENT_MULTI_LINE, 100 104 /** Special error token, conveying an error message from the lexer. */ 101 105 RTSCRIPTLEXTOKTYPE_ERROR, … … 212 216 PCRTSCRIPTLEXTOKMATCH pPunctuator; 213 217 } Punctuator; 218 /** Comment */ 219 struct 220 { 221 /** Pointer to the start of the comment (including the symbols starting the comment). */ 222 const char *pszComment; 223 /** Number of characters of the comment, including the null terminator. */ 224 size_t cchComment; 225 } Comment; 214 226 /** Error. */ 215 227 struct … … 316 328 * as the lexer will convert everything to uppercase internally. */ 317 329 #define RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_UPPER RT_BIT(1) 330 /** Comments are not skipped but passed back as tokens. */ 331 #define RTSCRIPT_LEX_CFG_F_COMMENTS_AS_TOKENS RT_BIT(2) 318 332 319 333 … … 369 383 * If not NULL the string cache must be freed by the caller when not used 370 384 * anymore. 385 * @param phStrCacheComments Where to store the pointer to the string cache containing all 386 * comments on success when RTSCRIPT_LEX_CFG_F_COMMENTS_AS_TOKENS 387 * is given, optional. 388 * If not NULL the string cache must be freed by the caller when not used 389 * anymore. 371 390 * @param pCfg The lexer config to use for identifying the different tokens. 372 391 */ … … 374 393 PFNRTSCRIPTLEXDTOR pfnDtor, void *pvUser, 375 394 size_t cchBuf, PRTSTRCACHE phStrCacheId, PRTSTRCACHE phStrCacheStringLit, 376 P CRTSCRIPTLEXCFG pCfg);395 PRTSTRCACHE phStrCacheComments, PCRTSCRIPTLEXCFG pCfg); 377 396 378 397 … … 391 410 * If not NULL the string cache must be freed by the caller when not used 392 411 * anymore. 412 * @param phStrCacheComments Where to store the pointer to the string cache containing all 413 * comments on success when RTSCRIPT_LEX_CFG_F_COMMENTS_AS_TOKENS 414 * is given, optional. 415 * If not NULL the string cache must be freed by the caller when not used 416 * anymore. 393 417 * @param pCfg The lexer config to use for identifying the different tokens. 394 418 */ 395 419 RTDECL(int) RTScriptLexCreateFromString(PRTSCRIPTLEX phScriptLex, const char *pszSrc, PRTSTRCACHE phStrCacheId, 396 PRTSTRCACHE phStrCacheStringLit, PCRTSCRIPTLEXCFG pCfg); 420 PRTSTRCACHE phStrCacheStringLit, PRTSTRCACHE phStrCacheComments, 421 PCRTSCRIPTLEXCFG pCfg); 397 422 398 423 … … 411 436 * If not NULL the string cache must be freed by the caller when not used 412 437 * anymore. 438 * @param phStrCacheComments Where to store the pointer to the string cache containing all 439 * comments on success when RTSCRIPT_LEX_CFG_F_COMMENTS_AS_TOKENS 440 * is given, optional. 441 * If not NULL the string cache must be freed by the caller when not used 442 * anymore. 413 443 * @param pCfg The lexer config to use for identifying the different tokens. 414 444 */ 415 445 RTDECL(int) RTScriptLexCreateFromFile(PRTSCRIPTLEX phScriptLex, const char *pszFilename, PRTSTRCACHE phStrCacheId, 416 PRTSTRCACHE phStrCacheStringLit, PCRTSCRIPTLEXCFG pCfg); 446 PRTSTRCACHE phStrCacheStringLit, PRTSTRCACHE phStrCacheComments, 447 PCRTSCRIPTLEXCFG pCfg); 417 448 418 449
Note:
See TracChangeset
for help on using the changeset viewer.