-
Notifications
You must be signed in to change notification settings - Fork 1
いくらかリファクタリングした #142
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
いくらかリファクタリングした #142
Conversation
taiseiue
commented
Sep 13, 2025
- テストを書いた
- Roslyn分析ciを入れた
- Parser、ParsingScriptのリファクタリングをした
新しいTypeOperatorテストクラスを追加し、型判定のユニットテストを実装
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.
Pull Request Overview
This pull request refactors the Parser and ParsingScript classes for better code maintainability and performance. Key changes include consolidating property getters for settings inheritance, optimizing the main parsing loop, and adding type system improvements.
- Simplified property getters using a shared helper method for settings inheritance
- Refactored the main parsing loop to eliminate goto statements and improve readability
- Enhanced type matching logic in TypeObject for better compatibility checks
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Losetta/Parsing/ParsingScript.cs | Refactored property getters to use shared inheritance helper method, optimized line number lookup algorithm |
| Losetta/Parsing/Parser.cs | Eliminated goto statements in main parsing loop, optimized operator priority lookup with dictionary, fixed typo in enum name |
| Losetta/Objects/TypeObject.cs | Enhanced type matching logic for better .NET type compatibility and null handling |
| Losetta.Tests/Losetta/Scripting/Expression/Operator/TypeOperator.cs | Added comprehensive tests for type operators (is, as, is not) |
| Losetta.Tests/Losetta/Scripting/Expression/Operator/NumberPre.cs | Added tests for pre-increment/decrement operators with temporary ignore flags |
| Directory.Build.props | Added Roslyn analyzer configuration for code quality enforcement |
| .github/workflows/roslyn-analysis.yml | Added CI workflow for Roslyn code analysis |
| .github/workflows/roslyn-analysis-strict.yml | Added strict CI workflow that treats warnings as errors |
Comments suppressed due to low confidence (1)
Losetta.Tests/Losetta/Scripting/Expression/Operator/NumberPre.cs:13
- [nitpick] The spacing around the unary plus operator should be consistent. Use either
x => +xorx => + xthroughout the file.
TestUtils.TestExpression(Constants.PLUS, val, x => +x);
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>