Skip to content

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

Merged
brucemiller merged 1 commit into
brucemiller:masterfrom
tkw1536:box-hash-refactor
Aug 31, 2017
Merged

Refactor LaTeXML::Core::Box blessed objects#869
brucemiller merged 1 commit into
brucemiller:masterfrom
tkw1536:box-hash-refactor

Conversation

@tkw1536

@tkw1536 tkw1536 commented Aug 31, 2017

Copy link
Copy Markdown
Contributor

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

tkw1536 commented Aug 31, 2017

Copy link
Copy Markdown
Contributor Author

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

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 box-hash-refactor branch from 80152e0 to ecbfd9c Compare August 31, 2017 00:56
@tkw1536

tkw1536 commented Aug 31, 2017

Copy link
Copy Markdown
Contributor Author

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

@brucemiller
brucemiller merged commit 4a36fc4 into brucemiller:master Aug 31, 2017
@tkw1536
tkw1536 deleted the box-hash-refactor branch June 28, 2018 16:46
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