On Tue, Feb 12, 2013 at 6:32 PM, Zack Weinberg <za...@panix.com> wrote:
> You want to do this as lazily as possible, since with high probability no > human will ever look at any given CSS error message. However, I would > still go for the "add source location information to every token" approach > in a greenfields design. It should be possible to make it be two machine > words per token: a pointer into the text of the entire style sheet, and a > line number. That's not bad compared to the data that already has to be > carried around for every token. > Couldn't you just make it a pointer into the text of the style sheet? Then an auxiliary data structure could be used to quickly extract a line number given such a pointer. (E.g. for each 256 byte boundary in the style sheet, store the line number at that boundary.) Rob -- Wrfhf pnyyrq gurz gbtrgure naq fnvq, “Lbh xabj gung gur ehyref bs gur Tragvyrf ybeq vg bire gurz, naq gurve uvtu bssvpvnyf rkrepvfr nhgubevgl bire gurz. Abg fb jvgu lbh. Vafgrnq, jubrire jnagf gb orpbzr terng nzbat lbh zhfg or lbhe freinag, naq jubrire jnagf gb or svefg zhfg or lbhe fynir — whfg nf gur Fba bs Zna qvq abg pbzr gb or freirq, ohg gb freir, naq gb tvir uvf yvsr nf n enafbz sbe znal.” [Znggurj 20:25-28] _______________________________________________ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo