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

Refactor LaTeXML::Core::Box blessed objects #869

Merged
merged 1 commit into from Aug 31, 2017

Conversation

Projects
None yet
2 participants
@tkw1536
Contributor

tkw1536 commented Aug 31, 2017

Previously, objects representing a LaTeXML::Core::Box were an array, whereas objects representing LaTeXML::Core::Whatsit (which inherit from Box) were a hash. This led to duplication of several methods in the Whatsit class.

This PR refactors LaTeXML::Core::Box (and LaTeXML::Core::List, LaTeXML::Core::Comment, LaTeXML::Core::Whatsit that inherit from it) to be a blessed hash reference instead. This makes code within between the four classes consistent with each other, and also makes code more readable due to named access of properties.

@tkw1536

This comment has been minimized.

Contributor

tkw1536 commented Aug 31, 2017

oops, looks like one of the tests is suddenly failing on this (I remember them going through). I will have to have another look.

Refactor LaTeXML::Core::Box blessed objects
Previously, objects representing a LaTeXML::Core::Box were an array,
whereas objects representing LaTeXML::Core::Whatsit (which inherit from
Box) were a hash.  This led to duplication of several methods in the
Whatsit class.

This commit refactors LaTeXML::Core::Box (and other classes that inherit
from it) to be a hash reference instead. This makes code between the two
classes consistent with each other, and also makes code more readable
overall due to named access of properties.

@tkw1536 tkw1536 force-pushed the tkw1536:box-hash-refactor branch from 80152e0 to ecbfd9c Aug 31, 2017

@tkw1536

This comment has been minimized.

Contributor

tkw1536 commented Aug 31, 2017

Fixed, was caused by overlooking a special case in LaTeXML::Core::Box->getProperty.

@brucemiller brucemiller merged commit 4a36fc4 into brucemiller:master Aug 31, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@tkw1536 tkw1536 deleted the tkw1536:box-hash-refactor branch Jun 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment