| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 #include "vm/os.h" | 6 #include "vm/os.h" |
| 7 #include "vm/scanner.h" | 7 #include "vm/scanner.h" |
| 8 #include "vm/token.h" | 8 #include "vm/token.h" |
| 9 #include "vm/unit_test.h" | 9 #include "vm/unit_test.h" |
| 10 | 10 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 Scan("\"\\u{FFFFFF}\""); | 238 Scan("\"\\u{FFFFFF}\""); |
| 239 EXPECT_EQ(2, out_of_range_high.length()); | 239 EXPECT_EQ(2, out_of_range_high.length()); |
| 240 CheckKind(out_of_range_high, 0, Token::kERROR); | 240 CheckKind(out_of_range_high, 0, Token::kERROR); |
| 241 EXPECT(out_of_range_high[0].literal->Equals("invalid code point")); | 241 EXPECT(out_of_range_high[0].literal->Equals("invalid code point")); |
| 242 CheckKind(out_of_range_high, 1, Token::kEOS); | 242 CheckKind(out_of_range_high, 1, Token::kEOS); |
| 243 } | 243 } |
| 244 | 244 |
| 245 | 245 |
| 246 void RawString() { | 246 void RawString() { |
| 247 // rs = @"\' \\" | 247 // rs = @"\' \\" |
| 248 const Scanner::GrowableTokenStream& tokens = Scan("rs = @\"\\\' \\\\\""); | 248 const Scanner::GrowableTokenStream& tokens = Scan("rs = r\"\\\' \\\\\""); |
| 249 | 249 |
| 250 EXPECT_EQ(4, tokens.length()); | 250 EXPECT_EQ(4, tokens.length()); |
| 251 CheckIdent(tokens, 0, "rs"); | 251 CheckIdent(tokens, 0, "rs"); |
| 252 CheckKind(tokens, 1, Token::kASSIGN); | 252 CheckKind(tokens, 1, Token::kASSIGN); |
| 253 CheckKind(tokens, 2, Token::kSTRING); | 253 CheckKind(tokens, 2, Token::kSTRING); |
| 254 CheckKind(tokens, 3, Token::kEOS); | 254 CheckKind(tokens, 3, Token::kEOS); |
| 255 CheckLineNumber(tokens, 2, 1); | 255 CheckLineNumber(tokens, 2, 1); |
| 256 const char* litchars = (tokens)[2].literal->ToCString(); | 256 const char* litchars = (tokens)[2].literal->ToCString(); |
| 257 EXPECT_EQ(5, (tokens)[2].literal->Length()); | 257 EXPECT_EQ(5, (tokens)[2].literal->Length()); |
| 258 | 258 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 RawString(); | 440 RawString(); |
| 441 MultilineString(); | 441 MultilineString(); |
| 442 EmptyString(); | 442 EmptyString(); |
| 443 EmptyMultilineString(); | 443 EmptyMultilineString(); |
| 444 NumberLiteral(); | 444 NumberLiteral(); |
| 445 InvalidText(); | 445 InvalidText(); |
| 446 FindLineTest(); | 446 FindLineTest(); |
| 447 } | 447 } |
| 448 | 448 |
| 449 } // namespace dart | 449 } // namespace dart |
| OLD | NEW |