b736d75fb0
This only happens in string interpolations, since it is the only place where an identifier is scanned without first seeing at least one character of the identifier. BUG=4899 Review URL: https://chromiumcodereview.appspot.com//10911066 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11927 260f80e4-7a28-3924-810f-c04153c831b5
36 lines
1.1 KiB
Dart
36 lines
1.1 KiB
Dart
// 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;
|
|
}
|