Break up long strings automatically.

This commit is contained in:
Martin Haye
2016-05-19 09:31:05 +02:00
parent 0ca5045f7d
commit cd4bd80639

View File

@@ -2338,16 +2338,14 @@ class PackPartitions
def text = getSingle(getSingle(getSingle(blk.value, 'VALUE').block, null, 'text').field, 'TEXT').text()
// Break up long strings into shorter chunks for PLASMA
def chunks = text.findAll(/.{253}|.*/)
def chunks = text.findAll(/.{253}|.*/).grep(~/.+/)
chunks.eachWithIndex { chunk, idx ->
if (chunk.length() > 0) {
outIndented((idx == chunks.size()-1 && blk.@type == 'text_println') ? \
'scriptDisplayStrNL(' : 'scriptDisplayStr(')
emitString(chunk)
out << ")\n"
// Workaround for strings filling up the frame stack
outIndented("tossStrings()\n")
}
outIndented((idx == chunks.size()-1 && blk.@type == 'text_println') ? \
'scriptDisplayStrNL(' : 'scriptDisplayStr(')
emitString(chunk)
out << ")\n"
// Workaround for strings filling up the frame stack
outIndented("tossStrings()\n")
}
}