[webkit-reviews] review granted: [Bug 206988] Quantifiers after lookahead assertions should be syntax errors in Unicode patterns only : [Attachment 389312] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 31 09:05:45 PST 2020


Darin Adler <darin at apple.com> has granted Alexey Shvayka
<shvaikalesh at gmail.com>'s request for review:
Bug 206988: Quantifiers after lookahead assertions should be syntax errors in
Unicode patterns only
https://bugs.webkit.org/show_bug.cgi?id=206988

Attachment 389312: Patch

https://bugs.webkit.org/attachment.cgi?id=389312&action=review




--- Comment #3 from Darin Adler <darin at apple.com> ---
Comment on attachment 389312
  --> https://bugs.webkit.org/attachment.cgi?id=389312
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=389312&action=review

> Source/JavaScriptCore/yarr/YarrParser.h:709
> +	   auto parensType = m_parenthesesStack.takeLast();
> +	   return parensType == ParenthesesType::Subpattern || !m_isUnicode;

In WebKit coding style we normally don’t abbreviate a word like parentheses
even in a local variable name. I think calling this just "type" is fine.

> Source/JavaScriptCore/yarr/YarrParser.h:1124
> +    enum ParenthesesType { Subpattern, Assertion };

Might get a slightly more efficient code if this was an enum class based on
bool or uint8_t.

> Source/JavaScriptCore/yarr/YarrParser.h:1133
> +    Vector<ParenthesesType, 16> m_parenthesesStack;

Thisis likely going to be a bit inefficient; we could possibly get a more
efficient implementation of a bit vector.


More information about the webkit-reviews mailing list