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

Unified Diff: tests/language/string_interpolation9_test.dart

Issue 10911066: Make an empty identifier a scanning error. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added more tests. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/scanner/scanner.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/string_interpolation9_test.dart
diff --git a/tests/language/string_interpolation9_test.dart b/tests/language/string_interpolation9_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..8da163cd5e4f2a8d5bb453581f8207507c664f2f
--- /dev/null
+++ b/tests/language/string_interpolation9_test.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// Almost valid string interpolation syntax.
+
+main() {
+ var x;
+
+ x = "$"; /// 1: compile-time error
+ x = "x$"; /// 2: compile-time error
+ x = "$x$"; /// 3: compile-time error
+ x = "$$x"; /// 4: compile-time error
+ x = "$ "; /// 5: compile-time error
+
+ x = '$'; /// 6: compile-time error
+ x = 'x$'; /// 7: compile-time error
+ x = '$x$'; /// 8: compile-time error
+ x = '$$x'; /// 9: compile-time error
+ x = '$ '; /// 10: compile-time error
+
+ x = """$"""; /// 11: compile-time error
+ x = """x$"""; /// 12: compile-time error
+ x = """$x$"""; /// 13: compile-time error
+ x = """$$x"""; /// 14: compile-time error
+ x = """$ """; /// 15: compile-time error
+
+ x = '''$'''; /// 16: compile-time error
+ x = '''x$'''; /// 17: compile-time error
+ x = '''$x$'''; /// 18: compile-time error
+ x = '''$$x'''; /// 19: compile-time error
+ x = '''$ '''; /// 20: compile-time error
+
+ return x;
+}
« no previous file with comments | « lib/compiler/implementation/scanner/scanner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698