From: Hotbox <un...@rb...> - 2003-09-25 15:15:06
|
> Yes. Back when __OUTPUT_FORMAT__ support was added, I explicitly > asked for its value to be unquoted, because the user can always > surround it with a pair of single or double quotes (by using the > preprocessor's support for unterminated string constants) while > it would be impossible to remove the quotes from a string value. Unquoted macro value is unsafe for it always can be expanded. Querying anything as string is quite safely. Also, I insist that using unterminated string for string creation is a very ugly syntax. I assume, it's a bug. And, of course, such syntax should not be recommended. I've introduced a set of 'native' functions in my version of Nasm preprocessor. These functions provide almost complete API for string and list processing. I can move them into the current Nasm preprocessor. These functions are (the last revision): %strtok(<str>): <list> %detok(<list>): <str> %split(<str>, [<str>=" \t\r\n"]): <list> %join(<list>, [<str>=""]): <str> %strlen(<str>): <num> %listlen(<list>): <num> %substr(<str>, <expr>, [<expr>=1]): <str> %sublist(<list>, <expr>, [<expr>=1]): <list> %strrev(<str>): <str> %listrev(<str>): <str> %strpos(<str>, <str>, [<expr>=1]): <num> %listpos(<list>, <list>, [<expr>=1]): <num> %trim(<str>, [<str>=" \t\r\n"]): <str> %upper(<list>): <list> %lower(<list>): <list> %charcat(<list>): <str> Tell me, if you have some questions or remarks about function naming or functionality. -- Best regards, Nickolay Yurchenko mailto:un...@rb... |