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

Parse error in poseidon source code.

 
Post new topic   Reply to topic     Forum Index -> Code Analyzer
View previous topic :: View next topic  
Author Message
Kuan Hsu



Joined: 15 Apr 2006
Posts: 143
Location: Taiwan

PostPosted: Sat Jun 10, 2006 11:19 pm    Post subject: Parse error in poseidon source code. Reply with quote

Thank for your wonderful work! Very Happy

I'm trying use CodeAnalyzer into Poseidon project, but when parse Function Literals -- delegate, some error happen.

Code:

int abc(void delegate(long i));

void tests()
{   int b = 3;

    abc( delegate (long c) {}  ); // abc( delegate void(long c) {}  );
}

It complie well, but parse error, but I declare the type "void" manually, they work both well. Sad
Back to top
View user's profile Send private message Send e-mail
hasan



Joined: 02 May 2005
Posts: 58

PostPosted: Sat Jul 15, 2006 7:01 pm    Post subject: Reply with quote

Sorry for such late reply!

I just looked into it, it's a silly bug.
in FunctionLiteral.parse
when the check for
Code:

else if( ts.next( TOK.Topenparen ) )

succeeds, it should parse the "Parameters" rule, but instead, it parses the "Parameter" rule (the s makes all the difference). Silly typo.

Fixed.
Back to top
View user's profile Send private message
Kuan Hsu



Joined: 15 Apr 2006
Posts: 143
Location: Taiwan

PostPosted: Mon Jul 17, 2006 9:42 am    Post subject: Reply with quote

Thank for your reply, it's work!!

There are some bugs( maybe.... ) in reversion 19:

1. In statements.d(814), the WithStatement, maybe addChild( new Statement(ts) ) instead of addChild( new StatementBlock(ts) ).
Code:

with( ss ) add(); // compile well, but parse error

with( ss )  // compile and parse both well
{
    add();
}


2. When use NestingComment /+ ~ +/, if lack of +/, infinite loop is happened.
For Poseidon use, I add
Code:

if( ts.reachedEnd() ) throw new Exception( "EOF error." );

in while-loop of class Statements and class AsmInstructionList (statements.d )

Code:

if( sc.reachedEnd() ) break;

in while-loop of TOK scanNestingComment( TextScanner sc ) (whitespace.d)

Then it can throw error message, it seems to work, but I don't know the method is right or not? Embarassed

Thank you! Very Happy
Back to top
View user's profile Send private message Send e-mail
hasan



Joined: 02 May 2005
Posts: 58

PostPosted: Mon Jul 17, 2006 7:25 pm    Post subject: Reply with quote

Thanks for the report
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Code Analyzer 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