Noir::JSRouteExtractor::ByteOffsets
JSLexer route positions are CHAR indices, but every String op keyed
by a char index ([], index(str, offset), MatchData#begin) walks
from byte 0 once a file holds one non-ASCII char, and
index(String, offset) does so even on ASCII. Done per route that was
quadratic in the route count. Convert each position once here and work
in bytes, so per-route cost stays proportional to the route's own text.
Constructors
Instance methods
content
Source