Changeset 3848


Ignore:
Timestamp:
Jul 17, 2008, 4:11:54 PM (12 years ago)
Author:
yura
Message:
  • toString and tests are corrected.
Location:
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstAlt.java

    r3572 r3848  
    3636        StringBuffer strBuf = new StringBuffer();
    3737        strBuf.append(failMode.select("\\{", "{") + (sentenceList.length == 0 ? "" : " "));
    38         for (AstSentence sentence : sentenceList)
    39             strBuf.append(sentence + " ; ");
     38        for (AstSentence sentence : sentenceList) {
     39            strBuf.append(sentence);
     40            if (strBuf.length() > 0 && strBuf.charAt(strBuf.length() - 1) != ' ')
     41                strBuf.append(' ');
     42            strBuf.append("; ");
     43        }
    4044        strBuf.append("}");
    4145        return strBuf.toString();
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstResult.java

    r3570 r3848  
    2424    @Override
    2525    public String toString () {
    26         return (", " + expr).trim();
     26        return expr.toString();
    2727    }
    2828}
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstSentence.java

    r3572 r3848  
    1919        v.visit(this, e);
    2020    }
    21    
     21
    2222    @Override
    2323    public String toString () {
    2424        StringBuffer strBuf = new StringBuffer();
    25         boolean flag = false;
    2625        for (AstStatement statement : statementList) {
    27             if (flag)
     26            if (strBuf.length() > 0 && strBuf.charAt(strBuf.length() - 1) != ' ')
    2827                strBuf.append(' ');
    2928            strBuf.append(statement);
    30             flag = true;
    3129        }
    32         return strBuf.toString();
     30        return strBuf.toString().trim();
    3331    }
    3432}
Note: See TracChangeset for help on using the changeset viewer.