// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#define _HAS_EXCEPTIONS 0
-#include <set>
-
#include "v8.h"
#include "ast.h"
bool ignore_case_;
HeapStringAllocator alloc_;
StringStream stream_;
- std::set<RegExpNode*> seen_;
};
void DotPrinter::Visit(RegExpNode* node) {
- if (seen_.find(node) != seen_.end())
- return;
- seen_.insert(node);
+ if (node->info()->visited) return;
+ node->info()->visited = true;
node->Accept(this);
}
at_end(false),
follows_word(UNKNOWN),
follows_newline(UNKNOWN),
- follows_start(UNKNOWN) { }
+ follows_start(UNKNOWN),
+ visited(false) { }
// Returns true if the interests and assumptions of this node
// matches the given one.
TriBool follows_word: 2;
TriBool follows_newline: 2;
TriBool follows_start: 2;
+
+ bool visited: 1;
};
len = 256;
for (int i = 0; i < len; i++) {
uc32 c = str->Get(shape, i);
- if (c < 32 || (c > 126 && c <= 255)) {
- fprintf(logfile_, "\\x%02x", c);
- } else if (c > 255) {
+ if (c > 0xff) {
fprintf(logfile_, "\\u%04x", c);
+ } else if (c < 32 || c > 126) {
+ fprintf(logfile_, "\\x%02x", c);
} else if (c == ',') {
fprintf(logfile_, "\\,");
+ } else if (c == '\\') {
+ fprintf(logfile_, "\\\\");
} else {
fprintf(logfile_, "%lc", c);
}