File: parserSyntaxWalker.generated.types

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (281 lines) | stat: -rw-r--r-- 7,806 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
=== tests/cases/conformance/parser/ecmascript5/parserSyntaxWalker.generated.ts ===

//declare module "fs" {
//    export class File {
//        constructor(filename: string);
//        public ReadAllText(): string;
//    }
//    export interface IFile {
//        [index: number]: string;
//    }
//}

//import fs = module("fs");


//module TypeScriptAllInOne {
//    export class Program {
//        static Main(...args: string[]) {
//            try {
//                var bfs = new BasicFeatures();
//                var retValue: number = 0;

//                retValue = bfs.VARIABLES();
//                if (retValue != 0) {

//                    return 1;
//                }

//                retValue = bfs.STATEMENTS(4);
//                if (retValue != 0) {

//                    return 1;
//                }


//                retValue = bfs.TYPES();
//                if (retValue != 0) {

//                    return 1;
//                }

//                retValue = bfs.OPERATOR();
//                if (retValue != 0) {

//                    return 1;
//                }
//            }
//            catch (e) {
//                console.log(e);
//            }
//            finally {

//            }

//            console.log('Done');

//            return 0;

//        }
//    }

//    class BasicFeatures {
//        /// <summary>
//        /// Test various of variables. Including nullable,key world as variable,special format
//        /// </summary>
//        /// <returns></returns>
//        public VARIABLES(): number {
//            var local = Number.MAX_VALUE;
//            var min = Number.MIN_VALUE;
//            var inf = Number.NEGATIVE_INFINITY;
//            var nan = Number.NaN;
//            var undef = undefined;

//            var п = local;
//            var м = local;

//            var local5 = <fs.File>null;
//            var local6 = local5 instanceof fs.File;

//            var hex = 0xBADC0DE, Hex = 0XDEADBEEF;
//            var float = 6.02e23, float2 = 6.02E-23
//            var char = 'c', \u0066 = '\u0066', hexchar = '\x42';
//            var quoted = '"', quoted2 = "'";
//            var reg = /\w*/;
//            var objLit = { "var": number = 42, equals: function (x) { return x["var"] === 42; }, toString: () => 'objLit{42}' };
//            var weekday = Weekdays.Monday;

//            var con = char + f + hexchar + float.toString() + float2.toString() + reg.toString() + objLit + weekday;

//            //
//            var any = 0;
//            var boolean = 0;
//            var declare = 0;
//            var constructor = 0;
//            var get = 0;
//            var implements = 0;
//            var interface = 0;
//            var let = 0;
//            var module = 0;
//            var number = 0;
//            var package = 0;
//            var private = 0;
//            var protected = 0;
//            var public = 0;
//            var set = 0;
//            var static = 0;
//            var string = 0;
//            var yield = 0;

//            var sum3 = any + boolean + declare + constructor + get + implements + interface + let + module + number + package + private + protected + public + set + static + string + yield;

//            return 0;
//        }

//        /// <summary>
//        /// Test different statements. Including if-else,swith,foreach,(un)checked,lock,using,try-catch-finally
//        /// </summary>
//        /// <param name="i"></param>
//        /// <returns></returns>
//        STATEMENTS(i: number): number {
//            var retVal = 0;
//            if (i == 1)
//                retVal = 1;
//            else
//                retVal = 0;
//            switch (i) {
//                case 2:
//                    retVal = 1;
//                    break;
//                case 3:
//                    retVal = 1;
//                    break;
//                default:
//                    break;
//            }

//            for (var x in { x: 0, y: 1 }) {
//            }

//            try {
//                throw null;
//            }
//            catch (Exception) {
//            }
//            finally {
//                try { }
//                catch (Exception) { }
//            }

//            return retVal;
//        }

//        /// <summary>
//        /// Test types in ts language. Including class,struct,interface,delegate,anonymous type
//        /// </summary>
//        /// <returns></returns>
//        public TYPES(): number {
//            var retVal = 0;
//            var c = new CLASS();
//            var xx: IF = c;
//            retVal += c.Property;
//            retVal += c.Member();
//            retVal += xx ^= Foo() ? 0 : 1;

//            //anonymous type
//            var anony = { a: new CLASS() };

//            retVal += anony.a.d();

//            return retVal;
//        }


//        ///// <summary>
//        ///// Test different operators
//        ///// </summary>
//        ///// <returns></returns>
//        public OPERATOR(): number {
//            var a: number[] = [1, 2, 3, 4,  implements , ];/*[] bug*/ // YES []
//            var i = a[1];/*[]*/
//            i = i + i - i * i / i % i & i | i ^ i;/*+ - * / % & | ^*/
//            var b = true && false || true ^ false;/*& | ^*/
//            b = !b;/*!*/
//            i = ~i;/*~i*/
//            b = i < (i -  continue ) && (i + 1) > i;/*< && >*/
//            var f = true ? 1 : 0;/*? :*/   // YES :
//            i++;/*++*/
//            i--;/*--*/
//            b = true && false || true;/*&& ||*/
//            i = i << 5;/*<<*/
//            i = i >> 5;/*>>*/
//            var j = i;
//            b = i == j && i != j && i <= j && i >= j;/*= == && != <= >=*/
//            i += <number>5.0;/*+=*/
//            i -= i;/*-=*/
//            i *= i;/**=*/
//            if (i == 0)
//                i++;
//            i /= i;/*/=*/
//            i %= i;/*%=*/
//            i &= i;/*&=*/
//            i |= i;/*|=*/
//            i ^= i;/*^=*/
//            i <<= i;/*<<=*/
//            i >>= i;/*>>=*/

//            if (i == 0 && !b && f == 1)
//                return 0;
//            else return 1;
//        }

//    }

//    interface IF {
//        Foo <!-- ): boolean;
//    }

//    class CLASS implements IF {

//        public d = () =>  '  return 0; };
//        public get Property() { return 0; }
//        public Member() {
//            return 0;
//        }
//        public Foo(): boolean {
//            var myEvent = () => { return 1; };
//            if (myEvent() == 1)
//                return true;
//            else
//                return false;
//        }
//    }


//    // todo: use these
//    class A {
//        public method1(val:number) {
//            return val;
//        }
//        public method2() {
//            return 2 * this.method1(2);
//        }
//    }

//    class B extends A {

//        public method2() {
//            return this.method1(2);
//        }
//    }

//    class Overloading {

//        private otherValue = 42;

//        constructor(private value: number, public name: string) { }
       
//        public Overloads(value: string);
//        public Overloads(value: string, ...rest: string[]) { }

//        public DefaultValue(value?: string = "Hello") { }
//    }
//}

//enum Weekdays {
//    Monday,
//    Tuesday,
//    Weekend,
//}

//enum Fruit {
//    Apple,
//    Pear
//}

//interface IDisposable {
//    Dispose(): void;
//}

//TypeScriptAllInOne.Program.Main();