| OLD | NEW |
| 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 does_determine_newline(false), | 460 does_determine_newline(false), |
| 461 does_determine_start(false), | 461 does_determine_start(false), |
| 462 follows_word_interest(false), | 462 follows_word_interest(false), |
| 463 follows_newline_interest(false), | 463 follows_newline_interest(false), |
| 464 follows_start_interest(false), | 464 follows_start_interest(false), |
| 465 is_word(UNKNOWN), | 465 is_word(UNKNOWN), |
| 466 is_newline(UNKNOWN), | 466 is_newline(UNKNOWN), |
| 467 at_end(false), | 467 at_end(false), |
| 468 follows_word(UNKNOWN), | 468 follows_word(UNKNOWN), |
| 469 follows_newline(UNKNOWN), | 469 follows_newline(UNKNOWN), |
| 470 follows_start(UNKNOWN) { } | 470 follows_start(UNKNOWN), |
| 471 visited(false) { } |
| 471 | 472 |
| 472 // Returns true if the interests and assumptions of this node | 473 // Returns true if the interests and assumptions of this node |
| 473 // matches the given one. | 474 // matches the given one. |
| 474 bool Matches(NodeInfo* that) { | 475 bool Matches(NodeInfo* that) { |
| 475 return (at_end == that->at_end) && | 476 return (at_end == that->at_end) && |
| 476 (follows_word_interest == that->follows_word_interest) && | 477 (follows_word_interest == that->follows_word_interest) && |
| 477 (follows_newline_interest == that->follows_newline_interest) && | 478 (follows_newline_interest == that->follows_newline_interest) && |
| 478 (follows_start_interest == that->follows_start_interest) && | 479 (follows_start_interest == that->follows_start_interest) && |
| 479 (follows_word == that->follows_word) && | 480 (follows_word == that->follows_word) && |
| 480 (follows_newline == that->follows_newline) && | 481 (follows_newline == that->follows_newline) && |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 TriBool is_word: 2; | 560 TriBool is_word: 2; |
| 560 TriBool is_newline: 2; | 561 TriBool is_newline: 2; |
| 561 | 562 |
| 562 bool at_end: 1; | 563 bool at_end: 1; |
| 563 | 564 |
| 564 // These bits are set if the node can make assumptions about what | 565 // These bits are set if the node can make assumptions about what |
| 565 // the previous character was. | 566 // the previous character was. |
| 566 TriBool follows_word: 2; | 567 TriBool follows_word: 2; |
| 567 TriBool follows_newline: 2; | 568 TriBool follows_newline: 2; |
| 568 TriBool follows_start: 2; | 569 TriBool follows_start: 2; |
| 570 |
| 571 bool visited: 1; |
| 569 }; | 572 }; |
| 570 | 573 |
| 571 | 574 |
| 572 class ExpansionGuard { | 575 class ExpansionGuard { |
| 573 public: | 576 public: |
| 574 explicit inline ExpansionGuard(NodeInfo* info) : info_(info) { | 577 explicit inline ExpansionGuard(NodeInfo* info) : info_(info) { |
| 575 ASSERT(!info->being_expanded); | 578 ASSERT(!info->being_expanded); |
| 576 info->being_expanded = true; | 579 info->being_expanded = true; |
| 577 } | 580 } |
| 578 inline ~ExpansionGuard() { | 581 inline ~ExpansionGuard() { |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 RegExpNode** node_return, | 957 RegExpNode** node_return, |
| 955 bool ignore_case, | 958 bool ignore_case, |
| 956 bool multiline); | 959 bool multiline); |
| 957 static void DotPrint(const char* label, RegExpNode* node, bool ignore_case); | 960 static void DotPrint(const char* label, RegExpNode* node, bool ignore_case); |
| 958 }; | 961 }; |
| 959 | 962 |
| 960 | 963 |
| 961 } } // namespace v8::internal | 964 } } // namespace v8::internal |
| 962 | 965 |
| 963 #endif // V8_JSREGEXP_H_ | 966 #endif // V8_JSREGEXP_H_ |
| OLD | NEW |