View previous topic :: View next topic |
Author |
Message |
Kuan Hsu
Joined: 15 Apr 2006 Posts: 143 Location: Taiwan
|
Posted: Sat Jun 10, 2006 11:19 pm Post subject: Parse error in poseidon source code. |
|
|
Thank for your wonderful work!
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. |
|
Back to top |
|
|
hasan
Joined: 02 May 2005 Posts: 58
|
Posted: Sat Jul 15, 2006 7:01 pm Post subject: |
|
|
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 |
|
|
Kuan Hsu
Joined: 15 Apr 2006 Posts: 143 Location: Taiwan
|
Posted: Mon Jul 17, 2006 9:42 am Post subject: |
|
|
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?
Thank you! |
|
Back to top |
|
|
hasan
Joined: 02 May 2005 Posts: 58
|
Posted: Mon Jul 17, 2006 7:25 pm Post subject: |
|
|
Thanks for the report |
|
Back to top |
|
|
|
|
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
|