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

Replace code generator with Jinja2 templates #202

Merged
merged 2 commits into from Sep 9, 2017

Conversation

Projects
None yet
3 participants
@Ghabry
Member

Ghabry commented Jun 11, 2017

This is the first step for "liblcf vNext". I need a more maintanable code generator :).
generate.py depends now on the template engine "Jinja2".
Not tested under Python 2 yet. Need to boot my other system first.

The result matches the old generator output except for:

  • Whitespace in *_chunks.h and *_flags.cpp. Too much work to implement the tab-insertion logic and these files are expected to be removed in the next refactor.
  • Whitespace between functions and fields in *.h. Difficult to add because unconditionally adding a whitespace is not possible because this adds an incorrect whitespace after "public:" when no functions exist.
@carstene1ns

This comment has been minimized.

Show comment
Hide comment
@carstene1ns

carstene1ns Jun 11, 2017

Member

Tbh. I did not really like this excessive whitespace usage much.

Member

carstene1ns commented Jun 11, 2017

Tbh. I did not really like this excessive whitespace usage much.

@fdelapena fdelapena added Encoding and removed Encoding labels Jul 31, 2017

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Jul 31, 2017

Member

guess I have to rerun the generator

Member

Ghabry commented Jul 31, 2017

guess I have to rerun the generator

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Aug 5, 2017

Member

Can confirm that the script works with 0 chanfes in python2 👍 (lucky)

Member

Ghabry commented Aug 5, 2017

Can confirm that the script works with 0 chanfes in python2 👍 (lucky)

@carstene1ns

This comment has been minimized.

Show comment
Hide comment
@carstene1ns
Member

carstene1ns commented Aug 5, 2017

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Aug 5, 2017

Member

Found a problem: When building with CMake the build fails because when Python is installed it uses the file listing feature to get the list of generated files for compiling and the listing feature is broken. WTF.

I'm considering to delete the "-l" feature because I find it quite useless and fix the CMake script.

Any objections?

Member

Ghabry commented Aug 5, 2017

Found a problem: When building with CMake the build fails because when Python is installed it uses the file listing feature to get the list of generated files for compiling and the listing feature is broken. WTF.

I'm considering to delete the "-l" feature because I find it quite useless and fix the CMake script.

Any objections?

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Aug 6, 2017

Member

"Fixed" the CMake script by removing special path when Python is installed. Was less work than fixing the script, sorry :)

Member

Ghabry commented Aug 6, 2017

"Fixed" the CMake script by removing special path when Python is installed. Was less work than fixing the script, sorry :)

Ghabry added some commits Aug 25, 2017

Replace code generator with Jinja2 templates.
The result matches the old generator output except for:
- Whitespace in *_chunks.h and *_flags.cpp. Too much work to implement the tab-insertion logic and these files are expected to be removed in the next refactor.
- Whitespace between functions and fields in *.h. Difficult to add because unconditionally adding a whitespace is not possible because this adds an incorrect whitespace after "public:" when no functions exist.
Remove -l (list files) argument from generate.py script. Because the …
…function was broken.

This function was only used by the CMake script, the invocation was removed.

@carstene1ns carstene1ns merged commit 7ad47ab into EasyRPG:master Sep 9, 2017

4 checks passed

GNU/Linux Build finished.
Details
OSX Build finished.
Details
Windows Build finished.
Details
web Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment