-
Notifications
You must be signed in to change notification settings - Fork 2
Implement 사전(Dict) #126
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
Implement 사전(Dict) #126
Conversation
…r compound operators
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @rycont, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces a new fundamental data type, "사전" (Dictionary), enabling the storage and manipulation of key-value pairs. Alongside this, it significantly extends the language's assignment capabilities by implementing compound assignment operators (e.g., +=
, -=
) for both variables and elements within indexed collections like lists and the newly added dictionaries. These changes enhance the expressiveness and power of the language, providing more versatile data structuring and manipulation options.
Highlights
- New Dictionary Type (
사전
): Implemented a new "사전" (Dictionary) data type, allowing users to store and retrieve values using named keys. This includes support for creating dictionary literals, accessing values by key (e.g.,dict['key']
), and modifying existing entries. - Compound Assignment Operators: Added support for compound assignment operators (
+=
,-=
,*=
,/=
,%=
) for both variables and elements within indexed types (lists and dictionaries). This allows for more concise code when performing an operation and reassigning the result. - Enhanced Indexed Value Handling: The core
IndexedValue
class has been updated to support dictionary-like behavior, including a newtoPrint()
method for formatted output and anenumerate()
method to facilitate iteration over dictionary keys. - Generalized Loop Iteration: The
ListLoop
construct has been generalized to iterate over anyIndexedValue
(including dictionaries, where it iterates over keys), rather than being limited to lists. - Refined Error Reporting: The
IndexOutOfRangeError
has been renamed toIndexKeyNotFoundError
and its error messages improved to provide clearer context, including the type of index used. - Updated Documentation: Comprehensive documentation has been added for the new dictionary type, along with examples for compound assignment operators, making it easier for users to learn and utilize these new features.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
Deploying dalbit-yaksok with
|
Latest commit: |
c436743
|
Status: | ✅ Deploy successful! |
Preview URL: | https://08a92526.yaksok-ts.pages.dev |
Branch Preview URL: | https://implement-dictionary.yaksok-ts.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a new dictionary (사전
) data type to the language, a significant and well-implemented feature. The changes span the entire compiler toolchain, from tokenizing and parsing to execution and error handling. The implementation includes compound assignment operators (+=
, -=
, etc.) for both variables and indexed values (lists/dicts), which is a great enhancement. The PR also comes with comprehensive tests and documentation.
My review focuses on a few areas for improvement:
- Refactoring duplicated code for handling compound assignments to improve maintainability.
- Fixing a minor grammatical issue in the new documentation.
- Improving consistency in a new test file.
Overall, this is a high-quality contribution.
3333d92
to
c436743
Compare
새 타입으로 "사전"이 추가됩니다.