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

Refactorings #28

Merged
merged 10 commits into from Feb 2, 2018
Merged

Refactorings #28

merged 10 commits into from Feb 2, 2018

Conversation

usr42
Copy link
Contributor

@usr42 usr42 commented Jan 26, 2017

I refactored some things. If you don't like some of the refactorings, I can revert the corresponding commit. These are the refactorings:

  1. Encapsulate pushd and popd inside of indent function. Indent has a block, so instead of
pushd
  putd "int i;"
popd

you now write

indent {
  putd "int i;"
}

This enforces a corresponding popd to each pushd and you can use indentation support of a text editor for the ruby code.

  1. Add putd_backslash which automatically adds a backslash at the end of a line of the generated code for multiline macros.
putd "int i; \\"

can now be written with

putd_backslash "int i;"

In my opinion this improves readability and enforces code style for the generated code.

  1. Replace putd "" by puts
    This generates empty lines instead of lines full of spaces.

  2. Remove dead code

@usr42
Copy link
Contributor Author

usr42 commented Feb 4, 2017

@meekrosoft I just solved the merge conflicts.

@usr42
Copy link
Contributor Author

usr42 commented Jan 10, 2018

@meekrosoft I've just solved the merge conflicts again. Can the pull request be merged. Do you like the idea of the changes?

@usr42
Copy link
Contributor Author

usr42 commented Jan 30, 2018

@meekrosoft The merge conflicts are solved again.

@meekrosoft meekrosoft merged commit ef24c19 into meekrosoft:master Feb 2, 2018
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.

None yet

2 participants