OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 12 matching lines...) Expand all Loading... | |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 // Features shared by parsing and pre-parsing scanners. | 28 // Features shared by parsing and pre-parsing scanners. |
29 | 29 |
30 #ifndef V8_SCANNER_BASE_H_ | 30 #ifndef V8_SCANNER_BASE_H_ |
31 #define V8_SCANNER_BASE_H_ | 31 #define V8_SCANNER_BASE_H_ |
32 | 32 |
33 #include "allocation.h" | |
34 #include "char-predicates.h" | |
35 #include "checks.h" | |
33 #include "globals.h" | 36 #include "globals.h" |
34 #include "checks.h" | |
35 #include "allocation.h" | |
36 #include "token.h" | 37 #include "token.h" |
37 #include "unicode-inl.h" | 38 #include "unicode-inl.h" |
38 #include "char-predicates.h" | |
39 #include "utils.h" | 39 #include "utils.h" |
40 #include "list-inl.h" | |
Kevin Millikin (Chromium)
2011/05/02 16:37:00
Only here for the benefit of utils.h.
| |
41 | 40 |
42 namespace v8 { | 41 namespace v8 { |
43 namespace internal { | 42 namespace internal { |
44 | 43 |
45 // Returns the value (0 .. 15) of a hexadecimal character c. | 44 // Returns the value (0 .. 15) of a hexadecimal character c. |
46 // If c is not a legal hexadecimal character, returns a value < 0. | 45 // If c is not a legal hexadecimal character, returns a value < 0. |
47 inline int HexValue(uc32 c) { | 46 inline int HexValue(uc32 c) { |
48 c -= '0'; | 47 c -= '0'; |
49 if (static_cast<unsigned>(c) <= 9) return c; | 48 if (static_cast<unsigned>(c) <= 9) return c; |
50 c = (c | 0x20) - ('a' - '0'); // detect 0x11..0x16 and 0x31..0x36. | 49 c = (c | 0x20) - ('a' - '0'); // detect 0x11..0x16 and 0x31..0x36. |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
654 // keyword with the current prefix). | 653 // keyword with the current prefix). |
655 const char* keyword_; | 654 const char* keyword_; |
656 int counter_; | 655 int counter_; |
657 Token::Value keyword_token_; | 656 Token::Value keyword_token_; |
658 }; | 657 }; |
659 | 658 |
660 | 659 |
661 } } // namespace v8::internal | 660 } } // namespace v8::internal |
662 | 661 |
663 #endif // V8_SCANNER_BASE_H_ | 662 #endif // V8_SCANNER_BASE_H_ |
OLD | NEW |