[webkit-reviews] review granted: [Bug 33330] Web Inspector: Regex-based syntax highlighting is slow. : [Attachment 46065] [PATCH] Proposed change

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 7 11:56:53 PST 2010


Timothy Hatcher <timothy at hatcher.name> has granted Pavel Feldman
<pfeldman at chromium.org>'s request for review:
Bug 33330: Web Inspector: Regex-based syntax highlighting is slow.
https://bugs.webkit.org/show_bug.cgi?id=33330

Attachment 46065: [PATCH] Proposed change
https://bugs.webkit.org/attachment.cgi?id=46065&action=review

------- Additional Comments from Timothy Hatcher <timothy at hatcher.name>

> +	this._tokens = [];

Tab.


> +    this._conditions = {
> +	   DIV: 0,
> +	   NODIV: 1,
> +	   COMMENT: 2,
> +	   DSTRING: 3,
> +	   SSTRING: 4,
> +	   REGEX: 5
> +    };
> +
> +    this.case_DIV = 1000;
> +    this.case_NODIV = 1001;
> +    this.case_COMMENT = 1002;
> +    this.case_DSTRING = 1003;
> +    this.case_SSTRING = 1004;
> +    this.case_REGEX = 1005;
> +}

Can we camelcase these? I suspect not.


> +WebInspector.JavaScriptTokenizer.prototype = {
> +
> +    setLine: function(line) {

Remove extra line. Getter and setter?


> +    getCondition: function()
> +    {
> +	   return this._condition;
> +    },
> +
> +    setCondition: function(condition)
> +    {
> +	   this._condition = condition;
> +    },

Getter and setter?


> +	   while (1) {
> +	       switch (goto)
> +	       /*!re2c
> +		   re2c:define:YYCTYPE	= "var";

Why is two space indented? You should add a JS comment before this like "Start
of Autogenerated stuff.." (better wording.)


More information about the webkit-reviews mailing list