Dervall / Piglet

An easier to use parsing and lexing tool that is configurable in fluent code without a pre-build step.
binarysculpting.com
MIT License
91 stars 11 forks source link

Use a faster search for finding the correct char range #49

Closed Dervall closed 11 years ago

Dervall commented 11 years ago

There's a piece of code in tabular lexer which searches the list of ranges in a linear fashion to find the correct range to put a char in. This is stupid since the ranges are already sorted and we should be able to do a binary search to find the correct range to put the char in.

This should also go for the NFA and DFA lexers, and should improve the runtime speed of the lexing and thus the entire parser.