Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: runtime/vm/scanner.cc

Issue 10914213: Support r"xxx" raw strings (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/raw_string_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "vm/scanner.h" 5 #include "vm/scanner.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/flags.h" 8 #include "vm/flags.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/object_store.h" 10 #include "vm/object_store.h"
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 case ',': 824 case ',':
825 Recognize(Token::kCOMMA); 825 Recognize(Token::kCOMMA);
826 break; 826 break;
827 827
828 case '@': 828 case '@':
829 Recognize(Token::kAT); 829 Recognize(Token::kAT);
830 if ((c0_ == '"') || (c0_ == '\'')) { 830 if ((c0_ == '"') || (c0_ == '\'')) {
831 ScanLiteralString(true); 831 ScanLiteralString(true);
832 } 832 }
833 break; 833 break;
834
835 case 'r':
836 if ((LookaheadChar(1) == '"') || (LookaheadChar(1) == '\'')) {
837 ReadChar();
838 ScanLiteralString(true);
839 } else {
840 ScanIdent();
841 }
842 break;
843
834 case '"': 844 case '"':
835 case '\'': 845 case '\'':
836 ScanLiteralString(false); 846 ScanLiteralString(false);
837 break; 847 break;
838 848
839 case '#': 849 case '#':
840 ScanLibraryTag(); 850 ScanLibraryTag();
841 break; 851 break;
842 852
843 default: 853 default:
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 "%c%#"Px"", kPrivateKeySeparator, key_value); 957 "%c%#"Px"", kPrivateKeySeparator, key_value);
948 const String& result = String::Handle(String::New(private_key, Heap::kOld)); 958 const String& result = String::Handle(String::New(private_key, Heap::kOld));
949 return result.raw(); 959 return result.raw();
950 } 960 }
951 961
952 962
953 void Scanner::InitOnce() { 963 void Scanner::InitOnce() {
954 } 964 }
955 965
956 } // namespace dart 966 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/raw_string_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698