(MARMOTTA-187) fixed regex to match local names with ./-

Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/afdc86ac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/afdc86ac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/afdc86ac

Branch: refs/heads/develop
Commit: afdc86ac5ed17c56f1d86fad0a1c8758b1feff64
Parents: 65db325
Author: Jakob Frank <[email protected]>
Authored: Wed Apr 3 15:06:00 2013 +0200
Committer: Sergio Fernández <[email protected]>
Committed: Mon Apr 8 18:10:56 2013 +0200

----------------------------------------------------------------------
 .../src/main/resources/web/cm/ldpath.js            |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/afdc86ac/platform/marmotta-ldpath/src/main/resources/web/cm/ldpath.js
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldpath/src/main/resources/web/cm/ldpath.js 
b/platform/marmotta-ldpath/src/main/resources/web/cm/ldpath.js
index 37f3a19..a560013 100644
--- a/platform/marmotta-ldpath/src/main/resources/web/cm/ldpath.js
+++ b/platform/marmotta-ldpath/src/main/resources/web/cm/ldpath.js
@@ -178,12 +178,15 @@ CodeMirror.defineMode("ldpath", function(config, 
parserConfig) {
         }
 
         // IDENT
-        if (stream.match(/^\w+/, true)) {
-            if (state.current() == "prefix") {
+        if (state.current() == "prefix") {
+            if (stream.match(/^\w+/, true)) {
                 state.tmp["prefix"] = stream.current();
                 return token.PREFIX;
-            } else
+            }
+        } else {
+            if (stream.match(/^[\w.-]+/, true)) {
                 return token.IDENT;
+            }
         }
 
         return tokenError(stream, state);

Reply via email to