jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1179308 - in /incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/riot: system/RiotChars.java tokens/TokenizerText.java
Date Wed, 05 Oct 2011 16:37:39 GMT
Author: andy
Date: Wed Oct  5 16:37:38 2011
New Revision: 1179308

URL: http://svn.apache.org/viewvc?rev=1179308&view=rev
Log: (empty)

Modified:
    incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/riot/system/RiotChars.java
    incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/riot/tokens/TokenizerText.java

Modified: incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/riot/system/RiotChars.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/riot/system/RiotChars.java?rev=1179308&r1=1179307&r2=1179308&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/riot/system/RiotChars.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/riot/system/RiotChars.java Wed
Oct  5 16:37:38 2011
@@ -91,6 +91,11 @@ PN_LOCAL       ::=  ( PN_CHARS_U | [0-9]
         return isPNCharsBase(ch) || ( ch == '_' ) ;
     }
     
+    public static boolean isPNChars_U_N(int ch)
+    {
+        return isPNCharsBase(ch) || ( ch == '_' ) || isDigit(ch) ;
+    }
+    
     public static boolean isPNChars(int ch)
     {
         // #x00B7 | [#x0300-#x036F] | [#x203F-#x2040]

Modified: incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/riot/tokens/TokenizerText.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/riot/tokens/TokenizerText.java?rev=1179308&r1=1179307&r2=1179308&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/riot/tokens/TokenizerText.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/riot/tokens/TokenizerText.java
Wed Oct  5 16:37:38 2011
@@ -500,17 +500,26 @@ public final class TokenizerText impleme
     private String readLocalPart()
     { return readWordSub(true, false) ; }
 
-    private String readPrefixPart1()
+    private String readSegment(boolean isLocalPart)
     { 
-        // PN_CHARS_BASE ((PN_CHARS|'.')* PN_CHARS)?
+        // PN_CHARS_BASE          ((PN_CHARS|'.')* PN_CHARS)?
+        // ( PN_CHARS_U | [0-9] ) ((PN_CHARS|'.')* PN_CHARS)?
+        // RiotChars has isPNChars_U_N for   ( PN_CHARS_U | [0-9] )
         stringBuilder.setLength(0) ;
         
         // First character
         int ch = reader.peekChar() ;
         if ( ch == EOF )
             return "" ;
-        if ( ! RiotChars.isPNCharsBase(ch) )
-            return "" ;
+        if ( isLocalPart )
+        {
+            if ( ! RiotChars.isPNChars_U_N(ch) ) return "" ; 
+        }
+        else
+        {
+            if ( ! RiotChars.isPNCharsBase(ch) ) return "" ;
+        }
+        
         stringBuilder.append((char)ch) ;
         reader.readChar() ;
         



Mime
View raw message