(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/62ed603e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/62ed603e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/62ed603e

Branch: refs/heads/develop
Commit: 62ed603e0e60788a60a5acfc00e07887db5e0c07
Parents: 28dfc81
Author: Jakob Frank <[email protected]>
Authored: Wed Apr 3 15:06:00 2013 +0200
Committer: Jakob Frank <[email protected]>
Committed: Wed Apr 3 15:09:51 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/62ed603e/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