You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2010/01/06 22:06:04 UTC

svn commit: r896670 - in /tapestry/tapestry5/trunk: tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/ tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/

Author: hlship
Date: Wed Jan  6 21:06:02 2010
New Revision: 896670

URL: http://svn.apache.org/viewvc?rev=896670&view=rev
Log:
TAP5-905: Tapestry should support the full range of Unicode characters acceptible by Java as property names

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionLexer.g
    tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassNameLocatorImpl.java
    tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/InternalUtils.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionLexer.g
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionLexer.g?rev=896670&r1=896669&r2=896670&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionLexer.g (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionLexer.g Wed Jan  6 21:06:02 2010
@@ -1,4 +1,4 @@
-// Copyright 2008 The Apache Software Foundation
+// Copyright 2008, 2010 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -91,7 +91,32 @@
 THIS	:	T H I S;
 
 IDENTIFIER 
-	:	LETTER (LETTER | DIGIT | '_')*;
+    :   JAVA_ID_START (JAVA_ID_PART)*
+    ;
+
+fragment
+JAVA_ID_START
+    :  '\u0024'
+    |  '\u0041'..'\u005a'
+    |  '\u005f'
+    |  '\u0061'..'\u007a'
+    |  '\u00c0'..'\u00d6'
+    |  '\u00d8'..'\u00f6'
+    |  '\u00f8'..'\u00ff'
+    |  '\u0100'..'\u1fff'
+    |  '\u3040'..'\u318f'
+    |  '\u3300'..'\u337f'
+    |  '\u3400'..'\u3d2d'
+    |  '\u4e00'..'\u9fff'
+    |  '\uf900'..'\ufaff'
+    ;
+
+fragment
+JAVA_ID_PART
+    :  JAVA_ID_START
+    |  '\u0030'..'\u0039'
+    ;
+
 
 // The Safe Dereference operator understands not to de-reference through
 // a null.

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassNameLocatorImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassNameLocatorImpl.java?rev=896670&r1=896669&r2=896670&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassNameLocatorImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassNameLocatorImpl.java Wed Jan  6 21:06:02 2010
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008 The Apache Software Foundation
+// Copyright 2007, 2008, 2010 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -40,9 +40,9 @@
 
     // This matches normal class files but not inner class files (which contain a '$'.
 
-    private final Pattern CLASS_NAME_PATTERN = Pattern.compile("^[_a-z][a-z0-9_]*\\.class$", Pattern.CASE_INSENSITIVE);
+    private final Pattern CLASS_NAME_PATTERN = Pattern.compile("^\\p{javaJavaIdentifierStart}[\\p{javaJavaIdentifierPart}&&[^\\$]]*\\.class$", Pattern.CASE_INSENSITIVE);
 
-    private final Pattern FOLDER_NAME_PATTERN = Pattern.compile("^[_a-z][a-z0-9_]*$", Pattern.CASE_INSENSITIVE);
+    private final Pattern FOLDER_NAME_PATTERN = Pattern.compile("^\\p{javaJavaIdentifierStart}[\\p{javaJavaIdentifierPart}]*$", Pattern.CASE_INSENSITIVE);
 
     static class Queued
     {

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/InternalUtils.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/InternalUtils.java?rev=896670&r1=896669&r2=896670&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/InternalUtils.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/InternalUtils.java Wed Jan  6 21:06:02 2010
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2009 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2009, 2010 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -50,7 +50,7 @@
     /**
      * Pattern used to eliminate leading and trailing underscores and dollar signs.
      */
-    private static final Pattern NAME_PATTERN = Pattern.compile("^[_|$]*([\\w|$]+?)[_|$]*$", Pattern.CASE_INSENSITIVE);
+    private static final Pattern NAME_PATTERN = Pattern.compile("^[_|$]*([\\p{javaJavaIdentifierPart}]+?)[_|$]*$", Pattern.CASE_INSENSITIVE);
 
     /**
      * Converts a method to a user presentable string using a {@link ClassFactory} to obtain a {@link Location} (where