Open
Conversation
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.
Description
This PR introduces critical parser improvements requested by the instructor and resolves priority issues with stacked fractions.
1. Floating-Point Numbers (Dot & Comma)
NUMBERtoken in the Lexer to accept both dot (3.14) and comma (3,14) formats.Visitor: every comma in a numeric value is automatically replaced with a dot in the resulting LaTeX output to maintain mathematical consistency.2. Multi-Variable Functions
argumentListrule, allowing functions with any number of arguments (e.g.,f(x, y),g(a, b, c)).COMMAtoken as an argument separator.3. Fraction Priority Fix (
//)expressionrule. Division (fractions) now has a higher priority than implicit multiplication.1 // 2 xnow correctly generates\frac{1}{2} x(previouslyxwas pulled into the denominator).1 // {2x}(or with grouping) correctly generates\frac{1}{2x}.4. Enhanced Comparison Operators
<=or≤>=or≥!=,<>, or≠=,==, or the keywordrowne<and>=) allows for an empty right-hand side (to support "step-by-step" math solving).Test Cases
x rowne 5x = 5a != ba \neq b2,5 + 3.52.5 + 3.5f(a, b, c)f(a, b, c)1 // 2 x\frac{1}{2} x1 //{2x}\frac{1}{2x}