[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/devtools/kdevelop4-extra-plugins/python/parser
From: Andreas Pakulat <apaku () gmx ! de>
Date: 2008-01-07 9:29:44
Message-ID: 1199698184.769814.6693.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 758230 by apaku:
I should really do a compile before comitting things.
M +12 -10 astbuilder.cpp
M +0 -1 astbuilder.h
--- trunk/playground/devtools/kdevelop4-extra-plugins/python/parser/astbuilder.cpp #758229:758230
@@ -1122,9 +1122,9 @@
{
qDebug() << "visitPower start";
visitNode( node->atom );
- AtomAst* atomast = safeNodeCast<AtomAst>( ast );
+ AtomAst* atomast = safeNodeCast<AtomAst>( mNodeStack.pop() );
mNodeStack.push( atomast );
- count = node->trailerSequence.count();
+ int count = node->trailerSequence->count();
if( count > 0 )
{
for( int i = 0; i < count; i++ )
@@ -1134,21 +1134,21 @@
PrimaryAst* prim = safeNodeCast<PrimaryAst>( mNodeStack.pop() );
switch( ast->astType )
{
- case CallAst:
- static_cast<CallAst>( ast )->primary = prim;
+ case Ast::CallAst:
+ static_cast<CallAst*>( ast )->callable = prim;
break;
case Ast::ExtendedSliceAst:
case Ast::SimpleSliceAst:
- static_cast<SliceAst>( ast )->primary = prim;
+ static_cast<SliceAst*>( ast )->primary = prim;
break;
case Ast::AttributeReferenceAst:
- static_cast<AttributeReferenceAst>( ast )->primary = prim;
+ static_cast<AttributeReferenceAst*>( ast )->primary = prim;
break;
case Ast::SubscriptAst:
- static_cast<SubscriptAst>( ast )->primary = prim;
+ static_cast<SubscriptAst*>( ast )->primary = prim;
break;
default:
- Q_ASSERT_X(false, "OOOPS visitTrailer returned a PrimaryAst that is not known to \
have a primary in front of it, like an AtomAst or something new."); + \
Q_ASSERT_X(false, "visitTrailer", "OOOPS visitTrailer returned a PrimaryAst that is not known to have a \
primary in front of it, like an AtomAst or something new."); break;
}
mNodeStack.push( ast );
@@ -1263,12 +1263,12 @@
{
qDebug() << "visitShiftExpr start";
visitNode( node->arithExpr );
+ int count = node->shiftOpListSequence->count();
if( count > 0 )
{
Q_ASSERT( count == node->arithExprListSequence->count() );
BinaryExpressionAst* ast = createAst<BinaryExpressionAst>( node );
ast->lhs = safeNodeCast<ExpressionAst>( mNodeStack.pop() );
- count = node->shiftOpListSequence->count();
BinaryExpressionAst* cur = ast;
for( int i = 0; i < count; i++ )
{
@@ -1280,6 +1280,8 @@
case PythonParser::RightShiftOp:
cur->opType = ArithmeticExpressionAst::BinaryRightShift;
break;
+ default:
+ Q_ASSERT_X(false, "visitShiftExpr", "OOOPS, shift operator was something other than \
left or right shifting!"); }
visitNode( node->arithExprListSequence->at( i )->element );
if( i == count - 1 )
@@ -1288,7 +1290,7 @@
}else
{
cur->rhs = createAst<BinaryExpressionAst>( node->arithExprListSequence->at( i )->element \
);
- cur = cur->rhs;
+ cur = safeNodeCast<BinaryExpressionAst>( cur->rhs );
cur->lhs = safeNodeCast<ExpressionAst>( mNodeStack.pop() );
}
}
--- trunk/playground/devtools/kdevelop4-extra-plugins/python/parser/astbuilder.h #758229:758230
@@ -100,7 +100,6 @@
virtual void visitRaiseStmt(PythonParser::RaiseStmtAst *node);
virtual void visitReturnStmt(PythonParser::ReturnStmtAst *node);
virtual void visitShiftExpr(PythonParser::ShiftExprAst *node);
- virtual void visitShiftOp(PythonParser::ShiftOpAst *node);
virtual void visitSimpleStmt(PythonParser::SimpleStmtAst *node);
virtual void visitSliceop(PythonParser::SliceopAst *node);
virtual void visitSmallStmt(PythonParser::SmallStmtAst *node);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic