diff options
author | James Iry <jamesiry@gmail.com> | 2013-02-08 06:49:10 -0800 |
---|---|---|
committer | James Iry <jamesiry@gmail.com> | 2013-02-08 06:49:10 -0800 |
commit | abc87e25d9a8030ed65677df9b41f302025c1717 (patch) | |
tree | dec411c97d84b22ad2d18d03dd0ba77cc58e6bda /src/library | |
parent | 9164c2af4183e04986eb652e09081daba3d0d279 (diff) | |
parent | 6052e19292c95270ac0a4bf30b6df47a257f88d4 (diff) | |
download | scala-abc87e25d9a8030ed65677df9b41f302025c1717.tar.gz scala-abc87e25d9a8030ed65677df9b41f302025c1717.tar.bz2 scala-abc87e25d9a8030ed65677df9b41f302025c1717.zip |
Merge pull request #2091 from JamesIry/2.10.x_SI-6478
[backport] SI-6478 Fixing JavaTokenParser ident
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/util/parsing/combinator/JavaTokenParsers.scala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/library/scala/util/parsing/combinator/JavaTokenParsers.scala b/src/library/scala/util/parsing/combinator/JavaTokenParsers.scala index 78817cfb67..89832d3fb2 100644 --- a/src/library/scala/util/parsing/combinator/JavaTokenParsers.scala +++ b/src/library/scala/util/parsing/combinator/JavaTokenParsers.scala @@ -21,11 +21,12 @@ import scala.annotation.migration * - `floatingPointNumber` */ trait JavaTokenParsers extends RegexParsers { - /** Anything starting with an ASCII alphabetic character or underscore, - * followed by zero or more repetitions of regex's `\w`. + /** Anything that is a valid Java identifier, according to + * <a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.8">The Java Language Spec</a>. + * Generally, this means a letter, followed by zero or more letters or numbers. */ def ident: Parser[String] = - """[a-zA-Z_]\w*""".r + """\p{javaJavaIdentifierStart}\p{javaJavaIdentifierPart}*""".r /** An integer, without sign or with a negative sign. */ def wholeNumber: Parser[String] = """-?\d+""".r |