Use SIMD to accelerate comment lexing

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 4 11:39:04 PDT 2015


On 6/3/2015 7:05 PM, deadalnix wrote:
> On Wednesday, 3 June 2015 at 22:50:52 UTC, Walter Bright wrote:
>> On 6/2/2015 5:45 PM, deadalnix wrote:
>>> You go though character and look for a '/'. When you hit one, you check if the
>>> character before it is a *, and if so, you have the end of the comment. There is
>>> obviously various edges cases to take into account, but that is the general
>>> idea.
>> Line numbers have to be kept track of as well.
>
> They retrieve line number lazily when needed, with various mechanism to speedup
> the lookup.

Hmm. There's no way to get the line number without counting LFs, and that means 
searching for them.


More information about the Digitalmars-d mailing list