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

Split up environments list into calls to defineEnvironment #347

Merged
merged 3 commits into from
Sep 15, 2015

Conversation

gagern
Copy link
Collaborator

@gagern gagern commented Sep 10, 2015

This is one part of #262, discussed in #256.

Having one long array literal to contain the code of all environment implementations is problematic. It makes it difficult to add auxiliary functions or data close to the function inside the list where it is needed.

Now the functions are no longer defined using such a literal, but instead using calls to a defineEnvironment function which receives all the relevant data. Since each function call is independent from the others, anything can go in between.

I've deliberately submitted this as two distinct commits. The first does the actual work, but avoids reindentation, while the second does the reindentation but has no other changes. Hopefully this will make reviewing easier. Of course I can squash that once you're satisfied.

Having one long array literal to contain the code of all environment
implementations is problematic.  It makes it difficult to add auxiliary
functions or data close to the function inside the list where it is needed.

Now the functions are no longer defined using such a literal, but instead
using calls to a "defineEnvironment" function which receives all the
relevant data.  Since each function call is independent from the others,
anything can go in between.

This commit deliberately avoided reindenting existing code to match the new
surroundings.  That way it is easier to see where actual changes happen,
even when not performing a whitespace-ignoring diff.
Since the previous commit deliberately avoided reindenting, this one here
does just that: reindenting the existing code.
@gagern gagern mentioned this pull request Sep 11, 2015
kevinbarabash added a commit that referenced this pull request Sep 15, 2015
Split up environments list into calls to defineEnvironment
@kevinbarabash kevinbarabash merged commit d7d1367 into KaTeX:master Sep 15, 2015
@kevinbarabash
Copy link
Member

Hmm... I probably should've had you squash those. I'll remember for the next one.

@gagern gagern deleted the splitEnvironments branch September 15, 2015 07:08
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