Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1125)

Side by Side Diff: src/ast.h

Issue 18744: * Irregexp: Handle backtrack past look-ahead. (Closed)
Patch Set: Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/jsregexp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 static int EndRegister(int index) { return index * 2 + 1; } 1514 static int EndRegister(int index) { return index * 2 + 1; }
1515 private: 1515 private:
1516 RegExpTree* body_; 1516 RegExpTree* body_;
1517 int index_; 1517 int index_;
1518 CaptureAvailability available_; 1518 CaptureAvailability available_;
1519 }; 1519 };
1520 1520
1521 1521
1522 class RegExpLookahead: public RegExpTree { 1522 class RegExpLookahead: public RegExpTree {
1523 public: 1523 public:
1524 RegExpLookahead(RegExpTree* body, bool is_positive) 1524 RegExpLookahead(RegExpTree* body,
1525 bool is_positive,
1526 int capture_count,
1527 int capture_from)
1525 : body_(body), 1528 : body_(body),
1526 is_positive_(is_positive) { } 1529 is_positive_(is_positive),
1530 capture_count_(capture_count),
1531 capture_from_(capture_from) { }
1532
1527 virtual void* Accept(RegExpVisitor* visitor, void* data); 1533 virtual void* Accept(RegExpVisitor* visitor, void* data);
1528 virtual RegExpNode* ToNode(RegExpCompiler* compiler, 1534 virtual RegExpNode* ToNode(RegExpCompiler* compiler,
1529 RegExpNode* on_success); 1535 RegExpNode* on_success);
1530 virtual RegExpLookahead* AsLookahead(); 1536 virtual RegExpLookahead* AsLookahead();
1531 virtual Interval CaptureRegisters(); 1537 virtual Interval CaptureRegisters();
1532 virtual bool IsLookahead(); 1538 virtual bool IsLookahead();
1533 virtual bool IsAnchored(); 1539 virtual bool IsAnchored();
1534 virtual int min_match() { return 0; } 1540 virtual int min_match() { return 0; }
1535 virtual int max_match() { return 0; } 1541 virtual int max_match() { return 0; }
1536 RegExpTree* body() { return body_; } 1542 RegExpTree* body() { return body_; }
1537 bool is_positive() { return is_positive_; } 1543 bool is_positive() { return is_positive_; }
1544 int capture_count() { return capture_count_; }
1545 int capture_from() { return capture_from_; }
1538 private: 1546 private:
1539 RegExpTree* body_; 1547 RegExpTree* body_;
1540 bool is_positive_; 1548 bool is_positive_;
1549 int capture_count_;
1550 int capture_from_;
1541 }; 1551 };
1542 1552
1543 1553
1544 class RegExpBackReference: public RegExpTree { 1554 class RegExpBackReference: public RegExpTree {
1545 public: 1555 public:
1546 explicit RegExpBackReference(RegExpCapture* capture) 1556 explicit RegExpBackReference(RegExpCapture* capture)
1547 : capture_(capture) { } 1557 : capture_(capture) { }
1548 virtual void* Accept(RegExpVisitor* visitor, void* data); 1558 virtual void* Accept(RegExpVisitor* visitor, void* data);
1549 virtual RegExpNode* ToNode(RegExpCompiler* compiler, 1559 virtual RegExpNode* ToNode(RegExpCompiler* compiler,
1550 RegExpNode* on_success); 1560 RegExpNode* on_success);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1613 #undef DEF_VISIT 1623 #undef DEF_VISIT
1614 1624
1615 private: 1625 private:
1616 bool stack_overflow_; 1626 bool stack_overflow_;
1617 }; 1627 };
1618 1628
1619 1629
1620 } } // namespace v8::internal 1630 } } // namespace v8::internal
1621 1631
1622 #endif // V8_AST_H_ 1632 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/jsregexp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698