diff --git a/ets2panda/lexer/scripts/keywords.yaml b/ets2panda/lexer/scripts/keywords.yaml index 08ae6869c9a8bf14d83b52ab027894a69cad3149..35b0d135c0613d2ed6a1c01086e36413bfeec373 100644 --- a/ets2panda/lexer/scripts/keywords.yaml +++ b/ets2panda/lexer/scripts/keywords.yaml @@ -397,11 +397,10 @@ keywords: keyword_like: [ets, ts] flags: [definable_type_name, predefined_type] - # issue 25066 - # - name: 'Number' - # token: KEYW_BUILTIN_NUMBER - # keyword_like: [ets] - # flags: [predefined_type] + - name: 'Number' + token: KEYW_BUILTIN_NUMBER + keyword_like: [ets] + flags: [predefined_type] - name: 'object' token: KEYW_OBJECT diff --git a/ets2panda/scripts/arkui.properties b/ets2panda/scripts/arkui.properties index 988315ac844212dc404e07e6a3a0eb49321bf673..773b5a1d13f73883313650fa5da6650532b7d2b2 100644 --- a/ets2panda/scripts/arkui.properties +++ b/ets2panda/scripts/arkui.properties @@ -1,3 +1,3 @@ ARKUI_DEV_REPO=https://gitee.com/rri_opensource/koala_projects.git -ARKUI_DEV_BRANCH=panda_rev_10-suggestion-rebuild +ARKUI_DEV_BRANCH=panda_rev_10-predefined-number ARKUI_DEST=koala-sig diff --git a/ets2panda/test/ast/parser/ets/number_as_identifier.ets b/ets2panda/test/ast/parser/ets/number_as_identifier.ets new file mode 100644 index 0000000000000000000000000000000000000000..6421a43e5bf1a539da9d1926e00b7c916617d2e3 --- /dev/null +++ b/ets2panda/test/ast/parser/ets/number_as_identifier.ets @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024-2025 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. + */ + +enum foo { + Number = 2 +} + +/* @@? 17:4 Error SyntaxError: Number is a predefined type, cannot be used as an identifier */