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

Side by Side Diff: regexp2000/src/jsregexp.h

Issue 9110: Experimental: Fixed bug in RegExp Parser. Added feature counting in parser. (Closed)
Patch Set: Merged changes to tip of experimental branch. Created 12 years, 1 month 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 | « regexp2000/src/ast.h ('k') | regexp2000/src/jsregexp.cc » ('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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 static Handle<Object> JsrePrepare(Handle<JSRegExp> re, 66 static Handle<Object> JsrePrepare(Handle<JSRegExp> re,
67 Handle<String> pattern, 67 Handle<String> pattern,
68 JSRegExp::Flags flags); 68 JSRegExp::Flags flags);
69 69
70 // Compile the pattern using JSCRE and store the result in the 70 // Compile the pattern using JSCRE and store the result in the
71 // JSRegExp object. 71 // JSRegExp object.
72 static Handle<Object> JsreCompile(Handle<JSRegExp> re); 72 static Handle<Object> JsreCompile(Handle<JSRegExp> re);
73 73
74 static Handle<Object> AtomCompile(Handle<JSRegExp> re, 74 static Handle<Object> AtomCompile(Handle<JSRegExp> re,
75 Handle<String> pattern, 75 Handle<String> pattern,
76 JSRegExp::Flags flags); 76 JSRegExp::Flags flags,
77 Handle<String> match_pattern);
77 static Handle<Object> AtomExec(Handle<JSRegExp> regexp, 78 static Handle<Object> AtomExec(Handle<JSRegExp> regexp,
78 Handle<String> subject, 79 Handle<String> subject,
79 Handle<Object> index); 80 Handle<Object> index);
80 81
81 static Handle<Object> AtomExecGlobal(Handle<JSRegExp> regexp, 82 static Handle<Object> AtomExecGlobal(Handle<JSRegExp> regexp,
82 Handle<String> subject); 83 Handle<String> subject);
83 84
84 static Handle<Object> JsreCompile(Handle<JSRegExp> re, 85 static Handle<Object> JsreCompile(Handle<JSRegExp> re,
85 Handle<String> pattern, 86 Handle<String> pattern,
86 JSRegExp::Flags flags); 87 JSRegExp::Flags flags);
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 uc16 to_; 295 uc16 to_;
295 OutSet out_set_; 296 OutSet out_set_;
296 }; 297 };
297 class Config { 298 class Config {
298 public: 299 public:
299 typedef uc16 Key; 300 typedef uc16 Key;
300 typedef Entry Value; 301 typedef Entry Value;
301 static const uc16 kNoKey; 302 static const uc16 kNoKey;
302 static const Entry kNoValue; 303 static const Entry kNoValue;
303 static inline int Compare(uc16 a, uc16 b) { 304 static inline int Compare(uc16 a, uc16 b) {
304 if (a == b) return 0; 305 if (a == b)
305 else if (a < b) return -1; 306 return 0;
306 else return 1; 307 else if (a < b)
308 return -1;
309 else
310 return 1;
307 } 311 }
308 }; 312 };
309 void AddRange(CharacterRange range, int value); 313 void AddRange(CharacterRange range, int value);
310 OutSet Get(uc16 value); 314 OutSet Get(uc16 value);
311 private: 315 private:
312 ZoneSplayTree<Config>* tree() { return &tree_; } 316 ZoneSplayTree<Config>* tree() { return &tree_; }
313 ZoneSplayTree<Config> tree_; 317 ZoneSplayTree<Config> tree_;
314 }; 318 };
315 319
316 320
317 class RegExpEngine: public AllStatic { 321 class RegExpEngine: public AllStatic {
318 public: 322 public:
319 template <typename Char> 323 template <typename Char>
320 static RegExpNode<Char>* Compile(RegExpTree* regexp); 324 static RegExpNode<Char>* Compile(RegExpTree* regexp);
321 325
322 template <typename Char> 326 template <typename Char>
323 static bool Execute(RegExpNode<Char>* start, Vector<Char> input); 327 static bool Execute(RegExpNode<Char>* start, Vector<Char> input);
324 }; 328 };
325 329
326 330
327 } } // namespace v8::internal 331 } } // namespace v8::internal
328 332
329 #endif // V8_JSREGEXP_H_ 333 #endif // V8_JSREGEXP_H_
OLDNEW
« no previous file with comments | « regexp2000/src/ast.h ('k') | regexp2000/src/jsregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698