Skip to content
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

Parser refactor (part 1) #143

Merged
merged 94 commits into from
Jul 22, 2020
Merged

Parser refactor (part 1) #143

merged 94 commits into from
Jul 22, 2020

Conversation

Happypig375
Copy link
Collaborator

@Happypig375 Happypig375 commented Jul 1, 2020

Now every command is put into a central place for lookup.

Also added \atopwithdelims to let MathListFromLaTeX be able to consume MathListToLaTeX output, and % for comments are now supported in MathListFromLaTeX and MathListToLaTeX.

AliasDictionary has been split into BiDictionary and ProxyAdder.

Contributes to #58.

@charlesroddie
Copy link
Collaborator

charlesroddie commented Jul 1, 2020

I had a brief look at this.

  • The changes to the data (e.g. adding "\") look fine
  • The PR adds net 854 lines of code, and it doesn't reduce complexity. So it starts at -854 points and will need to have very large benefits to justify that. It will take also a long time to review.
  • Storing functions in a dictionary, using reference equality, doesn't seem like a great idea to me.
  • Why is there Dictionary.cs ? What is wrong with a .Net dictionary?
  • Is a Trie needed? Presumably this is for performance? It adds complexity so we would need performance measurements to indicate a parsing bottleneck to justify inclusion. My guess is that parsing latex is not an expensive operation because it can be done from left to right and that rendering is much more expensive. (If string lookup turned out to be expensive, then just separating based on the first character would capture almost all the benefit of a full Trie.)

/// Represents a many to one relationship between TFirsts and TSeconds, allowing fast lookup of the first TFirst corresponding to any TSecond.
/// </summary>
#pragma warning disable CA1710 // Identifiers should have correct suffix
#pragma warning disable CA1010 // Collections should implement generic interface
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should include the above justification in a SuppressMessageAttribute.

@Happypig375 Happypig375 requested a review from FoggyFinder July 22, 2020 15:26
@Happypig375
Copy link
Collaborator Author

Re-requesting @FoggyFinder's approval since there are a lot of new changes

Happypig375 and others added 3 commits July 23, 2020 00:01
Co-authored-by: FoggyFinder <FoggyFinder@yandex.ua>
@Happypig375 Happypig375 merged commit ab9f87c into master Jul 22, 2020
@Happypig375 Happypig375 added Resolution/Implemented The described enhancement or housekeeping work has been implemented. Status/5. Awaiting next release This issue has been resolved and is waiting for the next release/prerelease. labels Jul 22, 2020
@Happypig375 Happypig375 deleted the ParserRefactor branch July 29, 2020 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution/Implemented The described enhancement or housekeeping work has been implemented. Status/5. Awaiting next release This issue has been resolved and is waiting for the next release/prerelease. Type/Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants