#214 \u in comment creates problems

open
nobody
Parsing (77)
5
2005-04-26
2005-04-26
Anonymous
No

I got the following error while using the beanshell
interpreter.The problem was caused because i had the
character sequence "\uXYZ" as
part of a comment in the script file.

Here is an example script that caused the problem.
---START-----------------------------------------------------------------------------------
// this is an \ugly comment

/*
* this is another \ugly comment
*/

String getResult(String input)
{
return "test";
}
--END-------------------------------------------------------------------------------------

Exception message.

--START-----------------------------------------------------------------------------------------------
Stack Trace:
java.lang.Error: Invalid escape character at line 1
column 16.
at bsh.JavaCharStream.readChar(Unknown Source)
at bsh.ParserTokenManager.jjMoveNfa_0(Unknown
Source)
at bsh.ParserTokenManager.jjStartNfa_0(Unknown
Source)
at
bsh.ParserTokenManager.jjMoveStringLiteralDfa1_0(Unknown
Source)
at
bsh.ParserTokenManager.jjMoveStringLiteralDfa0_0(Unknown
Source)
at bsh.ParserTokenManager.getNextToken(Unknown
Source)
at bsh.Parser.jj_ntk(Unknown Source)
at bsh.Parser.Line(Unknown Source)
at bsh.Interpreter.Line(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
--END-----------------------------------------------------------------------------------------------

I have tested this with bsh-2.0b1.jar and
bsh-2.0b2.jar. Both had the above mentioned problem.

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks