OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4983 Reset(start); | 4983 Reset(start); |
4984 return false; | 4984 return false; |
4985 } | 4985 } |
4986 *min_out = min; | 4986 *min_out = min; |
4987 *max_out = max; | 4987 *max_out = max; |
4988 return true; | 4988 return true; |
4989 } | 4989 } |
4990 | 4990 |
4991 | 4991 |
4992 uc32 RegExpParser::ParseOctalLiteral() { | 4992 uc32 RegExpParser::ParseOctalLiteral() { |
4993 ASSERT('0' <= current() && current() <= '7'); | 4993 ASSERT(('0' <= current() && current() <= '7') || current() == kEndMarker); |
4994 // For compatibility with some other browsers (not all), we parse | 4994 // For compatibility with some other browsers (not all), we parse |
4995 // up to three octal digits with a value below 256. | 4995 // up to three octal digits with a value below 256. |
4996 uc32 value = current() - '0'; | 4996 uc32 value = current() - '0'; |
4997 Advance(); | 4997 Advance(); |
4998 if ('0' <= current() && current() <= '7') { | 4998 if ('0' <= current() && current() <= '7') { |
4999 value = value * 8 + current() - '0'; | 4999 value = value * 8 + current() - '0'; |
5000 Advance(); | 5000 Advance(); |
5001 if (value < 32 && '0' <= current() && current() <= '7') { | 5001 if (value < 32 && '0' <= current() && current() <= '7') { |
5002 value = value * 8 + current() - '0'; | 5002 value = value * 8 + current() - '0'; |
5003 Advance(); | 5003 Advance(); |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5349 ASSERT(info()->isolate()->has_pending_exception()); | 5349 ASSERT(info()->isolate()->has_pending_exception()); |
5350 } else { | 5350 } else { |
5351 result = ParseProgram(); | 5351 result = ParseProgram(); |
5352 } | 5352 } |
5353 } | 5353 } |
5354 info()->SetFunction(result); | 5354 info()->SetFunction(result); |
5355 return (result != NULL); | 5355 return (result != NULL); |
5356 } | 5356 } |
5357 | 5357 |
5358 } } // namespace v8::internal | 5358 } } // namespace v8::internal |
OLD | NEW |