-
-
Notifications
You must be signed in to change notification settings - Fork 68
Fixing parsing for FormBox #545
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
Draft
mmatera
wants to merge
18
commits into
master
Choose a base branch
from
improving_makeboxes_compat
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
64c9295
fix parsing of FormBox inside a RowBox.
mmatera 3d83960
improving format handling in FormBox. Removed["$$Failure"]->Removed[$…
mmatera f15fe6c
removing trailing comment
mmatera 73926ff
Tiagos's comment
mmatera f3920f0
Merge remote-tracking branch 'origin/improving_makeboxes_compat' into…
mmatera f6f3d1f
go over Rocky's comments
mmatera 9a2680e
CHANGES.rst
mmatera 9485d9d
Merge branch 'master' into improving_makeboxes_compat
mmatera 0cfd7d0
moving pending doctests in MakeBoxes to pytests
mmatera ca7dd9b
improving tests and mark what is working now
mmatera 78fabca
xfalied optiona
mmatera 65cfbac
merge
mmatera 8fcf8de
reformulate tests
mmatera 72bd2b3
adding test to reveal the internals of MakeBoxes
mmatera 89d74ee
fix and improve MakeBoxes test
mmatera f77fae3
merge
mmatera dd57ebe
Merge branch 'more_tests_for_makeboxes' into improving_makeboxes_compat
mmatera a67a6af
Merge branch 'master' into improving_makeboxes_compat
mmatera File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
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.
Every place there is some depth that increases by one, there should be another place that decreases the depth by one.
Where is that?
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.
If the tat is not
LeftRowBoxthen we never reach the decrement.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.
You are saying something more or less like what the code says. Why is the decrement not reached. What is the depth used for?
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.
The deep was used to handle nested expressions like
\( a b \( InputForm \` \(OutputForm \` c d\) e \) \)When a
\`is found, then the previous tokens are collected, and evaluated as aSymbol, a Box expression orStandardFormif there is no token before\`. The result of this step is stored in a variable, to be used as the second argument ofFormBox.Then, a new call to the method is done, with
FormBoxas a tag. In the new call, the next elements are processed until the bracket and box deeps reach 0. Then, these elements are collected into aStringor aRowBox. Then, the instance where\`was found takes the format and the other collected elements, builds aFormBox[], and returns it (before reaching the line where the decrements happen).I tried to find a way to put the increment and the decrement together, but it just was more involved than this approach: I should have allowed the increment of the deep variables, and then doing the decrement before returning the FormBox. I didn't think that it was clearer.
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.
I hope the new comment helps to understand the logic.
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.
Thanks for the description. Something about this seems a little to complicated and that there should be something that follows the specification in a little more direct way:
I would like to think about and reflect on this some more. I think we can make this cleaner, clearer and simpler.
What would be ideal is if we could do a cleanup step first - no changes to behavior yet.
Then add the list of tests that are wrong and that we want to fix.
And after this, then come up with a way to implement this.
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.
Actually, in WMA,
I am sure it is possible, just that after trying for a while, I didn't find a better way.
What would be a cleanup step? The list of (simple) tests to check are the tests that I added in test/core/parser/test_parser.py.
OK, in that case, I am going to put this as a draft for a while.