"Auto Format" Bug

| 1 Comment

I just found a bug with the "Auto Format" option when editing .as files in the Flash MX 2k4 Pro IDE.

Before asking why I'm using the Flash IDE to edit .as files, let me plead my case. I've been falling in love with PrimalScript for editing of external .as files (both classes and includes), but it doesn't have a "format source" option (at least, not that I can find). I had the need to format some code, and I didn't want to do it manually. Enter the "Auto Format" option in the Flash IDE.

I opened up the .as file in the IDE and hit the "Auto Format" button. A message popped up saying that the script contained syntax errors. Interesting... I clicked on the "Check Syntax" button and confirmed that "The script contains no errors." So now I had to try and isolate the problem. Here's what happened...

The first line of the external .as file looked like this:

class Tokenizer implements /*Serializable,*/ Iterator {

For one reason or another, the "Serializable" interface no longer needed to be implemented for the project. Instead of deleting the reference to it, the code was left in tact but commented out for future consideration. In theory, this shouldn't present a problem... but this is what made "Auto Format" choke.

The bug occurs when an "in-line" comment (/* */) appears in the "implements" list. The syntax for it is correct, but "Auto Format" doesn't know what to do with it. By simply removing the in-line comment (see below), the "Auto Format" functionality worked just fine.

class Tokenizer implements Iterator {

Time to make another bug report...

1 Comment

The AutoFormat messes up EVERY /**/ comment there is. It just shifts every multiline comment a couple of TABs to the right every time one does the beforementioned AutoFormat... why oh why ??

Leave a comment



About this Entry

This page contains a single entry by darron published on December 23, 2003 5:59 PM.

Breakin' the law... was the previous entry in this blog.

Merry Christmas is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Archives

OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.02