|
From: <bc...@wo...> - 2001-11-26 20:21:45
|
[dman]
>| As an additional information point, my JDK1.2 and JDK1.3 also throws
>| exceptions, but JDK1.4 silently transform the character into the
>| unicode-undefined character.
>
>I'm not sure that is a good thing (jdk1.4), but maybe you don't have
>to deal with it. Consider someone who has some source in latin1 (or
>something else) and has
>
>a=F6c =3D "foo"
>a=FCc =3D "bar"
[I find it a little ironic that my mail agent can't deal any of the
newer mail encodings]
>If java uses UTF-8 as the encoding, then those two names
Non-ascii chars in identifiers? I know CPython sometimes allow that, but
that is not a feature I plan on adding.
>will end up
>being the same if jython will treat the unicode-undefined character as
>a regular character. This would be an additional condition that
>should raise an exception.
If you put the non-ascii chars inside the quotes then I agree with your
example and with your conclusion.
>| Yes. The generated tokenmanager catches all IOExceptions
>| (MalformedInputException is a subclass of IOException) and interprets
>| that as eof.
> [...]
>
>Couldn't you just catch that exception and print out a message then
>exit right before catching IOException?
There are 43 instances of caught IOException in
PythonGrammerTokenManager such as:
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_10(0, 0L, active1);
return 1;
}
We probably have to catch the MalformedInputException in the
ReaderCharStream and throw something that will get passed most of the
catch clauses in the parser.
regards,
finn
|