From f30f7478e54451df7335a248f22048ca604054e1 Mon Sep 17 00:00:00 2001 From: Vivien Voros Date: Thu, 4 Jan 2024 13:58:20 +0100 Subject: [PATCH] Restricted keyword cannot be used as struct or class name The following keywords: undefined, var, is, typeof, yield, string, number, bigint cannot use as struct or class name. Fixes internal issue #14392 Change-Id: I1f169b005c5277f472e32922baad0051bb7166fe Signed-off-by: Vivien Voros --- ets2panda/lexer/scripts/keywords.yaml | 6 +++--- ets2panda/lexer/token/token.cpp | 11 ++++++++--- .../parser/ets/user_defined_10-expected.txt | 1 + ets2panda/test/parser/ets/user_defined_10.ets | 18 ++++++++++++++++++ .../parser/ets/user_defined_11-expected.txt | 1 + ets2panda/test/parser/ets/user_defined_11.ets | 18 ++++++++++++++++++ .../parser/ets/user_defined_12-expected.txt | 1 + ets2panda/test/parser/ets/user_defined_12.ets | 18 ++++++++++++++++++ .../parser/ets/user_defined_13-expected.txt | 1 + ets2panda/test/parser/ets/user_defined_13.ets | 18 ++++++++++++++++++ .../parser/ets/user_defined_14-expected.txt | 1 + ets2panda/test/parser/ets/user_defined_14.ets | 18 ++++++++++++++++++ .../parser/ets/user_defined_15-expected.txt | 1 + ets2panda/test/parser/ets/user_defined_15.ets | 18 ++++++++++++++++++ .../parser/ets/user_defined_16-expected.txt | 1 + ets2panda/test/parser/ets/user_defined_16.ets | 18 ++++++++++++++++++ .../parser/ets/user_defined_17-expected.txt | 1 + ets2panda/test/parser/ets/user_defined_17.ets | 18 ++++++++++++++++++ .../parser/ets/user_defined_18-expected.txt | 1 + ets2panda/test/parser/ets/user_defined_18.ets | 18 ++++++++++++++++++ .../parser/ets/user_defined_19-expected.txt | 1 + ets2panda/test/parser/ets/user_defined_19.ets | 18 ++++++++++++++++++ .../parser/ets/user_defined_20-expected.txt | 1 + ets2panda/test/parser/ets/user_defined_20.ets | 18 ++++++++++++++++++ .../parser/ets/user_defined_21-expected.txt | 1 + ets2panda/test/parser/ets/user_defined_21.ets | 18 ++++++++++++++++++ .../parser/ets/user_defined_8-expected.txt | 1 + ets2panda/test/parser/ets/user_defined_8.ets | 18 ++++++++++++++++++ .../parser/ets/user_defined_9-expected.txt | 1 + ets2panda/test/parser/ets/user_defined_9.ets | 18 ++++++++++++++++++ 30 files changed, 277 insertions(+), 6 deletions(-) create mode 100644 ets2panda/test/parser/ets/user_defined_10-expected.txt create mode 100644 ets2panda/test/parser/ets/user_defined_10.ets create mode 100644 ets2panda/test/parser/ets/user_defined_11-expected.txt create mode 100644 ets2panda/test/parser/ets/user_defined_11.ets create mode 100644 ets2panda/test/parser/ets/user_defined_12-expected.txt create mode 100644 ets2panda/test/parser/ets/user_defined_12.ets create mode 100644 ets2panda/test/parser/ets/user_defined_13-expected.txt create mode 100644 ets2panda/test/parser/ets/user_defined_13.ets create mode 100644 ets2panda/test/parser/ets/user_defined_14-expected.txt create mode 100644 ets2panda/test/parser/ets/user_defined_14.ets create mode 100644 ets2panda/test/parser/ets/user_defined_15-expected.txt create mode 100644 ets2panda/test/parser/ets/user_defined_15.ets create mode 100644 ets2panda/test/parser/ets/user_defined_16-expected.txt create mode 100644 ets2panda/test/parser/ets/user_defined_16.ets create mode 100644 ets2panda/test/parser/ets/user_defined_17-expected.txt create mode 100644 ets2panda/test/parser/ets/user_defined_17.ets create mode 100644 ets2panda/test/parser/ets/user_defined_18-expected.txt create mode 100644 ets2panda/test/parser/ets/user_defined_18.ets create mode 100644 ets2panda/test/parser/ets/user_defined_19-expected.txt create mode 100644 ets2panda/test/parser/ets/user_defined_19.ets create mode 100644 ets2panda/test/parser/ets/user_defined_20-expected.txt create mode 100644 ets2panda/test/parser/ets/user_defined_20.ets create mode 100644 ets2panda/test/parser/ets/user_defined_21-expected.txt create mode 100644 ets2panda/test/parser/ets/user_defined_21.ets create mode 100644 ets2panda/test/parser/ets/user_defined_8-expected.txt create mode 100644 ets2panda/test/parser/ets/user_defined_8.ets create mode 100644 ets2panda/test/parser/ets/user_defined_9-expected.txt create mode 100644 ets2panda/test/parser/ets/user_defined_9.ets diff --git a/ets2panda/lexer/scripts/keywords.yaml b/ets2panda/lexer/scripts/keywords.yaml index e437a74c86..b00c4eba87 100644 --- a/ets2panda/lexer/scripts/keywords.yaml +++ b/ets2panda/lexer/scripts/keywords.yaml @@ -64,7 +64,7 @@ keywords: - name: 'bigint' token: KEYW_BIGINT - keyword_like: [ts] + keyword_like: [ets, ts] - name: 'boolean' token: KEYW_BOOLEAN @@ -317,7 +317,7 @@ keywords: - name: 'number' token: KEYW_NUMBER - keyword_like: [ts] + keyword_like: [ets, ts] - name: 'object' token: KEYW_OBJECT @@ -390,7 +390,7 @@ keywords: - name: 'string' token: KEYW_STRING - keyword_like: [ts] + keyword_like: [ets, ts] - name: 'struct' token: KEYW_STRUCT diff --git a/ets2panda/lexer/token/token.cpp b/ets2panda/lexer/token/token.cpp index cf4e3e3033..6804f7f3bf 100644 --- a/ets2panda/lexer/token/token.cpp +++ b/ets2panda/lexer/token/token.cpp @@ -84,10 +84,7 @@ bool Token::IsReservedTypeName() const case TokenType::KEYW_ANY: case TokenType::KEYW_UNKNOWN: case TokenType::KEYW_NEVER: - case TokenType::KEYW_NUMBER: - case TokenType::KEYW_BIGINT: case TokenType::KEYW_BOOLEAN: - case TokenType::KEYW_STRING: case TokenType::KEYW_VOID: case TokenType::KEYW_OBJECT: return true; @@ -107,6 +104,14 @@ bool Token::IsDefinableTypeName() const case TokenType::KEYW_INT: case TokenType::KEYW_CHAR: case TokenType::KEYW_LONG: + case TokenType::KEYW_UNDEFINED: + case TokenType::KEYW_VAR: + case TokenType::KEYW_IS: + case TokenType::KEYW_TYPEOF: + case TokenType::KEYW_YIELD: + case TokenType::KEYW_STRING: + case TokenType::KEYW_NUMBER: + case TokenType::KEYW_BIGINT: return true; default: return false; diff --git a/ets2panda/test/parser/ets/user_defined_10-expected.txt b/ets2panda/test/parser/ets/user_defined_10-expected.txt new file mode 100644 index 0000000000..efd8c3d9e8 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_10-expected.txt @@ -0,0 +1 @@ +SyntaxError: Cannot be used as user-defined type. [user_defined_10.ets:16:8] diff --git a/ets2panda/test/parser/ets/user_defined_10.ets b/ets2panda/test/parser/ets/user_defined_10.ets new file mode 100644 index 0000000000..f9e1cfaf29 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_10.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +struct number{ + a : string = "15"; +} diff --git a/ets2panda/test/parser/ets/user_defined_11-expected.txt b/ets2panda/test/parser/ets/user_defined_11-expected.txt new file mode 100644 index 0000000000..ccb3734288 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_11-expected.txt @@ -0,0 +1 @@ +SyntaxError: Cannot be used as user-defined type. [user_defined_11.ets:16:7] diff --git a/ets2panda/test/parser/ets/user_defined_11.ets b/ets2panda/test/parser/ets/user_defined_11.ets new file mode 100644 index 0000000000..81c6a8eba4 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_11.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class number{ + a : string = "15"; +} diff --git a/ets2panda/test/parser/ets/user_defined_12-expected.txt b/ets2panda/test/parser/ets/user_defined_12-expected.txt new file mode 100644 index 0000000000..9821823436 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_12-expected.txt @@ -0,0 +1 @@ +SyntaxError: Cannot be used as user-defined type. [user_defined_12.ets:16:7] diff --git a/ets2panda/test/parser/ets/user_defined_12.ets b/ets2panda/test/parser/ets/user_defined_12.ets new file mode 100644 index 0000000000..ddf26139fe --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_12.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class yield{ + a : string = "15"; +} diff --git a/ets2panda/test/parser/ets/user_defined_13-expected.txt b/ets2panda/test/parser/ets/user_defined_13-expected.txt new file mode 100644 index 0000000000..5f612f8873 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_13-expected.txt @@ -0,0 +1 @@ +SyntaxError: Cannot be used as user-defined type. [user_defined_13.ets:16:7] diff --git a/ets2panda/test/parser/ets/user_defined_13.ets b/ets2panda/test/parser/ets/user_defined_13.ets new file mode 100644 index 0000000000..4a3731bd14 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_13.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class var{ + a : string = "15"; +} diff --git a/ets2panda/test/parser/ets/user_defined_14-expected.txt b/ets2panda/test/parser/ets/user_defined_14-expected.txt new file mode 100644 index 0000000000..284028330d --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_14-expected.txt @@ -0,0 +1 @@ +SyntaxError: Cannot be used as user-defined type. [user_defined_14.ets:16:7] diff --git a/ets2panda/test/parser/ets/user_defined_14.ets b/ets2panda/test/parser/ets/user_defined_14.ets new file mode 100644 index 0000000000..0a029a471b --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_14.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class typeof{ + a : string = "15"; +} diff --git a/ets2panda/test/parser/ets/user_defined_15-expected.txt b/ets2panda/test/parser/ets/user_defined_15-expected.txt new file mode 100644 index 0000000000..7b9e0e1559 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_15-expected.txt @@ -0,0 +1 @@ +SyntaxError: Cannot be used as user-defined type. [user_defined_15.ets:16:7] diff --git a/ets2panda/test/parser/ets/user_defined_15.ets b/ets2panda/test/parser/ets/user_defined_15.ets new file mode 100644 index 0000000000..6cbc42525a --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_15.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class is{ + a : string = "15"; +} diff --git a/ets2panda/test/parser/ets/user_defined_16-expected.txt b/ets2panda/test/parser/ets/user_defined_16-expected.txt new file mode 100644 index 0000000000..dc9ff85f0b --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_16-expected.txt @@ -0,0 +1 @@ +SyntaxError: Cannot be used as user-defined type. [user_defined_16.ets:16:8] diff --git a/ets2panda/test/parser/ets/user_defined_16.ets b/ets2panda/test/parser/ets/user_defined_16.ets new file mode 100644 index 0000000000..7c8941f3c1 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_16.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +struct is{ + a : string = "15"; +} diff --git a/ets2panda/test/parser/ets/user_defined_17-expected.txt b/ets2panda/test/parser/ets/user_defined_17-expected.txt new file mode 100644 index 0000000000..df6fbce58c --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_17-expected.txt @@ -0,0 +1 @@ +SyntaxError: Cannot be used as user-defined type. [user_defined_17.ets:16:8] diff --git a/ets2panda/test/parser/ets/user_defined_17.ets b/ets2panda/test/parser/ets/user_defined_17.ets new file mode 100644 index 0000000000..72768b9dd6 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_17.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +struct var{ + a : string = "15"; +} diff --git a/ets2panda/test/parser/ets/user_defined_18-expected.txt b/ets2panda/test/parser/ets/user_defined_18-expected.txt new file mode 100644 index 0000000000..2c1b7e257d --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_18-expected.txt @@ -0,0 +1 @@ +SyntaxError: Cannot be used as user-defined type. [user_defined_18.ets:16:8] diff --git a/ets2panda/test/parser/ets/user_defined_18.ets b/ets2panda/test/parser/ets/user_defined_18.ets new file mode 100644 index 0000000000..43394973d9 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_18.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +struct yield{ + a : string = "15"; +} diff --git a/ets2panda/test/parser/ets/user_defined_19-expected.txt b/ets2panda/test/parser/ets/user_defined_19-expected.txt new file mode 100644 index 0000000000..9ccabf77dc --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_19-expected.txt @@ -0,0 +1 @@ +SyntaxError: Cannot be used as user-defined type. [user_defined_19.ets:16:8] diff --git a/ets2panda/test/parser/ets/user_defined_19.ets b/ets2panda/test/parser/ets/user_defined_19.ets new file mode 100644 index 0000000000..764039bc9c --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_19.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +struct typeof{ + a : string = "15"; +} diff --git a/ets2panda/test/parser/ets/user_defined_20-expected.txt b/ets2panda/test/parser/ets/user_defined_20-expected.txt new file mode 100644 index 0000000000..4b63249df4 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_20-expected.txt @@ -0,0 +1 @@ +SyntaxError: Cannot be used as user-defined type. [user_defined_20.ets:16:8] diff --git a/ets2panda/test/parser/ets/user_defined_20.ets b/ets2panda/test/parser/ets/user_defined_20.ets new file mode 100644 index 0000000000..602a2bbcd8 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_20.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +struct bigint{ + a : string = "15"; +} diff --git a/ets2panda/test/parser/ets/user_defined_21-expected.txt b/ets2panda/test/parser/ets/user_defined_21-expected.txt new file mode 100644 index 0000000000..0b71c4d3a4 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_21-expected.txt @@ -0,0 +1 @@ +SyntaxError: Cannot be used as user-defined type. [user_defined_21.ets:16:7] diff --git a/ets2panda/test/parser/ets/user_defined_21.ets b/ets2panda/test/parser/ets/user_defined_21.ets new file mode 100644 index 0000000000..eb13f23e66 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_21.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class bigint{ + a : string = "15"; +} diff --git a/ets2panda/test/parser/ets/user_defined_8-expected.txt b/ets2panda/test/parser/ets/user_defined_8-expected.txt new file mode 100644 index 0000000000..c5113c1b0c --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_8-expected.txt @@ -0,0 +1 @@ +SyntaxError: Cannot be used as user-defined type. [user_defined_8.ets:16:8] diff --git a/ets2panda/test/parser/ets/user_defined_8.ets b/ets2panda/test/parser/ets/user_defined_8.ets new file mode 100644 index 0000000000..49550fffd7 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_8.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +struct string{ + a : string = "15"; +} diff --git a/ets2panda/test/parser/ets/user_defined_9-expected.txt b/ets2panda/test/parser/ets/user_defined_9-expected.txt new file mode 100644 index 0000000000..a89aa4ff19 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_9-expected.txt @@ -0,0 +1 @@ +SyntaxError: Cannot be used as user-defined type. [user_defined_9.ets:16:7] diff --git a/ets2panda/test/parser/ets/user_defined_9.ets b/ets2panda/test/parser/ets/user_defined_9.ets new file mode 100644 index 0000000000..7ccd121781 --- /dev/null +++ b/ets2panda/test/parser/ets/user_defined_9.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class string{ + a : string = "15"; +} -- Gitee