jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [2/4] jena git commit: JENA-1318: Parse error for unterminated list
Date Wed, 12 Apr 2017 09:49:34 GMT
JENA-1318: Parse error for unterminated list


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/7c280ddc
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/7c280ddc
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/7c280ddc

Branch: refs/heads/master
Commit: 7c280ddc590756ae1418ba9e2e281d31ab67df4e
Parents: f4076ed
Author: Andy Seaborne <andy@apache.org>
Authored: Wed Apr 12 09:55:59 2017 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Wed Apr 12 09:55:59 2017 +0100

----------------------------------------------------------------------
 .../apache/jena/riot/lang/LangTurtleBase.java    | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/7c280ddc/jena-arq/src/main/java/org/apache/jena/riot/lang/LangTurtleBase.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/lang/LangTurtleBase.java b/jena-arq/src/main/java/org/apache/jena/riot/lang/LangTurtleBase.java
index ae813a6..5215d66 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/lang/LangTurtleBase.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/lang/LangTurtleBase.java
@@ -301,11 +301,13 @@ public abstract class LangTurtleBase extends LangBase {
             String image = peekToken().getImage() ;
             if ( image.equals(KW_A) )
                 return NodeConst.nodeRDFType ;
+            // N3-isms
             if ( !strict && image.equals(KW_SAME_AS) )
                 return nodeSameAs ;
-            if ( !strict && image.equals(KW_LOG_IMPLIES) )
-                return NodeConst.nodeRDFType ;
-            exception(tErr, "Unrecognized: " + image) ;
+            // Relationship between two formulae in N3.
+//            if ( false && !strict && image.equals(KW_LOG_IMPLIES) )
+//                return log:implies.
+            exception(tErr, "Unrecognized keyword: " + image) ;
         }
 
         Node n = node() ;
@@ -404,7 +406,7 @@ public abstract class LangTurtleBase extends LangBase {
             return triplesFormula() ;
         if ( lookingAt(LPAREN) )
             return triplesList() ;
-        exception(peekToken(), "Unrecognized: " + peekToken()) ;
+        exception(peekToken(), "Unrecognized (expected an RDF Term): " + peekToken()) ;
         return null ;
     }
 
@@ -459,21 +461,18 @@ public abstract class LangTurtleBase extends LangBase {
             lastCell = nextCell ;
 
             emitTriple(nextCell, NodeConst.nodeFirst, n) ;
-
-            if ( !moreTokens() ) // Error.
-                break ;
         }
         // On exit, just after the RPARENS
 
-        if ( lastCell == null )
+        if ( lastCell == null ) {
             // Simple ()
+            finishList();
             return NodeConst.nodeNil ;
+        }
 
         // Finish list.
         emitTriple(lastCell, NodeConst.nodeRest, NodeConst.nodeNil) ;
-
         finishList() ;
-
         return listHead ;
     }
 


Mime
View raw message