• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16import { number } from './invalid_identifier_number.js'
17
18import abstract from './invalid_identifier_number.js'
19
20const asVar: string = '';
21
22const internal: string = "internal";
23
24const static: string = "static";
25
26const as: string = "as";
27
28const enum: string = "enum";
29
30const launch: string = "launch";
31
32const switch: string = "switch";
33
34const async: string = "async";
35
36const let: string = "let";
37
38const super: string = "super";
39
40const await: string = "await";
41
42const native: string = "native";
43
44const this: string = "this";
45
46const break: string = "break";
47
48const false: boolean = false;
49
50const new: string = "new";
51
52const throw: string = "throw";
53
54const final: string = "final";
55
56const null: null = null;
57
58const true: boolean = true;
59
60const class: string = "class";
61
62const for: string = "for";
63
64const override: string = "override";
65
66const try: string = "try";
67
68const function: string = "function";
69
70const package: string = "package";
71
72const undefined: undefined = undefined;
73
74const constructor: string = "constructor";
75
76const if: string = "if";
77
78const private: string = "private";
79
80const while: string = "while";
81
82const continue: string = "continue";
83
84const implements: string = "implements";
85
86const protected: string = "protected";
87
88const public: string = "public";
89
90const do: string = "do"
91
92const interface: string = "interface";
93
94const return: string = "return";
95
96const boolean: boolean = true;
97
98const double: number = 3.14;
99
100const Boolean: Boolean = true;
101
102const Double: number = 3.14;
103
104const Number: Number = 42;
105
106const byte: number = 255;
107
108const float: number = 3.14;
109
110const object: object = {};
111
112const Byte: number = 255;
113
114const Float: number = 3.14;
115
116const Object: Object = {};
117
118const bigint: bigint = 123n;
119
120const int: number = 42;
121
122const short: number = 32767;
123
124const Bigint: bigint = 123n;
125
126const Int: number = 42;
127
128const Short: number = 32767;
129
130const char: string = "a";
131
132const string: string = "hello";
133
134const void: void = undefined;
135
136class String {
137
138    private const: string = "const";
139
140    string: string = "hello";
141
142    constructor(string: string) {
143    }
144
145    private static Long() {
146    }
147
148    public void() {
149    }
150
151    test(string: string): string {
152        return string;
153    }
154}
155
156function test1(string: string): string {
157    return string;
158}
159
160const test2: string = (string: string): string => {
161    return string;
162};
163
164function long(string: string): string {
165    return string;
166}
167
168interface Test3 {
169    string: string;
170}
171
172@Entry
173@Component
174struct Char {
175  @State message: string = 'Hello World';
176  abstract:number = 123;
177  async:number = 123;
178  internal:number = 123;
179
180  build() {
181    RelativeContainer() {
182      Text(this.message)
183        .onClick(() => {
184        })
185    }
186  }
187  char(){
188  }
189  func(){
190  }
191}
192
193struct Long {
194  @State message: string = 'Hello World';
195
196  build() {
197    RelativeContainer() {
198      Text(this.message)
199    }
200  }
201}
202
203enum char {
204  short,
205  number = 2,
206  int = 3,
207}
208
209namespace char {
210    let number : number
211}
212
213namespace quarantine {
214  interface int {
215      test: short
216  }
217
218  interface test {
219      int: int
220  }
221}