For multiline comments, delete the backslash instead of changing it to a space.

develop
expwnent 2015-01-26 19:24:31 -05:00
parent 1993c5fb1b
commit 4c5b6a5282
3 changed files with 3 additions and 3 deletions

@ -242,7 +242,7 @@ To include a double quote character, use ``\"`` inside double quotes.
If the first non-whitespace character of a line is ``#``, the line is treated If the first non-whitespace character of a line is ``#``, the line is treated
as a comment, i.e. a silent no-op command. as a comment, i.e. a silent no-op command.
When reading commands from dfhack.init or with the ``script`` command, if the final character on a line is a backslash then the next uncommented line is considered a continuation of that line, with the backslash converted to a space character. When reading commands from dfhack.init or with the ``script`` command, if the final character on a line is a backslash then the next uncommented line is considered a continuation of that line, with the backslash deleted.
Commented lines are skipped, so it is possible to comment out parts of a command with the ``#`` character. Commented lines are skipped, so it is possible to comment out parts of a command with the ``#`` character.
If the first non-whitespace character is ``:``, the command is parsed in a special If the first non-whitespace character is ``:``, the command is parsed in a special

@ -208,7 +208,7 @@ enable \
stocks \ stocks \
autochop \ autochop \
stockpiles stockpiles
#end a line with a backslash to make it continue to the next line. The \ is converted to a space for the final command. #end a line with a backslash to make it continue to the next line. The \ is deleted for the final command.
# Multiline commands are ONLY supported for scripts like dfhack.init. You cannot do multiline command manually on the DFHack console. # Multiline commands are ONLY supported for scripts like dfhack.init. You cannot do multiline command manually on the DFHack console.
# You cannot extend a commented line. # You cannot extend a commented line.
# You can comment out the extension of a line. # You can comment out the extension of a line.

@ -842,7 +842,7 @@ bool Core::loadScriptFile(color_ostream &out, string fname, bool silent)
temp = temp.substr(0,temp.length()-1); temp = temp.substr(0,temp.length()-1);
if ( temp.length() > 0 ) { if ( temp.length() > 0 ) {
if ( temp[temp.length()-1] == '\\' ) { if ( temp[temp.length()-1] == '\\' ) {
temp[temp.length()-1] = ' '; temp = temp.substr(0,temp.length()-1);
doMore = true; doMore = true;
} }
} }