Donate Share

Prebop Multi-Language Preprocessor

Tracker: Bugs

5 string literals are not handled properly - ID: 1012214
Last Update: Comment added ( nobody )

In the class com.objfac.prebop.Expression.java, the
method makeLit(int) has a bug.
The position 'fPos' has to be incremented if it points
to a quote!

private Term makeLit(int c) throws PreprocessorError {
int quote = c;
StringBuffer buf = new StringBuffer();
while (fPos < fEnd && fBuf[fPos] != quote) {
buf.append((char)fBuf[fPos++]);
}
if (fPos == fEnd) {
return error("Unterminated string in expression ",
fBuf);
// added code starts here
} else if (fBuf[fPos] == quote) {
fPos++;
}
return new StringConstant(buf.toString());
}

Regards,
Pierce
ps.shah@datacomm.ch


Nobody/Anonymous ( nobody ) - 2004-08-19 14:12

5

Open

None

Nobody/Anonymous

None

None

Public


Comment ( 1 )




Date: 2006-02-09 15:50
Sender: nobody

Logged In: NO

It is possible to get around this by declaring all of your
string constants as variables that have the same name as the
value (e.g. <var name="Handset" value="Handset">) then you
can use them as if they were string literals and it will work

$if Handsets == Handsets $ (or whatever)


Log in to comment.

Attached File ( 1 )

Filename Description Download
Expression.java Expression.java Download

Change ( 1 )

Field Old Value Date By
File Added 98408: Expression.java 2004-08-19 14:12 nobody