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

Preserve _ prefixed to variable names when generating erlang #164

Merged
merged 1 commit into from
Apr 14, 2014

Conversation

RJ
Copy link
Contributor

@RJ RJ commented Apr 14, 2014

Completely backwards compatible, but means we can enable
warnings_as_errors, and name unused variables with an underscore.

Otherwise it's impossible to use warnings_as_errors if you need to for loop over a proplist with keys/vals and you only want the vals. (for example).

See 2 new tests for the details

Completely backwards compatible, but means we can enable
warnings_as_errors, and name unused variables with an underscore.
(see 2 new tests)
@RJ
Copy link
Contributor Author

RJ commented Apr 14, 2014

Other options include:

  1. always prefix all variables with _ in the erlydtl_beam_compiler

  2. passing nowarn_unused_vars to the erlang compiler, possibly via compiler_options?

@kaos
Copy link
Member

kaos commented Apr 14, 2014

Related discussion: https://www.irccloud.com/pastebin/zjXRdvty

@kaos
Copy link
Member

kaos commented Apr 14, 2014

👍 Looks good. I'll just touch up the name varify a bit..

I prefer this instead of messing around with compiler options. nowarn_unused_vars can be passed using compiler_options already, and can be a workable option for those that don't like to use _ prefixes in their templates.

@kaos kaos merged commit f38e759 into erlydtl:master Apr 14, 2014
@kaos kaos added internal and removed internal labels Apr 14, 2014
@kaos kaos added this to the 0.9.4 milestone Apr 14, 2014
@kaos kaos self-assigned this Apr 14, 2014
kaos referenced this pull request Apr 14, 2014
@jwheare jwheare deleted the unused-vars-fix branch April 30, 2015 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants