Ignore:
Timestamp:
Jan 27, 2008, 4:14:24 PM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Oliver Hunt.

Patch for http://bugs.webkit.org/show_bug.cgi?id=17025
nodes.h/cpp has been rolling around in the mud - lets hose it down

  • Rename member variables to use the m_ prefix.

(NOTE: Specific changed functions elided for space and clarity)

  • kjs/grammar.y:
  • kjs/nodes.cpp:
  • kjs/nodes.h:
  • kjs/nodes2string.cpp:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes2string.cpp

    r29815 r29825  
    326326void ResolveNode::streamTo(SourceStream& s) const
    327327{
    328     s << ident;
     328    s << m_ident;
    329329}
    330330
    331331void ElementNode::streamTo(SourceStream& s) const
    332332{
    333     for (const ElementNode* n = this; n; n = n->next.get()) {
    334         for (int i = 0; i < n->elision; i++)
     333    for (const ElementNode* n = this; n; n = n->m_next.get()) {
     334        for (int i = 0; i < n->m_elision; i++)
    335335            s << ',';
    336         s << PrecAssignment << n->node;
    337         if (n->next)
     336        s << PrecAssignment << n->m_node;
     337        if (n->m_next)
    338338            s << ',';
    339339    }
     
    342342void ArrayNode::streamTo(SourceStream& s) const
    343343{
    344     s << '[' << element;
    345     for (int i = 0; i < elision; i++)
     344    s << '[' << m_element;
     345    for (int i = 0; i < m_elision; i++)
    346346        s << ',';
    347347    // Parser consumes one elision comma if there's array elements
    348348    // present in the expression.
    349     if (opt && element)
     349    if (m_opt && m_element)
    350350        s << ',';
    351351    s << ']';
     
    354354void ObjectLiteralNode::streamTo(SourceStream& s) const
    355355{
    356     if (list)
    357         s << "{ " << list << " }";
     356    if (m_list)
     357        s << "{ " << m_list << " }";
    358358    else
    359359        s << "{ }";
     
    362362void PropertyListNode::streamTo(SourceStream& s) const
    363363{
    364     s << node;
    365     for (const PropertyListNode* n = next.get(); n; n = n->next.get())
    366         s << ", " << n->node;
     364    s << m_node;
     365    for (const PropertyListNode* n = m_next.get(); n; n = n->m_next.get())
     366        s << ", " << n->m_node;
    367367}
    368368
    369369void PropertyNode::streamTo(SourceStream& s) const
    370370{
    371     switch (type) {
     371    switch (m_type) {
    372372        case Constant: {
    373373            UString propertyName = name().ustring();
     
    376376            else
    377377                s << '"' << escapeStringForPrettyPrinting(propertyName) << '"';
    378             s << ": " << PrecAssignment << assign;
     378            s << ": " << PrecAssignment << m_assign;
    379379            break;
    380380        }
    381381        case Getter:
    382382        case Setter: {
    383             const FuncExprNode* func = static_cast<const FuncExprNode*>(assign.get());
    384             if (type == Getter)
     383            const FuncExprNode* func = static_cast<const FuncExprNode*>(m_assign.get());
     384            if (m_type == Getter)
    385385                s << "get ";
    386386            else
    387387                s << "set ";
    388388            s << escapeStringForPrettyPrinting(name().ustring())
    389                 << "(" << func->param << ')' << func->body;
     389                << "(" << func->m_parameter << ')' << func->m_body;
    390390            break;
    391391        }
     
    395395void BracketAccessorNode::streamTo(SourceStream& s) const
    396396{
    397     bracketNodeStreamTo(s, expr1, expr2);
     397    bracketNodeStreamTo(s, m_base, m_subscript);
    398398}
    399399
    400400void DotAccessorNode::streamTo(SourceStream& s) const
    401401{
    402     dotNodeStreamTo(s, expr, ident);
     402    dotNodeStreamTo(s, m_base, m_ident);
    403403}
    404404
    405405void ArgumentListNode::streamTo(SourceStream& s) const
    406406{
    407     s << PrecAssignment << expr;
    408     for (ArgumentListNode* n = next.get(); n; n = n->next.get())
    409         s << ", " << PrecAssignment << n->expr;
     407    s << PrecAssignment << m_expr;
     408    for (ArgumentListNode* n = m_next.get(); n; n = n->m_next.get())
     409        s << ", " << PrecAssignment << n->m_expr;
    410410}
    411411
    412412void ArgumentsNode::streamTo(SourceStream& s) const
    413413{
    414     s << '(' << listNode << ')';
     414    s << '(' << m_listNode << ')';
    415415}
    416416
    417417void NewExprNode::streamTo(SourceStream& s) const
    418418{
    419     s << "new " << PrecMember << expr << args;
     419    s << "new " << PrecMember << m_expr << m_args;
    420420}
    421421
    422422void FunctionCallValueNode::streamTo(SourceStream& s) const
    423423{
    424     s << PrecCall << expr << args;
     424    s << PrecCall << m_expr << m_args;
    425425}
    426426
    427427void FunctionCallResolveNode::streamTo(SourceStream& s) const
    428428{
    429     s << ident << args;
     429    s << m_ident << m_args;
    430430}
    431431
    432432void FunctionCallBracketNode::streamTo(SourceStream& s) const
    433433{
    434     bracketNodeStreamTo(s, base, subscript);
    435     s << args;
     434    bracketNodeStreamTo(s, m_base, m_subscript);
     435    s << m_args;
    436436}
    437437
    438438void FunctionCallDotNode::streamTo(SourceStream& s) const
    439439{
    440     dotNodeStreamTo(s, base, ident);
    441     s << args;
     440    dotNodeStreamTo(s, m_base, m_ident);
     441    s << m_args;
    442442}
    443443
     
    509509void VoidNode::streamTo(SourceStream& s) const
    510510{
    511     s << "void " << PrecUnary << expr;
     511    s << "void " << PrecUnary << m_expr;
    512512}
    513513
     
    571571void NegateNode::streamTo(SourceStream& s) const
    572572{
    573     s << "- " << PrecUnary << expr;
     573    s << "- " << PrecUnary << m_expr;
    574574}
    575575
    576576void BitwiseNotNode::streamTo(SourceStream& s) const
    577577{
    578     s << "~" << PrecUnary << expr;
     578    s << "~" << PrecUnary << m_expr;
    579579}
    580580
    581581void LogicalNotNode::streamTo(SourceStream& s) const
    582582{
    583     s << "!" << PrecUnary << expr;
     583    s << "!" << PrecUnary << m_expr;
    584584}
    585585
    586586void MultNode::streamTo(SourceStream& s) const
    587587{
    588     streamLeftAssociativeBinaryOperator(s, precedence(), "*", term1, term2);
     588    streamLeftAssociativeBinaryOperator(s, precedence(), "*", m_term1, m_term2);
    589589}
    590590
    591591void DivNode::streamTo(SourceStream& s) const
    592592{
    593     streamLeftAssociativeBinaryOperator(s, precedence(), "/", term1, term2);
     593    streamLeftAssociativeBinaryOperator(s, precedence(), "/", m_term1, m_term2);
    594594}
    595595
    596596void ModNode::streamTo(SourceStream& s) const
    597597{
    598     streamLeftAssociativeBinaryOperator(s, precedence(), "%", term1, term2);
     598    streamLeftAssociativeBinaryOperator(s, precedence(), "%", m_term1, m_term2);
    599599}
    600600
    601601void AddNode::streamTo(SourceStream& s) const
    602602{
    603     streamLeftAssociativeBinaryOperator(s, precedence(), "+", term1, term2);
     603    streamLeftAssociativeBinaryOperator(s, precedence(), "+", m_term1, m_term2);
    604604}
    605605
    606606void SubNode::streamTo(SourceStream& s) const
    607607{
    608     streamLeftAssociativeBinaryOperator(s, precedence(), "-", term1, term2);
     608    streamLeftAssociativeBinaryOperator(s, precedence(), "-", m_term1, m_term2);
    609609}
    610610
    611611void LeftShiftNode::streamTo(SourceStream& s) const
    612612{
    613     streamLeftAssociativeBinaryOperator(s, precedence(), "<<", term1, term2);
     613    streamLeftAssociativeBinaryOperator(s, precedence(), "<<", m_term1, m_term2);
    614614}
    615615
    616616void RightShiftNode::streamTo(SourceStream& s) const
    617617{
    618     streamLeftAssociativeBinaryOperator(s, precedence(), ">>", term1, term2);
     618    streamLeftAssociativeBinaryOperator(s, precedence(), ">>", m_term1, m_term2);
    619619}
    620620
    621621void UnsignedRightShiftNode::streamTo(SourceStream& s) const
    622622{
    623     streamLeftAssociativeBinaryOperator(s, precedence(), ">>>", term1, term2);
     623    streamLeftAssociativeBinaryOperator(s, precedence(), ">>>", m_term1, m_term2);
    624624}
    625625
    626626void LessNode::streamTo(SourceStream& s) const
    627627{
    628     streamLeftAssociativeBinaryOperator(s, precedence(), "<", expr1, expr2);
     628    streamLeftAssociativeBinaryOperator(s, precedence(), "<", m_expr1, m_expr2);
    629629}
    630630
    631631void GreaterNode::streamTo(SourceStream& s) const
    632632{
    633     streamLeftAssociativeBinaryOperator(s, precedence(), ">", expr1, expr2);
     633    streamLeftAssociativeBinaryOperator(s, precedence(), ">", m_expr1, m_expr2);
    634634}
    635635
    636636void LessEqNode::streamTo(SourceStream& s) const
    637637{
    638     streamLeftAssociativeBinaryOperator(s, precedence(), "<=", expr1, expr2);
     638    streamLeftAssociativeBinaryOperator(s, precedence(), "<=", m_expr1, m_expr2);
    639639}
    640640
    641641void GreaterEqNode::streamTo(SourceStream& s) const
    642642{
    643     streamLeftAssociativeBinaryOperator(s, precedence(), ">=", expr1, expr2);
     643    streamLeftAssociativeBinaryOperator(s, precedence(), ">=", m_expr1, m_expr2);
    644644}
    645645
    646646void InstanceOfNode::streamTo(SourceStream& s) const
    647647{
    648     streamLeftAssociativeBinaryOperator(s, precedence(), "instanceof", expr1, expr2);
     648    streamLeftAssociativeBinaryOperator(s, precedence(), "instanceof", m_expr1, m_expr2);
    649649}
    650650
    651651void InNode::streamTo(SourceStream& s) const
    652652{
    653     streamLeftAssociativeBinaryOperator(s, precedence(), "in", expr1, expr2);
     653    streamLeftAssociativeBinaryOperator(s, precedence(), "in", m_expr1, m_expr2);
    654654}
    655655
    656656void EqualNode::streamTo(SourceStream& s) const
    657657{
    658     streamLeftAssociativeBinaryOperator(s, precedence(), "==", expr1, expr2);
     658    streamLeftAssociativeBinaryOperator(s, precedence(), "==", m_expr1, m_expr2);
    659659}
    660660
    661661void NotEqualNode::streamTo(SourceStream& s) const
    662662{
    663     streamLeftAssociativeBinaryOperator(s, precedence(), "!=", expr1, expr2);
     663    streamLeftAssociativeBinaryOperator(s, precedence(), "!=", m_expr1, m_expr2);
    664664}
    665665
    666666void StrictEqualNode::streamTo(SourceStream& s) const
    667667{
    668     streamLeftAssociativeBinaryOperator(s, precedence(), "===", expr1, expr2);
     668    streamLeftAssociativeBinaryOperator(s, precedence(), "===", m_expr1, m_expr2);
    669669}
    670670
    671671void NotStrictEqualNode::streamTo(SourceStream& s) const
    672672{
    673     streamLeftAssociativeBinaryOperator(s, precedence(), "!==", expr1, expr2);
     673    streamLeftAssociativeBinaryOperator(s, precedence(), "!==", m_expr1, m_expr2);
    674674}
    675675
    676676void BitAndNode::streamTo(SourceStream& s) const
    677677{
    678     streamLeftAssociativeBinaryOperator(s, precedence(), "&", expr1, expr2);
     678    streamLeftAssociativeBinaryOperator(s, precedence(), "&", m_expr1, m_expr2);
    679679}
    680680
    681681void BitXOrNode::streamTo(SourceStream& s) const
    682682{
    683     streamLeftAssociativeBinaryOperator(s, precedence(), "^", expr1, expr2);
     683    streamLeftAssociativeBinaryOperator(s, precedence(), "^", m_expr1, m_expr2);
    684684}
    685685
    686686void BitOrNode::streamTo(SourceStream& s) const
    687687{
    688     streamLeftAssociativeBinaryOperator(s, precedence(), "|", expr1, expr2);
     688    streamLeftAssociativeBinaryOperator(s, precedence(), "|", m_expr1, m_expr2);
    689689}
    690690
    691691void LogicalAndNode::streamTo(SourceStream& s) const
    692692{
    693     streamLeftAssociativeBinaryOperator(s, precedence(), "&&", expr1, expr2);
     693    streamLeftAssociativeBinaryOperator(s, precedence(), "&&", m_expr1, m_expr2);
    694694}
    695695
    696696void LogicalOrNode::streamTo(SourceStream& s) const
    697697{
    698     streamLeftAssociativeBinaryOperator(s, precedence(), "||", expr1, expr2);
     698    streamLeftAssociativeBinaryOperator(s, precedence(), "||", m_expr1, m_expr2);
    699699}
    700700
    701701void ConditionalNode::streamTo(SourceStream& s) const
    702702{
    703     s << PrecLogicalOr << logical
    704         << " ? " << PrecAssignment << expr1
    705         << " : " << PrecAssignment << expr2;
     703    s << PrecLogicalOr << m_logical
     704        << " ? " << PrecAssignment << m_expr1
     705        << " : " << PrecAssignment << m_expr2;
    706706}
    707707
     
    748748void CommaNode::streamTo(SourceStream& s) const
    749749{
    750     s << PrecAssignment << expr1 << ", " << PrecAssignment << expr2;
     750    s << PrecAssignment << m_expr1 << ", " << PrecAssignment << m_expr2;
    751751}
    752752
    753753void ConstDeclNode::streamTo(SourceStream& s) const
    754754{
    755     s << ident;
    756     if (init)
    757         s << " = " << init;
    758     for (ConstDeclNode* n = next.get(); n; n = n->next.get()) {
    759         s << ", " << ident;
    760         if (init)
    761             s << " = " << init;
     755    s << m_ident;
     756    if (m_init)
     757        s << " = " << m_init;
     758    for (ConstDeclNode* n = m_next.get(); n; n = n->m_next.get()) {
     759        s << ", " << m_ident;
     760        if (m_init)
     761            s << " = " << m_init;
    762762    }
    763763}
     
    765765void ConstStatementNode::streamTo(SourceStream& s) const
    766766{
    767     s << Endl << "const " << next << ';';
     767    s << Endl << "const " << m_next << ';';
    768768}
    769769
     
    810810void ExprStatementNode::streamTo(SourceStream& s) const
    811811{
    812     s << Endl << expr << ';';
     812    s << Endl << m_expr << ';';
    813813}
    814814
    815815void VarStatementNode::streamTo(SourceStream& s) const
    816816{
    817     s << Endl << "var " << expr << ';';
     817    s << Endl << "var " << m_expr << ';';
    818818}
    819819
     
    831831void DoWhileNode::streamTo(SourceStream& s) const
    832832{
    833     s << Endl << "do " << Indent << statement << Unindent << Endl
    834         << "while (" << expr << ");";
     833    s << Endl << "do " << Indent << m_statement << Unindent << Endl
     834        << "while (" << m_expr << ");";
    835835}
    836836
    837837void WhileNode::streamTo(SourceStream& s) const
    838838{
    839     s << Endl << "while (" << expr << ')' << Indent << statement << Unindent;
     839    s << Endl << "while (" << m_expr << ')' << Indent << m_statement << Unindent;
    840840}
    841841
     
    843843{
    844844    s << Endl << "for ("
    845         << (expr1WasVarDecl ? "var " : "")
    846         << expr1
    847         << "; " << expr2
    848         << "; " << expr3
    849         << ')' << Indent << statement << Unindent;
     845        << (m_expr1WasVarDecl ? "var " : "")
     846        << m_expr1
     847        << "; " << m_expr2
     848        << "; " << m_expr3
     849        << ')' << Indent << m_statement << Unindent;
    850850}
    851851
     
    853853{
    854854    s << Endl << "for (";
    855     if (identIsVarDecl) {
     855    if (m_identIsVarDecl) {
    856856        s << "var ";
    857         if (init)
    858             s << init;
     857        if (m_init)
     858            s << m_init;
    859859        else
    860             s << PrecLeftHandSide << lexpr;
     860            s << PrecLeftHandSide << m_lexpr;
    861861    } else
    862         s << PrecLeftHandSide << lexpr;
    863 
    864     s << " in " << expr << ')' << Indent << statement << Unindent;
     862        s << PrecLeftHandSide << m_lexpr;
     863
     864    s << " in " << m_expr << ')' << Indent << m_statement << Unindent;
    865865}
    866866
     
    868868{
    869869    s << Endl << "continue";
    870     if (!ident.isNull())
    871         s << ' ' << ident;
     870    if (!m_ident.isNull())
     871        s << ' ' << m_ident;
    872872    s << ';';
    873873}
     
    876876{
    877877    s << Endl << "break";
    878     if (!ident.isNull())
    879         s << ' ' << ident;
     878    if (!m_ident.isNull())
     879        s << ' ' << m_ident;
    880880    s << ';';
    881881}
     
    884884{
    885885    s << Endl << "return";
    886     if (value)
    887         s << ' ' << value;
     886    if (m_value)
     887        s << ' ' << m_value;
    888888    s << ';';
    889889}
     
    891891void WithNode::streamTo(SourceStream& s) const
    892892{
    893     s << Endl << "with (" << expr << ") " << statement;
     893    s << Endl << "with (" << m_expr << ") " << m_statement;
    894894}
    895895
     
    897897{
    898898    s << Endl;
    899     if (expr)
    900         s << "case " << expr;
     899    if (m_expr)
     900        s << "case " << m_expr;
    901901    else
    902902        s << "default";
     
    914914void CaseBlockNode::streamTo(SourceStream& s) const
    915915{
    916     for (const ClauseListNode* n = list1.get(); n; n = n->getNext())
     916    for (const ClauseListNode* n = m_list1.get(); n; n = n->getNext())
    917917        s << n->getClause();
    918     s << def;
    919     for (const ClauseListNode* n = list2.get(); n; n = n->getNext())
     918    s << m_defaultClause;
     919    for (const ClauseListNode* n = m_list2.get(); n; n = n->getNext())
    920920        s << n->getClause();
    921921}
     
    923923void SwitchNode::streamTo(SourceStream& s) const
    924924{
    925     s << Endl << "switch (" << expr << ") {"
    926         << Indent << block << Unindent
     925    s << Endl << "switch (" << m_expr << ") {"
     926        << Indent << m_block << Unindent
    927927        << Endl << "}";
    928928}
     
    930930void LabelNode::streamTo(SourceStream& s) const
    931931{
    932     s << Endl << label << ":" << Indent << statement << Unindent;
     932    s << Endl << m_label << ":" << Indent << m_statement << Unindent;
    933933}
    934934
    935935void ThrowNode::streamTo(SourceStream& s) const
    936936{
    937     s << Endl << "throw " << expr << ';';
     937    s << Endl << "throw " << m_expr << ';';
    938938}
    939939
    940940void TryNode::streamTo(SourceStream& s) const
    941941{
    942     s << Endl << "try " << tryBlock;
    943     if (catchBlock)
    944         s << Endl << "catch (" << exceptionIdent << ')' << catchBlock;
    945     if (finallyBlock)
    946         s << Endl << "finally " << finallyBlock;
     942    s << Endl << "try " << m_tryBlock;
     943    if (m_catchBlock)
     944        s << Endl << "catch (" << m_exceptionIdent << ')' << m_catchBlock;
     945    if (m_finallyBlock)
     946        s << Endl << "finally " << m_finallyBlock;
    947947}
    948948
    949949void ParameterNode::streamTo(SourceStream& s) const
    950950{
    951     s << id;
    952     for (ParameterNode* n = next.get(); n; n = n->next.get())
    953         s << ", " << n->id;
     951    s << m_ident;
     952    for (ParameterNode* n = m_next.get(); n; n = n->m_next.get())
     953        s << ", " << n->m_ident;
    954954}
    955955
    956956void FuncDeclNode::streamTo(SourceStream& s) const
    957957{
    958     s << Endl << "function " << ident << '(' << param << ')' << body;
     958    s << Endl << "function " << m_ident << '(' << m_parameter << ')' << m_body;
    959959}
    960960
    961961void FuncExprNode::streamTo(SourceStream& s) const
    962962{
    963     s << "function " << ident << '(' << param << ')' << body;
     963    s << "function " << m_ident << '(' << m_parameter << ')' << m_body;
    964964}
    965965
Note: See TracChangeset for help on using the changeset viewer.