Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add chars method for builtin str #1793

Merged
merged 4 commits into from
Jan 7, 2025

Conversation

jellllly420
Copy link
Contributor

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

2. What is the scope of this PR (e.g. component or file name):

kclvm/runtime/src/
kclvm/runtime/src/value/
kclvm/runtime/src/builtin/
kclvm/tests/test_units/runtime/str/
test/grammar/builtins/str/

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

This PR adds a chars method for builtin str to return a list of the characters in the string.

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

Runtime test: kclvm/tests/test_units/runtime/str/
Grammar test: test/grammar/builtins/str/

@He1pa
Copy link
Contributor

He1pa commented Dec 19, 2024

Some lsp test failed about str std method. just re-run and update *.snap file

@He1pa
Copy link
Contributor

He1pa commented Dec 19, 2024

cc @zong-zhe

Signed-off-by: Zejun Zhao <jelly.zhao.42@gmail.com>
Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: he1pa <18012015693@163.com>
@coveralls
Copy link
Collaborator

coveralls commented Dec 30, 2024

Pull Request Test Coverage Report for Build 12653107375

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 4 of 21 (19.05%) changed or added relevant lines in 4 files are covered.
  • 81 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.02%) to 70.698%

Changes Missing Coverage Covered Lines Changed/Added Lines %
kclvm/runtime/src/value/val_str.rs 0 7 0.0%
kclvm/runtime/src/value/api.rs 0 10 0.0%
Files with Coverage Reduction New Missed Lines %
kclvm/runtime/src/value/iter.rs 3 81.98%
kclvm/runtime/src/api/utils.rs 12 57.81%
kclvm/sema/src/resolver/config.rs 66 83.52%
Totals Coverage Status
Change from base Build 12370734421: 0.02%
Covered Lines: 52854
Relevant Lines: 74760

💛 - Coveralls

@jellllly420
Copy link
Contributor Author

Sorry for the long delay. I have no clue about the CI failure. I cannot reproduce it locally since the official dev container's configuration is different from the workflow machine and the test suite doesn't work well in the dev container. Furthermore, I didn't find a relevant doc about the load_package's internal data structure. I'd be appreciate if someone could help on this issue. I noticed @He1pa has committed some fix but it still seems not right. ;(

@He1pa
Copy link
Contributor

He1pa commented Dec 30, 2024

Sorry for the long delay. I have no clue about the CI failure. I cannot reproduce it locally since the official dev container's configuration is different from the workflow machine and the test suite doesn't work well in the dev container. Furthermore, I didn't find a relevant doc about the load_package's internal data structure. I'd be appreciate if someone could help on this issue. I noticed @He1pa has committed some fix but it still seems not right. ;(

Ok, I will complete this PR later, but not now.
Anyway, thank you for your contribution

Signed-off-by: He1pa <18012015693@163.com>
@He1pa He1pa merged commit 69a4853 into kcl-lang:main Jan 7, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Enhance String Handling Consistency for Unicode and ASCII in KCL
3 participants