Chromium Code Reviews| Index: src/jsregexp.h |
| diff --git a/src/jsregexp.h b/src/jsregexp.h |
| index 18bd19b44c456ad72ce8f7c54c2a309a965eddc5..1b13b43fec365cb24d1d8bf8d79c16c64346eb05 100644 |
| --- a/src/jsregexp.h |
| +++ b/src/jsregexp.h |
| @@ -1310,7 +1310,7 @@ FOR_EACH_NODE_TYPE(DECLARE_VISIT) |
| class Analysis: public NodeVisitor { |
| public: |
| explicit Analysis(bool ignore_case) |
| - : ignore_case_(ignore_case) { } |
| + : ignore_case_(ignore_case), error_message_(NULL) { } |
| void EnsureAnalyzed(RegExpNode* node); |
| #define DECLARE_VISIT(Type) \ |
| @@ -1319,8 +1319,17 @@ FOR_EACH_NODE_TYPE(DECLARE_VISIT) |
| #undef DECLARE_VISIT |
| virtual void VisitLoopChoice(LoopChoiceNode* that); |
| + bool failed() { return error_message_ != NULL; } |
|
Christian Plesner Hansen
2009/05/27 10:04:48
Since this is a boolean predicate it should be 'ha
|
| + const char* error_message() { |
| + ASSERT(error_message_ != NULL); |
| + return error_message_; |
| + } |
| + void fail(const char* error_message) { |
| + error_message_ = error_message; |
| + } |
| private: |
| bool ignore_case_; |
| + const char* error_message_; |
| DISALLOW_IMPLICIT_CONSTRUCTORS(Analysis); |
| }; |