You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by ja...@apache.org on 2013/08/28 14:11:29 UTC
[2/3] git commit: MARMOTTA-219: Added support for comments in the
ldpath-plugin for codemirror MARMOTTA-213: Fixed License-Header in 3rd-party
source files (codemirror)
MARMOTTA-219: Added support for comments in the ldpath-plugin for
codemirror
MARMOTTA-213: Fixed License-Header in 3rd-party source files
(codemirror)
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/8f99c34b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/8f99c34b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/8f99c34b
Branch: refs/heads/develop
Commit: 8f99c34b0a71e7d90f4e78142566681ead0f87bb
Parents: 0eed027
Author: Jakob Frank <ja...@apache.org>
Authored: Tue Aug 27 14:45:29 2013 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Wed Aug 28 14:09:47 2013 +0200
----------------------------------------------------------------------
.../src/main/resources/codemirror.css | 19 ++-----------
.../codemirror/src/main/resources/codemirror.js | 19 ++-----------
.../codemirror/src/main/resources/ldpath.js | 30 ++++++++++++++++++--
.../src/main/resources/simple-hint.css | 19 ++-----------
.../src/main/resources/simple-hint.js | 25 ++++++----------
.../codemirror/src/main/resources/sparql.js | 25 ++++++----------
parent/pom.xml | 7 +++++
7 files changed, 59 insertions(+), 85 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8f99c34b/extras/webjars/codemirror/src/main/resources/codemirror.css
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/codemirror.css b/extras/webjars/codemirror/src/main/resources/codemirror.css
index b5385d7..8c8ffe0 100644
--- a/extras/webjars/codemirror/src/main/resources/codemirror.css
+++ b/extras/webjars/codemirror/src/main/resources/codemirror.css
@@ -1,20 +1,7 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+/* CodeMirror version 2.24
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+ * License: MIT-License <http://codemirror.net/LICENSE>
+*/
#center .CodeMirror, .CodeMirror {
line-height: 1em;
font-family: monospace;
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8f99c34b/extras/webjars/codemirror/src/main/resources/codemirror.js
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/codemirror.js b/extras/webjars/codemirror/src/main/resources/codemirror.js
index 72609ee..bbe5006 100644
--- a/extras/webjars/codemirror/src/main/resources/codemirror.js
+++ b/extras/webjars/codemirror/src/main/resources/codemirror.js
@@ -1,25 +1,10 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
// CodeMirror version 2.24
//
// All functions that need access to the editor's state live inside
// the CodeMirror function. Below that, at the bottom of the file,
// some utilities are defined.
+//
+// License: MIT-License <http://codemirror.net/LICENSE>
// CodeMirror is the only global var we claim
var CodeMirror = (function() {
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8f99c34b/extras/webjars/codemirror/src/main/resources/ldpath.js
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/ldpath.js b/extras/webjars/codemirror/src/main/resources/ldpath.js
index 016142f..a5eb1a4 100644
--- a/extras/webjars/codemirror/src/main/resources/ldpath.js
+++ b/extras/webjars/codemirror/src/main/resources/ldpath.js
@@ -18,6 +18,7 @@
if (CodeMirror && CodeMirror.defineMode) {
CodeMirror.defineMode("ldpath", function(config, parserConfig) {
var token = {
+ COMMENT: "comment",
OP: "operator",
KWD: "keyword",
PREFIX: "qualifier",
@@ -92,6 +93,12 @@ CodeMirror.defineMode("ldpath", function(config, parserConfig) {
}
function tokenDefault(stream, state) {
+ // /* ... */
+ if (stream.match('/*')) {
+ state.push('comment');
+ return token.COMMENT;
+ }
+
// @...
var kw = stream.match(/^@(\w+)/, true);
if (kw) {
@@ -134,7 +141,7 @@ CodeMirror.defineMode("ldpath", function(config, parserConfig) {
px = stream.current();
stream.eat(':');
if (state.getNamespace(px))
- return token.PREFIX;
+ return token.PREFIX;
else return token.WARNING;
}
}
@@ -207,6 +214,9 @@ CodeMirror.defineMode("ldpath", function(config, parserConfig) {
if (stream.match(/@\w+/, true) || stream.match("^^", true)) {
return token.TEST;
}
+ if (stream.match("is-a", true)) {
+ return token.TEST;
+ }
if (stream.match("is ", false)) {
stream.match("is", true);
return token.TEST;
@@ -232,8 +242,21 @@ CodeMirror.defineMode("ldpath", function(config, parserConfig) {
return state1.stack == state2.stack && state1.namespaces == state2.namespaces;
},
token: function(stream, state) {
+ // parse comments
+ if (state.current() == "comment") {
+ stream.skipTo('*') || stream.skipToEnd();
+ if (stream.match('*/')) {
+ state.pop();
+ } else stream.eat('*');
+ return token.COMMENT;
+ } else if (stream.match('/*')) {
+ state.tmp.commentStart = stream.column();
+ state.push("comment");
+ return this.token(stream, state);
+ }
// ignore spaces
if (stream.eatSpace()) return null;
+ // ; starts parsing from scratch
if (stream.eat(';')) {
if (state.current() == "prefix") {
state.addPrefix(state.tmp['prefix'], state.tmp['ns']);
@@ -246,9 +269,12 @@ CodeMirror.defineMode("ldpath", function(config, parserConfig) {
log(stream, state, result);
return result;
},
- electricChars: "@=[];",
+ electricChars: "/@=[];",
indent: function(state, textAfter) {
switch (state.current()) {
+ case 'comment':
+ return state.tmp.commentStart +(textAfter.search(/^\s*\*\//)==0?1:3);
+ break;
case 'test':
case 'filter':
return 2 * config.indentUnit;
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8f99c34b/extras/webjars/codemirror/src/main/resources/simple-hint.css
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/simple-hint.css b/extras/webjars/codemirror/src/main/resources/simple-hint.css
index c7a040c..2deea4e 100644
--- a/extras/webjars/codemirror/src/main/resources/simple-hint.css
+++ b/extras/webjars/codemirror/src/main/resources/simple-hint.css
@@ -1,20 +1,7 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+/* CodeMirror version 2.24
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+ * License: MIT-License <http://codemirror.net/LICENSE>
+*/
#center .CodeMirror-completions, .CodeMirror-completions {
position: absolute;
z-index: 10;
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8f99c34b/extras/webjars/codemirror/src/main/resources/simple-hint.js
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/simple-hint.js b/extras/webjars/codemirror/src/main/resources/simple-hint.js
index 27f8ead..ad0f5eb 100644
--- a/extras/webjars/codemirror/src/main/resources/simple-hint.js
+++ b/extras/webjars/codemirror/src/main/resources/simple-hint.js
@@ -1,20 +1,11 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+// CodeMirror version 2.24
+//
+// All functions that need access to the editor's state live inside
+// the CodeMirror function. Below that, at the bottom of the file,
+// some utilities are defined.
+//
+// License: MIT-License <http://codemirror.net/LICENSE>
+
(function() {
CodeMirror.simpleHint = function(editor, getHints) {
// We want a single cursor position.
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8f99c34b/extras/webjars/codemirror/src/main/resources/sparql.js
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/sparql.js b/extras/webjars/codemirror/src/main/resources/sparql.js
index ff3ad70..8ffa73b 100644
--- a/extras/webjars/codemirror/src/main/resources/sparql.js
+++ b/extras/webjars/codemirror/src/main/resources/sparql.js
@@ -1,20 +1,11 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+// CodeMirror version 2.24
+//
+// All functions that need access to the editor's state live inside
+// the CodeMirror function. Below that, at the bottom of the file,
+// some utilities are defined.
+//
+// License: MIT-License <http://codemirror.net/LICENSE>
+
CodeMirror.defineMode("sparql", function(config) {
var indentUnit = config.indentUnit;
var curPunc;
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8f99c34b/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 6774a67..283c25e 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -410,6 +410,13 @@
<exclude>**/src/main/java/solr2155/**</exclude>
<exclude>**/src/main/java/net/miginfocom/**</exclude>
<exclude>**/src/main/java/org/oxbow/**</exclude>
+
+ <!-- codemirror -->
+ <exclude>**/codemirror.js</exclude>
+ <exclude>**/codemirror.css</exclude>
+ <exclude>**/simple-hint.js</exclude>
+ <exclude>**/simple-hint.css</exclude>
+ <exclude>**/sparql.js</exclude>
</excludes>
</configuration>
</plugin>