mirror of
https://github.com/fadden/ciderpress.git
synced 2024-11-22 20:31:08 +00:00
Handle carriage returns in REM statements
With a bit of hex-editing it's possible to embed carriage returns in REM statements. The reformatter wasn't handling that well. The new output matches what LIST generates. The output generated cannot be imported by the text-to-BASIC importer because it doesn't understand the blank lines. The output generated before this change didn't work either, though that was a bit harder to figure out because the CRs are harder to see in Windows than CRLF. It should be possible to teach the importer to handle such files, though I think these files are pretty rare -- I happened to find them in some Peter Watson freeware.
This commit is contained in:
parent
a2c15eee55
commit
5498a4e835
@ -170,7 +170,7 @@ int ReformatApplesoft::Process(const ReformatHolder* pHolder,
|
|||||||
inRem = true;
|
inRem = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* simple chracter */
|
/* simple character */
|
||||||
if (fUseRTF) {
|
if (fUseRTF) {
|
||||||
if (*srcPtr == '"' && !inRem) {
|
if (*srcPtr == '"' && !inRem) {
|
||||||
if (!inQuote) {
|
if (!inQuote) {
|
||||||
@ -185,11 +185,17 @@ int ReformatApplesoft::Process(const ReformatHolder* pHolder,
|
|||||||
RTFSetColor(kColonColor);
|
RTFSetColor(kColonColor);
|
||||||
RTFPrintChar(*srcPtr);
|
RTFPrintChar(*srcPtr);
|
||||||
RTFSetColor(kDefaultColor);
|
RTFSetColor(kDefaultColor);
|
||||||
|
} else if (inRem && *srcPtr == '\r') {
|
||||||
|
RTFNewPara();
|
||||||
} else {
|
} else {
|
||||||
RTFPrintChar(*srcPtr);
|
RTFPrintChar(*srcPtr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BufPrintf("%c", *srcPtr);
|
if (inRem && *srcPtr == '\r') {
|
||||||
|
BufPrintf("\r\n");
|
||||||
|
} else {
|
||||||
|
BufPrintf("%c", *srcPtr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user