Bug 22673 - Added support for the assertion (?=) and inverted assertion (?!) atoms in WREC.
Summary: Added support for the assertion (?=) and inverted assertion (?!) atoms in WREC.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Geoffrey Garen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-04 23:13 PST by Geoffrey Garen
Modified: 2008-12-05 08:49 PST (History)
0 users

See Also:


Attachments
patch (8.61 KB, patch)
2008-12-04 23:14 PST, Geoffrey Garen
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Garen 2008-12-04 23:13:58 PST
Patch coming.
Comment 1 Geoffrey Garen 2008-12-04 23:14:20 PST
Created attachment 25763 [details]
patch
Comment 2 Darin Adler 2008-12-05 05:51:17 PST
Comment on attachment 25763 [details]
patch

> +    switch (type) {
> +    case Generator::Assertion: {
> +        m_generator.generateParenthesesAssertion(failures);
> +        break;
> +    }
> +    case Generator::InvertedAssertion: {
> +        m_generator.generateParenthesesInvertedAssertion(failures);
> +        break;
> +    }
> +    default: {
> +        m_error = UnsupportedParentheses;
> +        return false;
> +    }
> +    }

We normally indent cases from the switch. We normally use braces for cases only when they are needed.

> +    switch (q.type) {
> +    case Quantifier::None: {
> +        return true;
> +    }
> +    case Quantifier::Greedy: {
> +        m_error = UnsupportedParentheses;
> +        return false;
> +    }
> +    case Quantifier::NonGreedy: {
> +        m_error = UnsupportedParentheses;
> +        return false;
> +    }
> +    case Quantifier::Error: {
> +        return false;
> +    }
> +    }

Ditto.

r=me
Comment 3 Geoffrey Garen 2008-12-05 08:49:57 PST
Committed revision 39030.