| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Check that we can use pseudo keywords as names in function level code. | 4 // Check that we can use pseudo keywords as names in function level code. |
| 5 | 5 |
| 6 | 6 |
| 7 class PseudoKWTest { | 7 class PseudoKWTest { |
| 8 static testMain() { | 8 static testMain() { |
| 9 | 9 |
| 10 // This list is taken from the 'identifier' production | 10 // This list is taken from the 'identifier' production |
| 11 // of the Dart grammar. It lists all the pseudo-keywords | 11 // of the Dart grammar. It lists all the pseudo-keywords |
| 12 // that are legal identifiers at the function level. | 12 // that are legal identifiers at the function level. |
| 13 | 13 |
| 14 var abstract = 0; | 14 var abstract = 0; |
| 15 var class = 0; | |
| 16 var extends = 0; | 15 var extends = 0; |
| 17 var factory = 0; | 16 var factory = 0; |
| 18 var get = 0; | 17 var get = 0; |
| 19 var implements = 0; | 18 var implements = 0; |
| 20 var import = 0; | 19 var import = 0; |
| 21 var interface = 0; | 20 var interface = 0; |
| 22 var library = 0; | 21 var library = 0; |
| 23 var native = 0; | 22 var native = 0; |
| 24 var negate = 0; | 23 var negate = 0; |
| 25 var operator = 0; | 24 var operator = 0; |
| 26 var set = 0; | 25 var set = 0; |
| 27 var source = 0; | 26 var source = 0; |
| 28 var static = 0; | 27 var static = 0; |
| 29 { | 28 { |
| 30 void factory(set) { | 29 void factory(set) { |
| 31 return 0; | 30 return 0; |
| 32 } | 31 } |
| 33 } | 32 } |
| 34 | 33 |
| 35 get: while (extends > 0) { | 34 get: while (extends > 0) { |
| 36 break get; | 35 break get; |
| 37 } | 36 } |
| 38 | 37 |
| 39 return static + library * class; | 38 return static + library; |
| 40 } | 39 } |
| 41 } | 40 } |
| 42 | 41 |
| 43 | 42 |
| 44 main() { | 43 main() { |
| 45 PseudoKWTest.testMain(); | 44 PseudoKWTest.testMain(); |
| 46 } | 45 } |
| OLD | NEW |