View unanswered posts | View active topics


Reply to topic  [ 3 posts ] 
Code Formater Bug ! 
Author Message
Member

Joined: Sat May 15, 2010 11:33 am
Posts: 59
Location: Liège - Belgium
Post Code Formater Bug !
* Version of the Microsoft.NET framework**
2.0.50727 and 3.5.30729

* Your operating system and service pack
Seven SP1

* Details how to reproduce the problem

Try code formater with this line:

Code:
public function NewClass()
         {
         _knob.rotation = (((int(_virtualTrack.y) + int(_virtualTrack.height)) - int(_virtualCursor.y))
         / (int(_virtualTrack.height) / (_endAngle - _startAngle))) + _startAngle;
         }


or this line:

Code:
private function guiPowerChangeHandler(e:Event):void
      {
      if (state == POWER_OFF) powerOn() else powerOff();
      }


* Exception details

The script say: Syntax errors encountered. Could not format code.

It's probably wrong parsing or analise with this sample code..

PS: For the second sample code, i replaced by this and formater work fine and it's more efficient :)
Code:
state == POWER_OFF ? powerOn() : powerOff();

_________________
Ne baisse jamais les bras, car c'est à ce moment là que le miracle risque de se produire..

My Website: http://www.pureas3.org


Sat May 12, 2012 10:04 am
Profile WWW
Member

Joined: Tue Apr 24, 2012 10:10 am
Posts: 10
Location: Belfast, UK
Post Re: Code Formater Bug !
Code:
public function NewClass()
         {
         _knob.rotation = (((int(_virtualTrack.y) + int(_virtualTrack.height)) - int(_virtualCursor.y))
         / (int(_virtualTrack.height) / (_endAngle - _startAngle))) + _startAngle;
         }


Formats fine since everything is correct.



Code:
private function guiPowerChangeHandler(e:Event):void
      {
      if (state == POWER_OFF) powerOn() else powerOff();
      }


This is indeed a syntax error. You need a semicolon after "powerOn()" and off you go.

No bugs here, but if you encounter some strange ones, then look in your code for regular expressions and comment them out when formatting the code and check beginning of your document as newlines or comments before package definition have caused some problems for me earlier.

k.


Mon May 14, 2012 10:10 am
Profile
Member

Joined: Sat May 15, 2010 11:33 am
Posts: 59
Location: Liège - Belgium
Post Re: Code Formater Bug !
Ok, for the second line :) Whatever the compiler accepts this expression, but what you say makes sense.

For the first line, home, the format does not work and generates the error ..

Code:
public function foo()
{
      _knob.rotation = (((int(_virtualTrack.y) + int(_virtualTrack.height)) - int(_virtualCursor.y))
      / (int(_virtualTrack.height) / (_endAngle - _startAngle))) + _startAngle;
}


It may seem trivial, but this line of code has been extracted from a whole class format that the code did not want to format. And when he had to find the line called into question, it took comment everything step by step..

In this case, it is mismanaging the return line .. or other. Because if I put everything on the same line, then it works well.

It's "/" beginning of a line that seems to be a concern to the code formatter ..

It does not matter, because by replacing the / in the top line, everything works, but I wanted to inform the community of this small failure .. :wink:

As long as it does not encounter; should consider that the term is not over, even if there are back online. And formatting should not put everything on the same line! it should respect our breaks, because if they were doing is that there is a reason
.

Other cases:
Code:
if(foo)bar=!bar;


codeformatter gives the instruction to the next line .. he should leave everything on the same line ans i'dont find the option in the preferences.

Another stuff, I tried to change option "max line length", but it does not seem to have any effect on the size of my lines ..

_________________
Ne baisse jamais les bras, car c'est à ce moment là que le miracle risque de se produire..

My Website: http://www.pureas3.org


Sat May 19, 2012 7:57 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.