Warning, /frameworks/syntax-highlighting/autotests/input/test.dart is written in an unsupported language. File is not indexed.

0001 import 'dart:io' show File;
0002 /**
0003  * print a number
0004  * "helo"
0005  * 'string'
0006  */
0007 
0008 const List<int> list = [1];
0009 
0010 String s = '''
0011 Multline string single quote
0012 ''';
0013 
0014 String d = '''
0015 Multline string double quote
0016 ''';
0017 
0018 enum Enum { one, two }
0019 
0020 class SimpleClass {}
0021 
0022 abstract class Interface extends SimpleClass {}
0023 
0024 final class Dummy {}
0025 
0026 Stream<int> gen() async* {
0027   for (int i = 0; i < 100; ++i) {
0028     yield switch (i) {
0029       1 => 1,
0030       _ => throw "Invalid",
0031     };
0032     yield i;
0033   }
0034 }
0035 
0036 Future<int> printNum(int anum) async {
0037   print("This is a $anum\n");
0038   print('This is a $anum\n \'world\'');
0039   if (anum == 1) {
0040     switch (anum) {
0041       case 1:
0042         return 3;
0043       default:
0044         // do while
0045         do {
0046           anum--;
0047         } while (anum < 0);
0048         // while
0049         while (anum > 0) {
0050           anum--;
0051         }
0052         break;
0053     }
0054     return 1;
0055   } else {
0056     return 2;
0057   }
0058 }
0059 
0060 // What are you doing?
0061 void main() {
0062   final int nn = 10;
0063   double dd = 1.5;
0064   double de = double.nan;
0065   bool boolean = true;
0066   printNum(nn);
0067 }