Skip to content

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

Merged
merged 26 commits into from
Jul 27, 2025
Merged

Implement 사전(Dict) #126

merged 26 commits into from
Jul 27, 2025

Conversation

rycont
Copy link
Owner

@rycont rycont commented Jul 27, 2025

새 타입으로 "사전"이 추가됩니다.

이력서 = {
    출신: "미시시피"
    부모님: "완전 부자"
}

이력서['출신'] + " 츨신이에요" 보여주기
이력서['부모님'] + " 부모님이에요" 보여주기
이력서['나이'] = 20

가져올_값 = '이름'
이력서[가져올_값] = "병서"
"이름은 " + 이력서[가져올_값] + "에요" 보여주기

"# 이력서" 보여주기

이력서 의 항목_이름 마다 반복
    항목_이름 + ": " + 이력서[항목_이름] 보여주기

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 new toPrint() method for formatted output and an enumerate() method to facilitate iteration over dictionary keys.
  • Generalized Loop Iteration: The ListLoop construct has been generalized to iterate over any IndexedValue (including dictionaries, where it iterates over keys), rather than being limited to lists.
  • Refined Error Reporting: The IndexOutOfRangeError has been renamed to IndexKeyNotFoundError 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

  1. 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.

Copy link

cloudflare-workers-and-pages bot commented Jul 27, 2025

Deploying dalbit-yaksok with  Cloudflare Pages  Cloudflare Pages

Latest commit: c436743
Status: ✅  Deploy successful!
Preview URL: https://08a92526.yaksok-ts.pages.dev
Branch Preview URL: https://implement-dictionary.yaksok-ts.pages.dev

View logs

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

@rycont rycont force-pushed the implement-dictionary branch from 3333d92 to c436743 Compare July 27, 2025 07:32
@rycont rycont merged commit 39f2e2e into main Jul 27, 2025
3 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.

1 participant