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

Brace followed by comment conversion bug #337

Open
chrisvelevitch opened this issue Nov 29, 2018 · 2 comments
Open

Brace followed by comment conversion bug #337

chrisvelevitch opened this issue Nov 29, 2018 · 2 comments

Comments

@chrisvelevitch
Copy link

If a brace is followed by a comment on the next line, the brace is removed and added the end of the comment and now the code is missing a brace and is no longer compilable.

as3 code for example:

if(this._explicitWidth !== this._explicitWidth && //isNaN
    (this.actualWidth > value || this.actualWidth == oldValue))
{
    //only invalidate if this change might affect the width
    this.invalidate(INVALIDATION_FLAG_SIZE);
}

expected result

if(this._explicitWidth != this._explicitWidth && //isNaN
    (this.actualWidth > value || this.actualWidth == oldValue))
{
    //only invalidate if this change might affect the width
    this.invalidate(INVALIDATION_FLAG_SIZE);
}

actual result

if (this._explicitWidth != this._explicitWidth &&  //isNaN  
    (this.actualWidth > value || this.actualWidth == oldValue))

//only invalidate if this change might affect the width{
    
    this.invalidate(INVALIDATION_FLAG_SIZE);
}
@Adolio
Copy link

Adolio commented Sep 10, 2019

Same issue on my side.

Source:

if (expressionA)
{
	// comment
	expressionB;
}

Result:

if (expressionA)

// comment{
    
    expressionB;
}

Expected result:

if (expressionA)
{
    // comment
    expressionB;
}

gogoprog added a commit to firefalcom/as3hx that referenced this issue Jul 31, 2020
@gogoprog
Copy link

I'm also interested in a proper fix.

In the meantime I did a quick workaround here: firefalcom@84b93d5

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

3 participants