Skip to content

Conversation

@Happypig375
Copy link
Member

No description provided.

Copy link

Copilot AI left a 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 operator precedence and parsing for comparison chains, Boolean operations, and set operations. The changes introduce a new EqualTo method to distinguish between chained and non-chained equality comparisons, adjust operator precedence levels (XOR above OR, set union/minus at same level), and fix chained comparison parsing to correctly expand chains like a < b = c into (a < b) and (b = c).

Changes:

  • Adjusted precedence: XOR now at 50 (above OR at 30), set union and minus both at 20, conjunction at 70
  • Added EqualTo method for non-chained equality; Equalizes for chained equality
  • Fixed "provided" operator to be right-associative
  • Replaced grammar rules to properly parse chained comparisons and consolidate set operations

Reviewed changes

Copilot reviewed 28 out of 29 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Entity.Definition.cs Updated operator precedence values and fixed spelling
Entity.Discrete.Definition.cs Added EqualTo method with documentation
Entity.Discrete.Classes.cs Fixed Implication spelling
AngouriMath.g Rewrote comparison parsing and consolidated set operations
AngouriMathParser.cs Generated parser code from grammar changes
AngouriMathListener.cs Updated listener interfaces for renamed rules
PriorityTest.cs Updated tests for new precedence and parsing behavior
LatexTest.cs Replaced Equalizes with EqualTo in tests
FromStringTest.cs Added tests for chained vs non-chained equality
InnerSimplifyTest.cs Updated expected test output
IntegrationTest.cs Replaced Equalizes with EqualTo throughout
Simplification patterns Updated to use EqualTo instead of Equalizes
Evaluation patterns Updated to use EqualTo instead of Equalizes
MathS.cs Updated Equality method to use EqualTo
ToString classes Fixed Provided stringization with precedence checks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -3213,281 +3030,270 @@ public StatementContext statement() {
}

private static int[] _serializedATN = {
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Field '_serializedATN' can be 'readonly'.

Suggested change
private static int[] _serializedATN = {
private static readonly int[] _serializedATN = {

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated

@Happypig375 Happypig375 merged commit b0e7168 into master Jan 21, 2026
24 checks passed
@Happypig375 Happypig375 deleted the set-union-subtraction-precedence branch January 21, 2026 19:34
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.

2 participants