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

if-else statements without braces not minified correctly #7

Closed
mikecao opened this issue Oct 3, 2016 · 0 comments
Closed

if-else statements without braces not minified correctly #7

mikecao opened this issue Oct 3, 2016 · 0 comments

Comments

@mikecao
Copy link

mikecao commented Oct 3, 2016

If you run this example:

const glsl = require('glsl-man');

const src = `
void main() {
    int a = 1;
    int b = 2;
    int c = 0;

    if (a < b)
        c = a;
    else
        c = b;
}
`;

const ast = glsl.parse(src);

console.log(glsl.string(ast, {tab:'', space:'', newline:''}));

You will get this:

void main(){int a=1;int b=2;int c=0;if(a<b)c=a;elsec=b;}

Note that elsec=b is not valid.

@lammas lammas closed this as completed in b97e824 Oct 3, 2016
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

No branches or pull requests

1 participant