FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

code reformatter error

 
Post new topic   Reply to topic     Forum Index -> Descent
View previous topic :: View next topic  
Author Message
vektorboson



Joined: 14 Sep 2006
Posts: 44

PostPosted: Sat Nov 07, 2009 12:18 pm    Post subject: code reformatter error Reply with quote

The code reformatter chokes on the following code:
Code:

static if(is(foo()))
{
}


It chokes on the parentheses of foo().

---------------------

Another one:

Code:

void bar()
{
    int[] arr;
    foreach(inout int a; arr)
    {
    }
}


Here the formatter chokes on the "inout int"

---------------------

Yet another one:

Code:

class Foo
{
  void foo()
  {
  };
}


Here it's the superfluous semicolon at the end of foo().

---------------------

I've got one more!

Code:

void foo()
{
  mixin T!();
}


Here the formatter has a problem with "mixin T!();".
Back to top
View user's profile Send private message
asterite



Joined: 01 Jun 2006
Posts: 235
Location: Buenos Aires, Argentina

PostPosted: Thu Nov 19, 2009 8:21 am    Post subject: Re: code reformatter error Reply with quote

vektorboson wrote:
The code reformatter chokes on the following code:
Code:

static if(is(foo()))
{
}


It chokes on the parentheses of foo().



And it's ok that it chokes because that's not allowed. I don't know why the parser allows it, though.

http://www.digitalmars.com/d/2.0/expression.html#IsExpression

vektorboson wrote:

---------------------

Another one:

Code:

void bar()
{
    int[] arr;
    foreach(inout int a; arr)
    {
    }
}


Here the formatter chokes on the "inout int"



Fixed!

vektorboson wrote:

---------------------

Yet another one:

Code:

class Foo
{
  void foo()
  {
  };
}


Here it's the superfluous semicolon at the end of foo().


Fixed!

vektorboson wrote:

---------------------

I've got one more!

Code:

void foo()
{
  mixin T!();
}


Here the formatter has a problem with "mixin T!();".


Fixed!

Thanks for these bug reports. I uploaded a new version with these fixes.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Descent All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group