Ready for review: new std.uni
Dmitry Olshansky
dmitry.olsh at gmail.com
Wed Jan 16 02:59:32 PST 2013
16-Jan-2013 06:37, Martin Nowak пишет:
> On 01/11/2013 08:31 PM, Dmitry Olshansky wrote:
>> There is an extra candy for meta-programming text processing libraries:
>> a set type can generate source code of unrolled hard-coded binary search
>> for a given set of codepoints.
>
> Great, I already had to do that myself for a DFA Lexer.
>
The only thing left that I'd love to improve is to integrate UTF
awareness (for no-decoding processing) into it so that it becomes:
auto set = ...
...
set.toSourceCode("func", Encoding.UTF8);
and prototype of generated function
is something along the lines of:
size_t func(char[] src);
or:
size_t func(char[] src, size_t offset);
that returns number of matched code units and 0 on failure.
--
Dmitry Olshansky
More information about the Digitalmars-d
mailing list