| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat(sema): support string-format API Level for @!APILevel and @IfAvailable Implements issue #824 (Cangjie/cangjie_compiler). @!APILevel and @IfAvailable now accept dotted semantic-version strings ("X.Y.Z") in addition to the legacy major-only integer literal: - @!APILevel[since: "20.1.5"] - @IfAvailable(level: "26.0.0", { => ... }, { => ... }) Highlights: - New APILevelVersion type (header + impl under src/Sema/Plugin/) is the shared parser/comparator used by both annotation and expression sites. - @IfAvailable desugar implements the 5-way matrix from #824, keyed on --cfg=APILevel_level (compatibleSDKVersion) vs the SDK 26 cutoff where the runtime apiAvailable(...) check becomes available. For compatibleSDKVersion < 26 the desugar continues to use DeviceInfo.sdkApiVersion >= N to preserve compatibility with older devices; for >= 26 it lowers to apiAvailable(...). - IfAvailable branch checkers are restricted to nested @IfAvailable only: plain 'if (DeviceInfo.sdkApiVersion >= N)' or 'if (canIUse(...))' inside an @IfAvailable branch is treated as ordinary control flow, not a nested Sema-level API gate. - The level form only requires importing ohos.device_info (where both DeviceInfo and apiAvailable live); no extra ohos.base import is forced on the user. - New dedicated diagnostic sema_apilevel_integer_form_unsupported (ERROR) fires for both positional @!APILevel[N] and named @!APILevel[since: N], pointing users at the correct @!APILevel[since: "X.Y.Z"] form. The legacy sema_apilevel_missing_arg warning is suppressed when the new ERROR has already fired so the diagnostics don't stack. - Doxygen-style before/after pseudocode comments on each new desugar helper, with an inline note explaining the SDK 26 cutoff. - Comprehensive unit tests for APILevelVersion (major/triple parsing, ordering, edge cases). Signed-off-by: wangyinqiang <django0721@gmail.com> Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: wyq1213 <wangyinqiang2@huawei.com> | 1 个月前 | |
feat(sema): support string-format API Level for @!APILevel and @IfAvailable Implements issue #824 (Cangjie/cangjie_compiler). @!APILevel and @IfAvailable now accept dotted semantic-version strings ("X.Y.Z") in addition to the legacy major-only integer literal: - @!APILevel[since: "20.1.5"] - @IfAvailable(level: "26.0.0", { => ... }, { => ... }) Highlights: - New APILevelVersion type (header + impl under src/Sema/Plugin/) is the shared parser/comparator used by both annotation and expression sites. - @IfAvailable desugar implements the 5-way matrix from #824, keyed on --cfg=APILevel_level (compatibleSDKVersion) vs the SDK 26 cutoff where the runtime apiAvailable(...) check becomes available. For compatibleSDKVersion < 26 the desugar continues to use DeviceInfo.sdkApiVersion >= N to preserve compatibility with older devices; for >= 26 it lowers to apiAvailable(...). - IfAvailable branch checkers are restricted to nested @IfAvailable only: plain 'if (DeviceInfo.sdkApiVersion >= N)' or 'if (canIUse(...))' inside an @IfAvailable branch is treated as ordinary control flow, not a nested Sema-level API gate. - The level form only requires importing ohos.device_info (where both DeviceInfo and apiAvailable live); no extra ohos.base import is forced on the user. - New dedicated diagnostic sema_apilevel_integer_form_unsupported (ERROR) fires for both positional @!APILevel[N] and named @!APILevel[since: N], pointing users at the correct @!APILevel[since: "X.Y.Z"] form. The legacy sema_apilevel_missing_arg warning is suppressed when the new ERROR has already fired so the diagnostics don't stack. - Doxygen-style before/after pseudocode comments on each new desugar helper, with an inline note explaining the SDK 26 cutoff. - Comprehensive unit tests for APILevelVersion (major/triple parsing, ordering, edge cases). Signed-off-by: wangyinqiang <django0721@gmail.com> Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: wyq1213 <wangyinqiang2@huawei.com> | 1 个月前 | |
refactor: refector plugin checker dir Signed-off-by: Augus_Jan <zhanguozheng.829268@huawei.com> | 6 个月前 | |
fix: fix a heap-size-overflow question Signed-off-by: Augus_Jan <zhanguozheng.829268@huawei.com> | 20 天前 | |
refactor: refector plugin checker dir Signed-off-by: Augus_Jan <zhanguozheng.829268@huawei.com> | 6 个月前 | |
feat: sync dev to main Signed-off-by: weinw <weiningwei@h-partners.com> | 1 个月前 | |
feat: sync dev to main Signed-off-by: weinw <weiningwei@h-partners.com> | 1 个月前 | |
feat(sema): support string-format API Level for @!APILevel and @IfAvailable Implements issue #824 (Cangjie/cangjie_compiler). @!APILevel and @IfAvailable now accept dotted semantic-version strings ("X.Y.Z") in addition to the legacy major-only integer literal: - @!APILevel[since: "20.1.5"] - @IfAvailable(level: "26.0.0", { => ... }, { => ... }) Highlights: - New APILevelVersion type (header + impl under src/Sema/Plugin/) is the shared parser/comparator used by both annotation and expression sites. - @IfAvailable desugar implements the 5-way matrix from #824, keyed on --cfg=APILevel_level (compatibleSDKVersion) vs the SDK 26 cutoff where the runtime apiAvailable(...) check becomes available. For compatibleSDKVersion < 26 the desugar continues to use DeviceInfo.sdkApiVersion >= N to preserve compatibility with older devices; for >= 26 it lowers to apiAvailable(...). - IfAvailable branch checkers are restricted to nested @IfAvailable only: plain 'if (DeviceInfo.sdkApiVersion >= N)' or 'if (canIUse(...))' inside an @IfAvailable branch is treated as ordinary control flow, not a nested Sema-level API gate. - The level form only requires importing ohos.device_info (where both DeviceInfo and apiAvailable live); no extra ohos.base import is forced on the user. - New dedicated diagnostic sema_apilevel_integer_form_unsupported (ERROR) fires for both positional @!APILevel[N] and named @!APILevel[since: N], pointing users at the correct @!APILevel[since: "X.Y.Z"] form. The legacy sema_apilevel_missing_arg warning is suppressed when the new ERROR has already fired so the diagnostics don't stack. - Doxygen-style before/after pseudocode comments on each new desugar helper, with an inline note explaining the SDK 26 cutoff. - Comprehensive unit tests for APILevelVersion (major/triple parsing, ordering, edge cases). Signed-off-by: wangyinqiang <django0721@gmail.com> Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: wyq1213 <wangyinqiang2@huawei.com> | 1 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 个月前 | ||
| 1 个月前 | ||
| 6 个月前 | ||
| 20 天前 | ||
| 6 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 1 个月前 |