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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 { | 77 { |
78 i::Utf8ToUtf16CharacterStream stream(keyword, length - 1); | 78 i::Utf8ToUtf16CharacterStream stream(keyword, length - 1); |
79 i::Scanner scanner(&unicode_cache); | 79 i::Scanner scanner(&unicode_cache); |
80 scanner.Initialize(&stream); | 80 scanner.Initialize(&stream); |
81 CHECK_EQ(i::Token::IDENTIFIER, scanner.Next()); | 81 CHECK_EQ(i::Token::IDENTIFIER, scanner.Next()); |
82 CHECK_EQ(i::Token::EOS, scanner.Next()); | 82 CHECK_EQ(i::Token::EOS, scanner.Next()); |
83 } | 83 } |
84 // Adding characters will make keyword matching fail. | 84 // Adding characters will make keyword matching fail. |
85 static const char chars_to_append[] = { 'z', '0', '_' }; | 85 static const char chars_to_append[] = { 'z', '0', '_' }; |
86 for (int j = 0; j < static_cast<int>(ARRAY_SIZE(chars_to_append)); ++j) { | 86 for (int j = 0; j < static_cast<int>(ARRAY_SIZE(chars_to_append)); ++j) { |
87 i::MemMove(buffer, keyword, length); | 87 i::OS::MemMove(buffer, keyword, length); |
88 buffer[length] = chars_to_append[j]; | 88 buffer[length] = chars_to_append[j]; |
89 i::Utf8ToUtf16CharacterStream stream(buffer, length + 1); | 89 i::Utf8ToUtf16CharacterStream stream(buffer, length + 1); |
90 i::Scanner scanner(&unicode_cache); | 90 i::Scanner scanner(&unicode_cache); |
91 scanner.Initialize(&stream); | 91 scanner.Initialize(&stream); |
92 CHECK_EQ(i::Token::IDENTIFIER, scanner.Next()); | 92 CHECK_EQ(i::Token::IDENTIFIER, scanner.Next()); |
93 CHECK_EQ(i::Token::EOS, scanner.Next()); | 93 CHECK_EQ(i::Token::EOS, scanner.Next()); |
94 } | 94 } |
95 // Replacing characters will make keyword matching fail. | 95 // Replacing characters will make keyword matching fail. |
96 { | 96 { |
97 i::MemMove(buffer, keyword, length); | 97 i::OS::MemMove(buffer, keyword, length); |
98 buffer[length - 1] = '_'; | 98 buffer[length - 1] = '_'; |
99 i::Utf8ToUtf16CharacterStream stream(buffer, length); | 99 i::Utf8ToUtf16CharacterStream stream(buffer, length); |
100 i::Scanner scanner(&unicode_cache); | 100 i::Scanner scanner(&unicode_cache); |
101 scanner.Initialize(&stream); | 101 scanner.Initialize(&stream); |
102 CHECK_EQ(i::Token::IDENTIFIER, scanner.Next()); | 102 CHECK_EQ(i::Token::IDENTIFIER, scanner.Next()); |
103 CHECK_EQ(i::Token::EOS, scanner.Next()); | 103 CHECK_EQ(i::Token::EOS, scanner.Next()); |
104 } | 104 } |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
(...skipping 2342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2450 RunParserSyncTest(assignment_context_data, bad_statement_data_common, kError); | 2450 RunParserSyncTest(assignment_context_data, bad_statement_data_common, kError); |
2451 RunParserSyncTest(assignment_context_data, bad_statement_data_for_assignment, | 2451 RunParserSyncTest(assignment_context_data, bad_statement_data_for_assignment, |
2452 kError); | 2452 kError); |
2453 | 2453 |
2454 RunParserSyncTest(prefix_context_data, good_statement_data, kSuccess); | 2454 RunParserSyncTest(prefix_context_data, good_statement_data, kSuccess); |
2455 RunParserSyncTest(prefix_context_data, bad_statement_data_common, kError); | 2455 RunParserSyncTest(prefix_context_data, bad_statement_data_common, kError); |
2456 | 2456 |
2457 RunParserSyncTest(postfix_context_data, good_statement_data, kSuccess); | 2457 RunParserSyncTest(postfix_context_data, good_statement_data, kSuccess); |
2458 RunParserSyncTest(postfix_context_data, bad_statement_data_common, kError); | 2458 RunParserSyncTest(postfix_context_data, bad_statement_data_common, kError); |
2459 } | 2459 } |
OLD | NEW |