Skip to content
This repository
Browse code

Updated line endings

  • Loading branch information...
commit 91757d2da1c298bd05be37b556c7076d886e35ca 1 parent 7c005e0
Paul Lewis authored August 06, 2012

Showing 25 changed files with 2,614 additions and 2,602 deletions. Show diff stats Hide diff stats

  1. 30  diff/img/undo.png
  2. 30  diff/img/undo.svg
  3. 24  gdocs/img/upload.svg
  4. 33  hello-world/index.html
  5. 13  hello-world/styles/main.css
  6. 104  identity/identity.js
  7. 18  identity/index.html
  8. 6  identity/main.js
  9. 32  identity/manifest.json
  10. 130  mini-code-edit/cm/demo/closetag.html
  11. 292  mini-code-edit/cm/lib/util/closetag.js
  12. 406  mini-code-edit/cm/mode/ecl/ecl.js
  13. 84  mini-code-edit/cm/mode/ecl/index.html
  14. 388  mini-code-edit/cm/mode/verilog/verilog.js
  15. 86  serial/adkjs/firmware/arduino_libs/TimedAction/TimedAction.cpp
  16. 138  serial/adkjs/firmware/arduino_libs/TimedAction/TimedAction.h
  17. 622  serial/adkjs/firmware/arduino_libs/USB_Host_Shield/Max3421e.cpp
  18. 116  serial/adkjs/firmware/arduino_libs/USB_Host_Shield/Max3421e.h
  19. 472  serial/adkjs/firmware/arduino_libs/USB_Host_Shield/Max3421e_constants.h
  20. 500  serial/adkjs/firmware/arduino_libs/USB_Host_Shield/Max_LCD.cpp
  21. 172  serial/adkjs/firmware/arduino_libs/USB_Host_Shield/Max_LCD.h
  22. 8  serial/adkjs/firmware/arduino_libs/USB_Host_Shield/README
  23. 828  serial/adkjs/firmware/arduino_libs/USB_Host_Shield/Usb.cpp
  24. 348  serial/adkjs/firmware/arduino_libs/USB_Host_Shield/Usb.h
  25. 336  serial/adkjs/firmware/arduino_libs/USB_Host_Shield/ch9.h
30  diff/img/undo.png
30  diff/img/undo.svg
... ...
@@ -1,15 +1,15 @@
1  
-<?xml version="1.0" encoding="utf-8"?>
2  
-<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In  -->
3  
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
4  
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
5  
-]>
6  
-<svg version="1.1"
7  
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
8  
-	 x="0px" y="0px" width="21px" height="21px" viewBox="0 0 21 21" overflow="visible" enable-background="new 0 0 21 21"
9  
-	 xml:space="preserve">
10  
-<defs>
11  
-</defs>
12  
-<path d="M10.5,7C8.566,7,6.531,8.098,5.097,9.597L3,7.5V14h6.5l-2.259-2.259C8.125,10.747,9.904,9.1,12,9.1
13  
-	c2.434,0,4.656,1.041,6,3.9C17,9,14,7,10.5,7z"/>
14  
-<rect opacity="0" fill="#4387FD" width="21" height="21"/>
15  
-</svg>
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In  -->
  3
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
  4
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
  5
+]>
  6
+<svg version="1.1"
  7
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
  8
+	 x="0px" y="0px" width="21px" height="21px" viewBox="0 0 21 21" overflow="visible" enable-background="new 0 0 21 21"
  9
+	 xml:space="preserve">
  10
+<defs>
  11
+</defs>
  12
+<path d="M10.5,7C8.566,7,6.531,8.098,5.097,9.597L3,7.5V14h6.5l-2.259-2.259C8.125,10.747,9.904,9.1,12,9.1
  13
+	c2.434,0,4.656,1.041,6,3.9C17,9,14,7,10.5,7z"/>
  14
+<rect opacity="0" fill="#4387FD" width="21" height="21"/>
  15
+</svg>
24  gdocs/img/upload.svg
... ...
@@ -1,12 +1,12 @@
1  
-<?xml version="1.0" encoding="utf-8"?>
2  
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363)  -->
3  
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
4  
-<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5  
-	 width="100px" height="55.154px" viewBox="0 0 100 55.154" enable-background="new 0 0 100 55.154" xml:space="preserve">
6  
-<path d="M77.959,11.074c-3.73,0-7.34,0.932-10.543,2.682C63.516,5.536,55.109,0,45.693,0c-12.85,0-23.376,10.141-23.998,22.838
7  
-	c-5.901,0.703-10.961,4.62-13.149,10.089C3.643,34.152,0,38.595,0,43.873c0,6.22,5.061,11.281,11.282,11.281h32.974
8  
-	c0-5.915,0-11.83,0-17.744c-1.384,0-4.083,0-5.468,0c-1.058,0-1.413-1.208-0.802-1.94c3.298-3.962,7.912-7.925,11.21-11.887
9  
-	c0.242-0.291,0.528-0.397,0.803-0.378c0.275-0.019,0.561,0.087,0.803,0.378c3.298,3.962,7.913,7.925,11.21,11.887
10  
-	c0.61,0.732,0.256,1.94-0.803,1.94c-1.385,0-4.084,0-5.468,0c0,5.914,0,11.829,0,17.744h22.216c12.154,0,22.041-9.887,22.041-22.04
11  
-	S90.111,11.074,77.959,11.074z"/>
12  
-</svg>
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363)  -->
  3
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
  4
+<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
  5
+	 width="100px" height="55.154px" viewBox="0 0 100 55.154" enable-background="new 0 0 100 55.154" xml:space="preserve">
  6
+<path d="M77.959,11.074c-3.73,0-7.34,0.932-10.543,2.682C63.516,5.536,55.109,0,45.693,0c-12.85,0-23.376,10.141-23.998,22.838
  7
+	c-5.901,0.703-10.961,4.62-13.149,10.089C3.643,34.152,0,38.595,0,43.873c0,6.22,5.061,11.281,11.282,11.281h32.974
  8
+	c0-5.915,0-11.83,0-17.744c-1.384,0-4.083,0-5.468,0c-1.058,0-1.413-1.208-0.802-1.94c3.298-3.962,7.912-7.925,11.21-11.887
  9
+	c0.242-0.291,0.528-0.397,0.803-0.378c0.275-0.019,0.561,0.087,0.803,0.378c3.298,3.962,7.913,7.925,11.21,11.887
  10
+	c0.61,0.732,0.256,1.94-0.803,1.94c-1.385,0-4.084,0-5.468,0c0,5.914,0,11.829,0,17.744h22.216c12.154,0,22.041-9.887,22.041-22.04
  11
+	S90.111,11.074,77.959,11.074z"/>
  12
+</svg>
33  hello-world/index.html
@@ -2,26 +2,25 @@
2 2
 <html>
3 3
 <head>
4 4
     <!--
5  
-    Hello World App
  5
+
  6
+    Copyright 2012 - Google, Inc.
  7
+
  8
+    Licensed under the Apache License, Version 2.0 (the "License");
  9
+    you may not use this file except in compliance with the License.
  10
+    You may obtain a copy of the License at
  11
+
  12
+       http://www.apache.org/licenses/LICENSE-2.0
  13
+
  14
+    Unless required by applicable law or agreed to in writing, software
  15
+    distributed under the License is distributed on an "AS IS" BASIS,
  16
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17
+    See the License for the specific language governing permissions and
  18
+    limitations under the License.
  19
+
6 20
     -->
7 21
     <meta charset="utf-8">
8 22
     <title>Hello World</title>
9  
-    <style>
10  
-
11  
-      body {
12  
-        background: url("hello_world.png") no-repeat;
13  
-      }
14  
-
15  
-      h1 {
16  
-        text-align: center;
17  
-        width: 100%;
18  
-        line-height: 120%;
19  
-        padding-top: 200px;
20  
-        font-family: Arial, sans-serif;
21  
-        color: rgb(66,66,66);
22  
-        letter-spacing: -0.05em;
23  
-      }
24  
-    </style>
  23
+    <link href="styles/main.css" rel="stylesheet">
25 24
 </head>
26 25
 <body>
27 26
     <h1>Hello, World!</h1>
13  hello-world/styles/main.css
... ...
@@ -0,0 +1,13 @@
  1
+body {
  2
+  background: url("hello_world.png") no-repeat;
  3
+}
  4
+
  5
+h1 {
  6
+  text-align: center;
  7
+  width: 100%;
  8
+  line-height: 120%;
  9
+  padding-top: 200px;
  10
+  font-family: Arial, sans-serif;
  11
+  color: rgb(66,66,66);
  12
+  letter-spacing: -0.05em;
  13
+}
104  identity/identity.js
... ...
@@ -1,52 +1,52 @@
1  
-function onImageFetched(e) {
2  
-  var elem = document.getElementById('user_info');
3  
-  if (!elem) return;
4  
-  if (this.status != 200) return;
5  
-  var imgElem = document.createElement('img');
6  
-  imgElem.src = window.webkitURL.createObjectURL(this.response);
7  
-  elem.appendChild(imgElem);
8  
-}
9  
-
10  
-function fetchImageBytes(user_info) {
11  
-  if (!user_info || !user_info.picture) return;
12  
-  var xhr = new XMLHttpRequest();
13  
-  xhr.open('GET', user_info.picture, true);
14  
-  xhr.responseType = 'blob';
15  
-  xhr.onload = onImageFetched;
16  
-  xhr.send();
17  
-}
18  
-
19  
-function populateUserInfo(user_info) {
20  
-  var elem = document.getElementById('user_info');
21  
-  if (!elem) return;
22  
-  var nameElem = document.createElement('div');
23  
-  nameElem.innerHTML = "<b>Hello " + user_info.name + "</b>";
24  
-  elem.appendChild(nameElem);
25  
-  fetchImageBytes(user_info);
26  
-}
27  
-
28  
-function onUserInfoFetched(e) {
29  
-  if (this.status != 200) return;
30  
-  console.log("Got the following user info: " + this.response);
31  
-  var user_info = JSON.parse(this.response);
32  
-  populateUserInfo(user_info);
33  
-}
34  
-
35  
-function onGetAuthToken(auth_token) {
36  
-  if (!auth_token) {
37  
-    document.getElementById('user_info').innerHTML = "Not signed in to Chrome, Sign in to Chrome first";
38  
-    return;
39  
-  }
40  
-  // Use the auth token to do an XHR to get the user information.
41  
-  var xhr = new XMLHttpRequest();
42  
-  xhr.open('GET', 'https://www.googleapis.com/oauth2/v1/userinfo?alt=json');
43  
-  xhr.setRequestHeader('Authorization', 'Bearer ' + auth_token);
44  
-  xhr.onload = onUserInfoFetched;
45  
-  xhr.send();
46  
-}
47  
-
48  
-function getUserInfo() {
49  
-  chrome.experimental.identity.getAuthToken({ 'interactive': false }, onGetAuthToken);
50  
-}
51  
-
52  
-window.onload = getUserInfo;
  1
+function onImageFetched(e) {
  2
+  var elem = document.getElementById('user_info');
  3
+  if (!elem) return;
  4
+  if (this.status != 200) return;
  5
+  var imgElem = document.createElement('img');
  6
+  imgElem.src = window.webkitURL.createObjectURL(this.response);
  7
+  elem.appendChild(imgElem);
  8
+}
  9
+
  10
+function fetchImageBytes(user_info) {
  11
+  if (!user_info || !user_info.picture) return;
  12
+  var xhr = new XMLHttpRequest();
  13
+  xhr.open('GET', user_info.picture, true);
  14
+  xhr.responseType = 'blob';
  15
+  xhr.onload = onImageFetched;
  16
+  xhr.send();
  17
+}
  18
+
  19
+function populateUserInfo(user_info) {
  20
+  var elem = document.getElementById('user_info');
  21
+  if (!elem) return;
  22
+  var nameElem = document.createElement('div');
  23
+  nameElem.innerHTML = "<b>Hello " + user_info.name + "</b>";
  24
+  elem.appendChild(nameElem);
  25
+  fetchImageBytes(user_info);
  26
+}
  27
+
  28
+function onUserInfoFetched(e) {
  29
+  if (this.status != 200) return;
  30
+  console.log("Got the following user info: " + this.response);
  31
+  var user_info = JSON.parse(this.response);
  32
+  populateUserInfo(user_info);
  33
+}
  34
+
  35
+function onGetAuthToken(auth_token) {
  36
+  if (!auth_token) {
  37
+    document.getElementById('user_info').innerHTML = "Not signed in to Chrome, Sign in to Chrome first";
  38
+    return;
  39
+  }
  40
+  // Use the auth token to do an XHR to get the user information.
  41
+  var xhr = new XMLHttpRequest();
  42
+  xhr.open('GET', 'https://www.googleapis.com/oauth2/v1/userinfo?alt=json');
  43
+  xhr.setRequestHeader('Authorization', 'Bearer ' + auth_token);
  44
+  xhr.onload = onUserInfoFetched;
  45
+  xhr.send();
  46
+}
  47
+
  48
+function getUserInfo() {
  49
+  chrome.experimental.identity.getAuthToken({ 'interactive': false }, onGetAuthToken);
  50
+}
  51
+
  52
+window.onload = getUserInfo;
18  identity/index.html
... ...
@@ -1,9 +1,9 @@
1  
-<html>
2  
-  <head>
3  
-    <title>Identity API Sample App</title>
4  
-    <script src="identity.js"></script>
5  
-  </head>
6  
-  <body>
7  
-    <div id="user_info"></div>
8  
-  </body>
9  
-</html>
  1
+<html>
  2
+  <head>
  3
+    <title>Identity API Sample App</title>
  4
+    <script src="identity.js"></script>
  5
+  </head>
  6
+  <body>
  7
+    <div id="user_info"></div>
  8
+  </body>
  9
+</html>
6  identity/main.js
... ...
@@ -1,3 +1,3 @@
1  
-chrome.experimental.app.onLaunched.addListener(function() {
2  
-  chrome.app.window.create('index.html', { "width": 1024, "height": 768 });
3  
-});
  1
+chrome.experimental.app.onLaunched.addListener(function() {
  2
+  chrome.app.window.create('index.html', { "width": 1024, "height": 768 });
  3
+});
32  identity/manifest.json
... ...
@@ -1,16 +1,16 @@
1  
-{
2  
-  "name": "Identity API",
3  
-  "version": "1",
4  
-  "manifest_version": 2,
5  
-  "key": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh",
6  
-  "app": {
7  
-    "background": {
8  
-      "scripts": ["main.js"]
9  
-    }
10  
-  },
11  
-  "permissions": ["experimental"],
12  
-  "oauth2": {
13  
-    "client_id": "503955758982.apps.googleusercontent.com",
14  
-    "scopes": ["https://www.googleapis.com/auth/userinfo.profile"]
15  
-  }
16  
-}
  1
+{
  2
+  "name": "Identity API",
  3
+  "version": "1",
  4
+  "manifest_version": 2,
  5
+  "key": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh",
  6
+  "app": {
  7
+    "background": {
  8
+      "scripts": ["main.js"]
  9
+    }
  10
+  },
  11
+  "permissions": ["experimental"],
  12
+  "oauth2": {
  13
+    "client_id": "503955758982.apps.googleusercontent.com",
  14
+    "scopes": ["https://www.googleapis.com/auth/userinfo.profile"]
  15
+  }
  16
+}
130  mini-code-edit/cm/demo/closetag.html
... ...
@@ -1,65 +1,65 @@
1  
-<!doctype html>
2  
-<html>
3  
-	<head>
4  
-		<title>CodeMirror: Close-Tag Demo</title>
5  
-		<link rel="stylesheet" href="../lib/codemirror.css">
6  
-		<script src="../lib/codemirror.js"></script>
7  
-		<script src="../lib/util/closetag.js"></script>
8  
-		<script src="../mode/xml/xml.js"></script>
9  
-		<script src="../mode/javascript/javascript.js"></script>
10  
-		<script src="../mode/css/css.js"></script>
11  
-		<script src="../mode/htmlmixed/htmlmixed.js"></script>
12  
-		<link rel="stylesheet" href="../doc/docs.css">
13  
-		<style type="text/css">
14  
-			.CodeMirror {border-top: 1px solid #eee; border-bottom: 1px solid #eee;}
15  
-		</style>
16  
-	</head>
17  
-	<body>
18  
-	
19  
-		<h1>Close-Tag Demo</h1>
20  
-		<ul>
21  
-			<li>Type an html tag.  When you type '>' or '/', the tag will auto-close/complete.  Block-level tags will indent.</li>
22  
-			<li>There are options for disabling tag closing or customizing the list of tags to indent.</li>
23  
-			<li>Works with "text/html" (based on htmlmixed.js or xml.js) mode.</li>
24  
-			<li>View source for key binding details.</li>
25  
-		</p>
26  
-
27  
-		<form><textarea id="code" name="code"></textarea></form>
28  
-
29  
-		<script type="text/javascript">
30  
-		var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
31  
-			mode: 'text/html',
32  
-			
33  
-			//closeTagEnabled: false, // Set this option to disable tag closing behavior without having to remove the key bindings.
34  
-			//closeTagIndent: false, // Pass false or an array of tag names to override the default indentation behavior.
35  
-			
36  
-			extraKeys: {
37  
-				"'>'": function(cm) { cm.closeTag(cm, '>'); },
38  
-				"'/'": function(cm) { cm.closeTag(cm, '/'); }
39  
-			},
40  
-			
41  
-			/*
42  
-			// extraKeys is the easier way to go, but if you need native key event processing, this should work too.
43  
-			onKeyEvent: function(cm, e) {
44  
-				if (e.type == 'keydown') {
45  
-					var c = e.keyCode || e.which;
46  
-					if (c == 190 || c == 191) {
47  
-						try {
48  
-							cm.closeTag(cm, c == 190 ? '>' : '/');
49  
-							e.stop();
50  
-							return true;
51  
-						} catch (e) {
52  
-							if (e != CodeMirror.Pass) throw e;
53  
-						}
54  
-					}
55  
-				}
56  
-				return false;
57  
-			},
58  
-			*/
59  
-			
60  
-			wordWrap: true
61  
-		});
62  
-		</script>
63  
-
64  
-	</body>
65  
-</html>
  1
+<!doctype html>
  2
+<html>
  3
+	<head>
  4
+		<title>CodeMirror: Close-Tag Demo</title>
  5
+		<link rel="stylesheet" href="../lib/codemirror.css">
  6
+		<script src="../lib/codemirror.js"></script>
  7
+		<script src="../lib/util/closetag.js"></script>
  8
+		<script src="../mode/xml/xml.js"></script>
  9
+		<script src="../mode/javascript/javascript.js"></script>
  10
+		<script src="../mode/css/css.js"></script>
  11
+		<script src="../mode/htmlmixed/htmlmixed.js"></script>
  12
+		<link rel="stylesheet" href="../doc/docs.css">
  13
+		<style type="text/css">
  14
+			.CodeMirror {border-top: 1px solid #eee; border-bottom: 1px solid #eee;}
  15
+		</style>
  16
+	</head>
  17
+	<body>
  18
+	
  19
+		<h1>Close-Tag Demo</h1>
  20
+		<ul>
  21
+			<li>Type an html tag.  When you type '>' or '/', the tag will auto-close/complete.  Block-level tags will indent.</li>
  22
+			<li>There are options for disabling tag closing or customizing the list of tags to indent.</li>
  23
+			<li>Works with "text/html" (based on htmlmixed.js or xml.js) mode.</li>
  24
+			<li>View source for key binding details.</li>
  25
+		</p>
  26
+
  27
+		<form><textarea id="code" name="code"></textarea></form>
  28
+
  29
+		<script type="text/javascript">
  30
+		var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  31
+			mode: 'text/html',
  32
+			
  33
+			//closeTagEnabled: false, // Set this option to disable tag closing behavior without having to remove the key bindings.
  34
+			//closeTagIndent: false, // Pass false or an array of tag names to override the default indentation behavior.
  35
+			
  36
+			extraKeys: {
  37
+				"'>'": function(cm) { cm.closeTag(cm, '>'); },
  38
+				"'/'": function(cm) { cm.closeTag(cm, '/'); }
  39
+			},
  40
+			
  41
+			/*
  42
+			// extraKeys is the easier way to go, but if you need native key event processing, this should work too.
  43
+			onKeyEvent: function(cm, e) {
  44
+				if (e.type == 'keydown') {
  45
+					var c = e.keyCode || e.which;
  46
+					if (c == 190 || c == 191) {
  47
+						try {
  48
+							cm.closeTag(cm, c == 190 ? '>' : '/');
  49
+							e.stop();
  50
+							return true;
  51
+						} catch (e) {
  52
+							if (e != CodeMirror.Pass) throw e;
  53
+						}
  54
+					}
  55
+				}
  56
+				return false;
  57
+			},
  58
+			*/
  59
+			
  60
+			wordWrap: true
  61
+		});
  62
+		</script>
  63
+
  64
+	</body>
  65
+</html>
292  mini-code-edit/cm/lib/util/closetag.js
... ...
@@ -1,146 +1,146 @@
1  
-/**
2  
- * Tag-closer extension for CodeMirror.
3  
- *
4  
- * This extension adds a "closeTag" utility function that can be used with key bindings to 
5  
- * insert a matching end tag after the ">" character of a start tag has been typed.  It can
6  
- * also complete "</" if a matching start tag is found.  It will correctly ignore signal
7  
- * characters for empty tags, comments, CDATA, etc.
8  
- *
9  
- * The function depends on internal parser state to identify tags.  It is compatible with the
10  
- * following CodeMirror modes and will ignore all others:
11  
- * - htmlmixed
12  
- * - xml
13  
- *
14  
- * See demos/closetag.html for a usage example.
15  
- * 
16  
- * @author Nathan Williams <nathan@nlwillia.net>
17  
- * Contributed under the same license terms as CodeMirror.
18  
- */
19  
-(function() {
20  
-	/** Option that allows tag closing behavior to be toggled.  Default is true. */
21  
-	CodeMirror.defaults['closeTagEnabled'] = true;
22  
-	
23  
-	/** Array of tag names to add indentation after the start tag for.  Default is the list of block-level html tags. */
24  
-	CodeMirror.defaults['closeTagIndent'] = ['applet', 'blockquote', 'body', 'button', 'div', 'dl', 'fieldset', 'form', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'html', 'iframe', 'layer', 'legend', 'object', 'ol', 'p', 'select', 'table', 'ul'];
25  
-
26  
-	/**
27  
-	 * Call during key processing to close tags.  Handles the key event if the tag is closed, otherwise throws CodeMirror.Pass.
28  
-	 * - cm: The editor instance.
29  
-	 * - ch: The character being processed.
30  
-	 * - indent: Optional.  Omit or pass true to use the default indentation tag list defined in the 'closeTagIndent' option.
31  
-	 *   Pass false to disable indentation.  Pass an array to override the default list of tag names.
32  
-	 */
33  
-	CodeMirror.defineExtension("closeTag", function(cm, ch, indent) {
34  
-		if (!cm.getOption('closeTagEnabled')) {
35  
-			throw CodeMirror.Pass;
36  
-		}
37  
-		
38  
-		var mode = cm.getOption('mode');
39  
-		
40  
-		if (mode == 'text/html') {
41  
-		
42  
-			/*
43  
-			 * Relevant structure of token:
44  
-			 *
45  
-			 * htmlmixed
46  
-			 * 		className
47  
-			 * 		state
48  
-			 * 			htmlState
49  
-			 * 				type
50  
-			 * 				context
51  
-			 * 					tagName
52  
-			 * 			mode
53  
-			 * 
54  
-			 * xml
55  
-			 * 		className
56  
-			 * 		state
57  
-			 * 			tagName
58  
-			 * 			type
59  
-			 */
60  
-		
61  
-			var pos = cm.getCursor();
62  
-			var tok = cm.getTokenAt(pos);
63  
-			var state = tok.state;
64  
-			
65  
-			if (state.mode && state.mode != 'html') {
66  
-				throw CodeMirror.Pass; // With htmlmixed, we only care about the html sub-mode.
67  
-			}
68  
-			
69  
-			if (ch == '>') {
70  
-				var type = state.htmlState ? state.htmlState.type : state.type; // htmlmixed : xml
71  
-				
72  
-				if (tok.className == 'tag' && type == 'closeTag') {
73  
-					throw CodeMirror.Pass; // Don't process the '>' at the end of an end-tag.
74  
-				}
75  
-			
76  
-				cm.replaceSelection('>'); // Mode state won't update until we finish the tag.
77  
-				pos = {line: pos.line, ch: pos.ch + 1};
78  
-				cm.setCursor(pos);
79  
-		
80  
-				tok = cm.getTokenAt(cm.getCursor());
81  
-				state = tok.state;
82  
-				type = state.htmlState ? state.htmlState.type : state.type; // htmlmixed : xml
83  
-
84  
-				if (tok.className == 'tag' && type != 'selfcloseTag') {
85  
-					var tagName = state.htmlState ? state.htmlState.context.tagName : state.tagName; // htmlmixed : xml
86  
-					if (tagName.length > 0) {
87  
-						insertEndTag(cm, indent, pos, tagName);
88  
-					}
89  
-					return;
90  
-				}
91  
-				
92  
-				// Undo the '>' insert and allow cm to handle the key instead.
93  
-				cm.setSelection({line: pos.line, ch: pos.ch - 1}, pos);
94  
-				cm.replaceSelection("");
95  
-			
96  
-			} else if (ch == '/') {
97  
-				if (tok.className == 'tag' && tok.string == '<') {
98  
-					var tagName = state.htmlState ? (state.htmlState.context ? state.htmlState.context.tagName : '') : state.context.tagName; // htmlmixed : xml # extra htmlmized check is for '</' edge case
99  
-					if (tagName.length > 0) {
100  
-						completeEndTag(cm, pos, tagName);
101  
-						return;
102  
-					}
103  
-				}
104  
-			}
105  
-		
106  
-		}
107  
-		
108  
-		throw CodeMirror.Pass; // Bubble if not handled
109  
-	});
110  
-
111  
-	function insertEndTag(cm, indent, pos, tagName) {
112  
-		if (shouldIndent(cm, indent, tagName)) {
113  
-			cm.replaceSelection('\n\n</' + tagName + '>', 'end');
114  
-			cm.indentLine(pos.line + 1);
115  
-			cm.indentLine(pos.line + 2);
116  
-			cm.setCursor({line: pos.line + 1, ch: cm.getLine(pos.line + 1).length});
117  
-		} else {
118  
-			cm.replaceSelection('</' + tagName + '>');
119  
-			cm.setCursor(pos);
120  
-		}
121  
-	}
122  
-	
123  
-	function shouldIndent(cm, indent, tagName) {
124  
-		if (typeof indent == 'undefined' || indent == null || indent == true) {
125  
-			indent = cm.getOption('closeTagIndent');
126  
-		}
127  
-		if (!indent) {
128  
-			indent = [];
129  
-		}
130  
-		return indexOf(indent, tagName.toLowerCase()) != -1;
131  
-	}
132  
-	
133  
-	// C&P from codemirror.js...would be nice if this were visible to utilities.
134  
-	function indexOf(collection, elt) {
135  
-		if (collection.indexOf) return collection.indexOf(elt);
136  
-		for (var i = 0, e = collection.length; i < e; ++i)
137  
-			if (collection[i] == elt) return i;
138  
-		return -1;
139  
-	}
140  
-
141  
-	function completeEndTag(cm, pos, tagName) {
142  
-		cm.replaceSelection('/' + tagName + '>');
143  
-		cm.setCursor({line: pos.line, ch: pos.ch + tagName.length + 2 });
144  
-	}
145  
-	
146  
-})();
  1
+/**
  2
+ * Tag-closer extension for CodeMirror.
  3
+ *
  4
+ * This extension adds a "closeTag" utility function that can be used with key bindings to 
  5
+ * insert a matching end tag after the ">" character of a start tag has been typed.  It can
  6
+ * also complete "</" if a matching start tag is found.  It will correctly ignore signal
  7
+ * characters for empty tags, comments, CDATA, etc.
  8
+ *
  9
+ * The function depends on internal parser state to identify tags.  It is compatible with the
  10
+ * following CodeMirror modes and will ignore all others:
  11
+ * - htmlmixed
  12
+ * - xml
  13
+ *
  14
+ * See demos/closetag.html for a usage example.
  15
+ * 
  16
+ * @author Nathan Williams <nathan@nlwillia.net>
  17
+ * Contributed under the same license terms as CodeMirror.
  18
+ */
  19
+(function() {
  20
+	/** Option that allows tag closing behavior to be toggled.  Default is true. */
  21
+	CodeMirror.defaults['closeTagEnabled'] = true;
  22
+	
  23
+	/** Array of tag names to add indentation after the start tag for.  Default is the list of block-level html tags. */
  24
+	CodeMirror.defaults['closeTagIndent'] = ['applet', 'blockquote', 'body', 'button', 'div', 'dl', 'fieldset', 'form', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'html', 'iframe', 'layer', 'legend', 'object', 'ol', 'p', 'select', 'table', 'ul'];
  25
+
  26
+	/**
  27
+	 * Call during key processing to close tags.  Handles the key event if the tag is closed, otherwise throws CodeMirror.Pass.
  28
+	 * - cm: The editor instance.
  29
+	 * - ch: The character being processed.
  30
+	 * - indent: Optional.  Omit or pass true to use the default indentation tag list defined in the 'closeTagIndent' option.
  31
+	 *   Pass false to disable indentation.  Pass an array to override the default list of tag names.
  32
+	 */
  33
+	CodeMirror.defineExtension("closeTag", function(cm, ch, indent) {
  34
+		if (!cm.getOption('closeTagEnabled')) {
  35
+			throw CodeMirror.Pass;
  36
+		}
  37
+		
  38
+		var mode = cm.getOption('mode');
  39
+		
  40
+		if (mode == 'text/html') {
  41
+		
  42
+			/*
  43
+			 * Relevant structure of token:
  44
+			 *
  45
+			 * htmlmixed
  46
+			 * 		className
  47
+			 * 		state
  48
+			 * 			htmlState
  49
+			 * 				type
  50
+			 * 				context
  51
+			 * 					tagName
  52
+			 * 			mode
  53
+			 * 
  54
+			 * xml
  55
+			 * 		className
  56
+			 * 		state
  57
+			 * 			tagName
  58
+			 * 			type
  59
+			 */
  60
+		
  61
+			var pos = cm.getCursor();
  62
+			var tok = cm.getTokenAt(pos);
  63
+			var state = tok.state;
  64
+			
  65
+			if (state.mode && state.mode != 'html') {
  66
+				throw CodeMirror.Pass; // With htmlmixed, we only care about the html sub-mode.
  67
+			}
  68
+			
  69
+			if (ch == '>') {
  70
+				var type = state.htmlState ? state.htmlState.type : state.type; // htmlmixed : xml
  71
+				
  72
+				if (tok.className == 'tag' && type == 'closeTag') {
  73
+					throw CodeMirror.Pass; // Don't process the '>' at the end of an end-tag.
  74
+				}
  75
+			
  76
+				cm.replaceSelection('>'); // Mode state won't update until we finish the tag.
  77
+				pos = {line: pos.line, ch: pos.ch + 1};
  78
+				cm.setCursor(pos);
  79
+		
  80
+				tok = cm.getTokenAt(cm.getCursor());
  81
+				state = tok.state;
  82
+				type = state.htmlState ? state.htmlState.type : state.type; // htmlmixed : xml
  83
+
  84
+				if (tok.className == 'tag' && type != 'selfcloseTag') {
  85
+					var tagName = state.htmlState ? state.htmlState.context.tagName : state.tagName; // htmlmixed : xml
  86
+					if (tagName.length > 0) {
  87
+						insertEndTag(cm, indent, pos, tagName);
  88
+					}
  89
+					return;
  90
+				}
  91
+				
  92
+				// Undo the '>' insert and allow cm to handle the key instead.
  93
+				cm.setSelection({line: pos.line, ch: pos.ch - 1}, pos);
  94
+				cm.replaceSelection("");
  95
+			
  96
+			} else if (ch == '/') {
  97
+				if (tok.className == 'tag' && tok.string == '<') {
  98
+					var tagName = state.htmlState ? (state.htmlState.context ? state.htmlState.context.tagName : '') : state.context.tagName; // htmlmixed : xml # extra htmlmized check is for '</' edge case
  99
+					if (tagName.length > 0) {
  100
+						completeEndTag(cm, pos, tagName);
  101
+						return;
  102
+					}
  103
+				}
  104
+			}
  105
+		
  106
+		}
  107
+		
  108
+		throw CodeMirror.Pass; // Bubble if not handled
  109
+	});
  110
+
  111
+	function insertEndTag(cm, indent, pos, tagName) {
  112
+		if (shouldIndent(cm, indent, tagName)) {
  113
+			cm.replaceSelection('\n\n</' + tagName + '>', 'end');
  114
+			cm.indentLine(pos.line + 1);
  115
+			cm.indentLine(pos.line + 2);
  116
+			cm.setCursor({line: pos.line + 1, ch: cm.getLine(pos.line + 1).length});
  117
+		} else {
  118
+			cm.replaceSelection('</' + tagName + '>');
  119
+			cm.setCursor(pos);
  120
+		}
  121
+	}
  122
+	
  123
+	function shouldIndent(cm, indent, tagName) {
  124
+		if (typeof indent == 'undefined' || indent == null || indent == true) {
  125
+			indent = cm.getOption('closeTagIndent');
  126
+		}
  127
+		if (!indent) {
  128
+			indent = [];
  129
+		}
  130
+		return indexOf(indent, tagName.toLowerCase()) != -1;
  131
+	}
  132
+	
  133
+	// C&P from codemirror.js...would be nice if this were visible to utilities.
  134
+	function indexOf(collection, elt) {
  135
+		if (collection.indexOf) return collection.indexOf(elt);
  136
+		for (var i = 0, e = collection.length; i < e; ++i)
  137
+			if (collection[i] == elt) return i;
  138
+		return -1;
  139
+	}
  140
+
  141
+	function completeEndTag(cm, pos, tagName) {
  142
+		cm.replaceSelection('/' + tagName + '>');
  143
+		cm.setCursor({line: pos.line, ch: pos.ch + tagName.length + 2 });
  144
+	}
  145
+	
  146
+})();
406  mini-code-edit/cm/mode/ecl/ecl.js
... ...
@@ -1,203 +1,203 @@
1  
-CodeMirror.defineMode("ecl", function(config) {
2  
-
3  
-  function words(str) {
4  
-    var obj = {}, words = str.split(" ");
5  
-    for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
6  
-    return obj;
7  
-  }
8  
-
9  
-  function metaHook(stream, state) {
10  
-    if (!state.startOfLine) return false;
11  
-    stream.skipToEnd();
12  
-    return "meta";
13  
-  }
14  
-
15  
-  function tokenAtString(stream, state) {
16  
-    var next;
17  
-    while ((next = stream.next()) != null) {
18  
-      if (next == '"' && !stream.eat('"')) {
19  
-        state.tokenize = null;
20  
-        break;
21  
-      }
22  
-    }
23  
-    return "string";
24  
-  }
25  
-
26  
-  var indentUnit = config.indentUnit;
27  
-  var keyword = words("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode");
28  
-  var variable = words("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait");
29  
-  var variable_2 = words("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath");
30  
-  var variable_3 = words("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode");
31  
-  var builtin = words("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when");
32  
-  var blockKeywords = words("catch class do else finally for if switch try while");
33  
-  var atoms = words("true false null");
34  
-  var hooks = {"#": metaHook};
35  
-  var multiLineStrings;
36  
-  var isOperatorChar = /[+\-*&%=<>!?|\/]/;
37  
-
38  
-  var curPunc;
39  
-
40  
-  function tokenBase(stream, state) {
41  
-    var ch = stream.next();
42  
-    if (hooks[ch]) {
43  
-      var result = hooks[ch](stream, state);
44  
-      if (result !== false) return result;
45  
-    }
46  
-    if (ch == '"' || ch == "'") {
47  
-      state.tokenize = tokenString(ch);
48  
-      return state.tokenize(stream, state);
49  
-    }
50  
-    if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
51  
-      curPunc = ch;
52  
-      return null
53  
-    }
54  
-    if (/\d/.test(ch)) {
55  
-      stream.eatWhile(/[\w\.]/);
56  
-      return "number";
57  
-    }
58  
-    if (ch == "/") {
59  
-      if (stream.eat("*")) {
60  
-        state.tokenize = tokenComment;
61  
-        return tokenComment(stream, state);
62  
-      }
63  
-      if (stream.eat("/")) {
64  
-        stream.skipToEnd();
65  
-        return "comment";
66  
-      }
67  
-    }
68  
-    if (isOperatorChar.test(ch)) {
69  
-      stream.eatWhile(isOperatorChar);
70  
-      return "operator";
71  
-    }
72  
-    stream.eatWhile(/[\w\$_]/);
73  
-    var cur = stream.current().toLowerCase();
74  
-    if (keyword.propertyIsEnumerable(cur)) {
75  
-      if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
76  
-      return "keyword";
77  
-    } else if (variable.propertyIsEnumerable(cur)) {
78  
-      if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
79  
-      return "variable";
80  
-    } else if (variable_2.propertyIsEnumerable(cur)) {
81  
-      if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
82  
-      return "variable-2";
83  
-    } else if (variable_3.propertyIsEnumerable(cur)) {
84  
-      if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
85  
-      return "variable-3";
86  
-    } else if (builtin.propertyIsEnumerable(cur)) {
87  
-      if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
88  
-      return "builtin";
89  
-    } else { //Data types are of from KEYWORD## 
90  
-		var i = cur.length - 1;
91  
-		while(i >= 0 && (!isNaN(cur[i]) || cur[i] == '_'))
92  
-			--i;
93  
-		
94  
-		if (i > 0) {
95  
-			var cur2 = cur.substr(0, i + 1);
96  
-	    	if (variable_3.propertyIsEnumerable(cur2)) {
97  
-	      		if (blockKeywords.propertyIsEnumerable(cur2)) curPunc = "newstatement";
98  
-	      		return "variable-3";
99  
-	      	}
100  
-	    }
101  
-    }
102  
-    if (atoms.propertyIsEnumerable(cur)) return "atom";
103  
-    return "word";
104  
-  }
105  
-
106  
-  function tokenString(quote) {
107  
-    return function(stream, state) {
108  
-      var escaped = false, next, end = false;
109  
-      while ((next = stream.next()) != null) {
110  
-        if (next == quote && !escaped) {end = true; break;}
111  
-        escaped = !escaped && next == "\\";
112  
-      }
113  
-      if (end || !(escaped || multiLineStrings))
114  
-        state.tokenize = tokenBase;
115  
-      return "string";
116  
-    };
117  
-  }
118  
-
119  
-  function tokenComment(stream, state) {
120  
-    var maybeEnd = false, ch;
121  
-    while (ch = stream.next()) {
122  
-      if (ch == "/" && maybeEnd) {
123  
-        state.tokenize = tokenBase;
124  
-        break;
125  
-      }
126  
-      maybeEnd = (ch == "*");
127  
-    }
128  
-    return "comment";
129  
-  }
130  
-
131  
-  function Context(indented, column, type, align, prev) {
132  
-    this.indented = indented;
133  
-    this.column = column;
134  
-    this.type = type;
135  
-    this.align = align;
136  
-    this.prev = prev;
137  
-  }
138  
-  function pushContext(state, col, type) {
139  
-    return state.context = new Context(state.indented, col, type, null, state.context);
140  
-  }
141  
-  function popContext(state) {
142  
-    var t = state.context.type;
143  
-    if (t == ")" || t == "]" || t == "}")
144  
-      state.indented = state.context.indented;
145  
-    return state.context = state.context.prev;
146  
-  }
147  
-
148  
-  // Interface
149  
-
150  
-  return {
151  
-    startState: function(basecolumn) {
152  
-      return {
153  
-        tokenize: null,
154  
-        context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
155  
-        indented: 0,
156  
-        startOfLine: true
157  
-      };
158  
-    },
159  
-
160  
-    token: function(stream, state) {
161  
-      var ctx = state.context;
162  
-      if (stream.sol()) {
163  
-        if (ctx.align == null) ctx.align = false;
164  
-        state.indented = stream.indentation();
165  
-        state.startOfLine = true;
166  
-      }
167  
-      if (stream.eatSpace()) return null;
168  
-      curPunc = null;
169  
-      var style = (state.tokenize || tokenBase)(stream, state);
170  
-      if (style == "comment" || style == "meta") return style;
171  
-      if (ctx.align == null) ctx.align = true;
172  
-
173  
-      if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state);
174  
-      else if (curPunc == "{") pushContext(state, stream.column(), "}");
175  
-      else if (curPunc == "[") pushContext(state, stream.column(), "]");
176  
-      else if (curPunc == "(") pushContext(state, stream.column(), ")");
177  
-      else if (curPunc == "}") {
178  
-        while (ctx.type == "statement") ctx = popContext(state);
179  
-        if (ctx.type == "}") ctx = popContext(state);
180  
-        while (ctx.type == "statement") ctx = popContext(state);
181  
-      }
182  
-      else if (curPunc == ctx.type) popContext(state);
183  
-      else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement"))
184  
-        pushContext(state, stream.column(), "statement");
185  
-      state.startOfLine = false;
186  
-      return style;
187  
-    },
188  
-
189  
-    indent: function(state, textAfter) {
190  
-      if (state.tokenize != tokenBase && state.tokenize != null) return 0;
191  
-      var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
192  
-      if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
193  
-      var closing = firstChar == ctx.type;
194  
-      if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit);
195  
-      else if (ctx.align) return ctx.column + (closing ? 0 : 1);
196  
-      else return ctx.indented + (closing ? 0 : indentUnit);
197  
-    },
198  
-
199  
-    electricChars: "{}"
200  
-  };
201  
-});
202  
-
203  
-CodeMirror.defineMIME("text/x-ecl");
  1
+CodeMirror.defineMode("ecl", function(config) {
  2
+
  3
+  function words(str) {
  4
+    var obj = {}, words = str.split(" ");
  5
+    for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
  6
+    return obj;
  7
+  }
  8
+
  9
+  function metaHook(stream, state) {
  10
+    if (!state.startOfLine) return false;
  11
+    stream.skipToEnd();
  12
+    return "meta";
  13
+  }
  14
+
  15
+  function tokenAtString(stream, state) {
  16
+    var next;
  17
+    while ((next = stream.next()) != null) {
  18
+      if (next == '"' && !stream.eat('"')) {
  19
+        state.tokenize = null;
  20
+        break;
  21
+      }
  22
+    }
  23
+    return "string";
  24
+  }
  25
+
  26
+  var indentUnit = config.indentUnit;
  27
+  var keyword = words("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode");
  28
+  var variable = words("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait");
  29
+  var variable_2 = words("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath");
  30
+  var variable_3 = words("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode");
  31
+  var builtin = words("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when");
  32
+  var blockKeywords = words("catch class do else finally for if switch try while");
  33
+  var atoms = words("true false null");
  34
+  var hooks = {"#": metaHook};
  35
+  var multiLineStrings;
  36
+  var isOperatorChar = /[+\-*&%=<>!?|\/]/;
  37
+
  38
+  var curPunc;
  39
+
  40
+  function tokenBase(stream, state) {
  41
+    var ch = stream.next();
  42
+    if (hooks[ch]) {
  43
+      var result = hooks[ch](stream, state);
  44
+      if (result !== false) return result;
  45
+    }
  46
+    if (ch == '"' || ch == "'") {
  47
+      state.tokenize = tokenString(ch);
  48
+      return state.tokenize(stream, state);
  49
+    }
  50
+    if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
  51
+      curPunc = ch;
  52
+      return null
  53
+    }
  54
+    if (/\d/.test(ch)) {
  55
+      stream.eatWhile(/[\w\.]/);
  56
+      return "number";
  57
+    }
  58
+    if (ch == "/") {
  59
+      if (stream.eat("*")) {
  60
+        state.tokenize = tokenComment;
  61
+        return tokenComment(stream, state);
  62
+      }
  63
+      if (stream.eat("/")) {
  64
+        stream.skipToEnd();
  65
+        return "comment";
  66
+      }
  67
+    }
  68
+    if (isOperatorChar.test(ch)) {
  69
+      stream.eatWhile(isOperatorChar);
  70
+      return "operator";
  71
+    }
  72
+    stream.eatWhile(/[\w\$_]/);
  73
+    var cur = stream.current().toLowerCase();
  74
+    if (keyword.propertyIsEnumerable(cur)) {
  75
+      if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
  76
+      return "keyword";
  77
+    } else if (variable.propertyIsEnumerable(cur)) {
  78
+      if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
  79
+      return "variable";
  80
+    } else if (variable_2.propertyIsEnumerable(cur)) {
  81
+      if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
  82
+      return "variable-2";
  83
+    } else if (variable_3.propertyIsEnumerable(cur)) {
  84
+      if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
  85
+      return "variable-3";
  86
+    } else if (builtin.propertyIsEnumerable(cur)) {
  87
+      if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
  88
+      return "builtin";
  89
+    } else { //Data types are of from KEYWORD## 
  90
+		var i = cur.length - 1;
  91
+		while(i >= 0 && (!isNaN(cur[i]) || cur[i] == '_'))
  92
+			--i;
  93
+		
  94
+		if (i > 0) {
  95
+			var cur2 = cur.substr(0, i + 1);
  96
+	    	if (variable_3.propertyIsEnumerable(cur2)) {
  97
+	      		if (blockKeywords.propertyIsEnumerable(cur2)) curPunc = "newstatement";
  98
+	      		return "variable-3";
  99
+	      	}
  100
+	    }
  101
+    }
  102
+    if (atoms.propertyIsEnumerable(cur)) return "atom";
  103
+    return "word";
  104
+  }
  105
+
  106
+  function tokenString(quote) {
  107
+    return function(stream, state) {
  108
+      var escaped = false, next, end = false;
  109
+      while ((next = stream.next()) != null) {
  110
+        if (next == quote && !escaped) {end = true; break;}
  111
+        escaped = !escaped && next == "\\";
  112
+      }
  113
+      if (end || !(escaped || multiLineStrings))
  114
+        state.tokenize = tokenBase;
  115
+      return "string";
  116
+    };
  117
+  }
  118
+
  119
+  function tokenComment(stream, state) {
  120
+    var maybeEnd = false, ch;
  121
+    while (ch = stream.next()) {
  122
+      if (ch == "/" && maybeEnd) {
  123
+        state.tokenize = tokenBase;
  124
+        break;
  125
+      }
  126
+      maybeEnd = (ch == "*");
  127
+    }
  128
+    return "comment";
  129
+  }
  130
+
  131
+  function Context(indented, column, type, align, prev) {
  132
+    this.indented = indented;
  133
+    this.column = column;
  134
+    this.type = type;
  135
+    this.align = align;
  136
+    this.prev = prev;
  137
+  }
  138
+  function pushContext(state, col, type) {
  139
+    return state.context = new Context(state.indented, col, type, null, state.context);
  140
+  }
  141
+  function popContext(state) {
  142
+    var t = state.context.type;
  143
+    if (t == ")" || t == "]" || t == "}")
  144
+      state.indented = state.context.indented;
  145
+    return state.context = state.context.prev;
  146
+  }
  147
+
  148
+  // Interface
  149
+
  150
+  return {
  151
+    startState: function(basecolumn) {
  152
+      return {
  153
+        tokenize: null,
  154
+        context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
  155
+        indented: 0,
  156
+        startOfLine: true
  157
+      };
  158
+    },
  159
+
  160
+    token: function(stream, state) {
  161
+      var ctx = state.context;
  162
+      if (stream.sol()) {
  163
+        if (ctx.align == null) ctx.align = false;
  164
+        state.indented = stream.indentation();
  165
+        state.startOfLine = true;
  166
+      }
  167
+      if (stream.eatSpace()) return null;
  168
+      curPunc = null;
  169
+      var style = (state.tokenize || tokenBase)(stream, state);
  170
+      if (style == "comment" || style == "meta") return style;
  171
+      if (ctx.align == null) ctx.align = true;
  172
+
  173
+      if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state);
  174
+      else if (curPunc == "{") pushContext(state, stream.column(), "}");
  175
+      else if (curPunc == "[") pushContext(state, stream.column(), "]");
  176
+      else if (curPunc == "(") pushContext(state, stream.column(), ")");
  177
+      else if (curPunc == "}") {
  178
+        while (ctx.type == "statement") ctx = popContext(state);
  179
+        if (ctx.type == "}") ctx = popContext(state);
  180
+        while (ctx.type == "statement") ctx = popContext(state);
  181
+      }
  182
+      else if (curPunc == ctx.type) popContext(state);
  183
+      else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement"))
  184
+        pushContext(state, stream.column(), "statement");
  185
+      state.startOfLine = false;
  186
+      return style;
  187
+    },
  188
+
  189
+    indent: function(state, textAfter) {
  190
+      if (state.tokenize != tokenBase && state.tokenize != null) return 0;