いくらかリファクタリングした#142
Merged
Merged
Conversation
taiseiue
commented
Sep 13, 2025
Member
- テストを書いた
- Roslyn分析ciを入れた
- Parser、ParsingScriptのリファクタリングをした
新しいTypeOperatorテストクラスを追加し、型判定のユニットテストを実装
There was a problem hiding this comment.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.