2009/2/20 Ben Schulz <[email protected]>: > >> Also there's an interesting little wrinkle with multiple "u" characters. > > I just looked at it, as far as I can tell it has to be one or more u's > and that's all. I implemented a java.io.Reader that handles the level > 1 escaping (+ line/column counting), I'd gladly share the code if > you're interested.
Yes it's not a big thing. Section 3.3 covers the problem quite well. Because there can be an arbitrary number of 'u' characters you have to scan past them to see if the character sequence is a Unicode escape or not. > > As for the string escape sequences; I handled those manually too > because the lexer is handwritten, but you might as well use > String.replace(String, String). Doesn't using String.replace(...) cause you problems with things like "\\t"? John Wilson --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---
