| 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 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 namespace v8 { | 41 namespace v8 { |
| 42 namespace internal { | 42 namespace internal { |
| 43 | 43 |
| 44 | 44 |
| 45 // General collection of bit-flags that can be passed to scanners and | 45 // General collection of bit-flags that can be passed to scanners and |
| 46 // parsers to signify their (initial) mode of operation. | 46 // parsers to signify their (initial) mode of operation. |
| 47 enum ParsingFlags { | 47 enum ParsingFlags { |
| 48 kNoParsingFlags = 0, | 48 kNoParsingFlags = 0, |
| 49 kAllowLazy = 1, | 49 kAllowLazy = 1, |
| 50 kAllowNativesSyntax = 2, | 50 kAllowNativesSyntax = 2 |
| 51 kHarmonyScoping = 4 | |
| 52 }; | 51 }; |
| 53 | 52 |
| 54 | 53 |
| 55 // Returns the value (0 .. 15) of a hexadecimal character c. | 54 // Returns the value (0 .. 15) of a hexadecimal character c. |
| 56 // If c is not a legal hexadecimal character, returns a value < 0. | 55 // If c is not a legal hexadecimal character, returns a value < 0. |
| 57 inline int HexValue(uc32 c) { | 56 inline int HexValue(uc32 c) { |
| 58 c -= '0'; | 57 c -= '0'; |
| 59 if (static_cast<unsigned>(c) <= 9) return c; | 58 if (static_cast<unsigned>(c) <= 9) return c; |
| 60 c = (c | 0x20) - ('a' - '0'); // detect 0x11..0x16 and 0x31..0x36. | 59 c = (c | 0x20) - ('a' - '0'); // detect 0x11..0x16 and 0x31..0x36. |
| 61 if (static_cast<unsigned>(c) <= 5) return c + 10; | 60 if (static_cast<unsigned>(c) <= 5) return c + 10; |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 // line-terminator after the current token, and before the next. | 544 // line-terminator after the current token, and before the next. |
| 546 bool has_multiline_comment_before_next_; | 545 bool has_multiline_comment_before_next_; |
| 547 // Whether we scan 'let' as a keyword for harmony block scoped | 546 // Whether we scan 'let' as a keyword for harmony block scoped |
| 548 // let bindings. | 547 // let bindings. |
| 549 bool harmony_scoping_; | 548 bool harmony_scoping_; |
| 550 }; | 549 }; |
| 551 | 550 |
| 552 } } // namespace v8::internal | 551 } } // namespace v8::internal |
| 553 | 552 |
| 554 #endif // V8_SCANNER_H_ | 553 #endif // V8_SCANNER_H_ |
| OLD | NEW |