Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 19, 2015, 12:39:06 PM (9 years ago)
Author:
maxima
Message:

Trunk(-r10279) merged to tutorial branch. Works now on ITET-Tardis.

Location:
code/branches/tutorial5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tutorial5

  • code/branches/tutorial5/src/libraries/core/Loader.cc

    r10273 r10280  
    470470                    //A newline directly after square brackets is ignored. To make sure that the string is printed
    471471                    //exactly as it is, including newlines at the beginning, insert a space after the brackets.
    472                     output << "print([" + equalSigns + "[ " + temp + ']' + equalSigns +"])";
     472                    bool needsExtraSpace = false;
     473                    if (temp.size() > 0 && (temp[0] == '\n' || temp[0] == '\r')) // begins with \n or \r (a line break)
     474                        needsExtraSpace = true;
     475                    output << "print([" + equalSigns + (needsExtraSpace ? "[ " : "[") + temp + ']' + equalSigns +"])";
    473476                    start = end + 5;
    474477                }
Note: See TracChangeset for help on using the changeset viewer.