Fixing issue #8103: t3editor / typoscript on the right side of an operator is not...
authorTobias Liebig <mail@etobi.de>
Wed, 15 Apr 2009 19:30:45 +0000 (19:30 +0000)
committerTobias Liebig <mail@etobi.de>
Wed, 15 Apr 2009 19:30:45 +0000 (19:30 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5313 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/t3editor/css/t3editor_inner.css
typo3/sysext/t3editor/jslib/codemirror/tokenizetyposcript.js

index cb44bf6..435e375 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2009-04-15  Tobias Liebig <mail_typo3@etobi.de>
+
+       * Fixed issue #8103: t3editor / typoscript on the right side of an operator is not tokenized (needed to enable codecompletion behind copy or reference operator)
 
 2009-04-10  Martin Kutschker  <masi@typo3.org>
 
index 2314e77..fe4236a 100644 (file)
@@ -19,7 +19,7 @@
  * Syntax highlighting
  *********************************************/
 
-span.other { color: black; }
+.other { color: black; }
 .ts-operator { color: #0000cc; font-weight: bold; }
 .ts-value { color: #cc0000; }
 .ts-objstr, .keyword, .keyword2, .keyword3, .reserved { color: #0000cc; }
index 892dde1..2b86396 100644 (file)
@@ -1268,10 +1268,12 @@ var tokenizeTypoScript = function() {
                                        style: "whitespace",
                                        value: source.get()
                                };
+                               this.inValue = false;
 
-                       } else if (this.inComment) {
+                       } else if (!this.inValue && this.inComment) {
                                token = readMultilineComment.call(this, ch);
-
+                       
+                       /*
                        } else if (this.inValue) {
                                token = nextUntilUnescaped(null) || {
                                        type: "value",
@@ -1279,41 +1281,42 @@ var tokenizeTypoScript = function() {
                                        value: source.get()
                                };
                                this.inValue = false;
+                       */
 
                        } else if (isWhiteSpace(ch)) {
                                token = nextWhile(isWhiteSpace) || result("whitespace", "whitespace");
 
-                       } else if (ch == "\"" || ch == "'") {
+                       } else if (!this.inValue && (ch == "\"" || ch == "'")) {
                                token = nextUntilUnescaped(ch) || result("string", "string");
 
                        } else if (
                           ( ch == "<" || 
-                                ch == ">" ||
-                                ( ch == "=" 
-                                  && source.peek() != "<" 
-                                )
+                                  ch == ">" ||
+                                ( ch == "=" 
+                                  && source.peek() != "<" 
+                                )
                           )
                           && source.peek() != "\n" ) { // there must be some value behind the operator!
                                this.inValue = true;
                                token = result(ch, "ts-operator");
 
-                       } else if (ch == "[") {
+                       } else if (!this.inValue && ch == "[") {
                                token = nextUntilUnescaped("]") || result("condition", "ts-condition");
 
                        // with punctuation, the type of the token is the symbol itself
-                       } else if (/[\[\]\(\),;\:\.\<\>\=]/.test(ch)) {
+                       } else if (!this.inValue && /[\[\]\(\),;\:\.\<\>\=]/.test(ch)) {
                                token = result(ch, "ts-operator");
 
-                       } else if (ch == "{" || ch == "}") {
+                       } else if (!this.inValue && (ch == "{" || ch == "}")) {
                                token = result(ch, "ts-operator curly-bracket");
 
-                       } else if (ch == "0" && (source.peek() == "x" || source.peek() == "X")) {
+                       } else if (!this.inValue && ch == "0" && (source.peek() == "x" || source.peek() == "X")) {
                                token = readHexNumber();
 
-                       } else if (isDigit(ch)) {
+                       } else if (!this.inValue && isDigit(ch)) {
                                token = readNumber();
 
-                       } else if (ch == "/") {
+                       } else if (!this.inValue && ch == "/") {
                                next = source.peek();
 
                                if (next == "*") {
@@ -1329,14 +1332,17 @@ var tokenizeTypoScript = function() {
                                        token = nextWhile(isOperatorChar) || result("operator", "ts-operator");
                                }
 
-                       } else if (ch == "#") {
+                       } else if (!this.inValue && ch == "#") {
                                token = nextUntilUnescaped(null) || result("comment", "ts-comment");
 
-                       } else if (isOperatorChar(ch)) {
+                       } else if (!this.inValue && isOperatorChar(ch)) {
                                token = nextWhile(isOperatorChar) || result("operator", "ts-operator");
 
                        } else {
                                token = readWord();
+                               if (this.inValue) {
+                                       token.style += ' ts-value';
+                               }
                        }
 
                        // JavaScript's syntax rules for when a slash might be the start