summaryrefslogtreecommitdiffstats
path: root/media/CodeMirror-0.62/js/parsedummy.js
diff options
context:
space:
mode:
authorgoatchurch <devnull@localhost>2009-06-28 21:26:35 +0100
committergoatchurch <devnull@localhost>2009-06-28 21:26:35 +0100
commit16b7404d9bc2f9ba264f140310948897689fe3ca (patch)
treecae9ee2d6ea64b7a80602f587ee539f6501ed4d7 /media/CodeMirror-0.62/js/parsedummy.js
parentdb5e315db022cd253a9f7224637228bf62449ec6 (diff)
downloadtroggle-16b7404d9bc2f9ba264f140310948897689fe3ca.tar.gz
troggle-16b7404d9bc2f9ba264f140310948897689fe3ca.tar.bz2
troggle-16b7404d9bc2f9ba264f140310948897689fe3ca.zip
[svn] horrid .svns copied accidentally
Diffstat (limited to 'media/CodeMirror-0.62/js/parsedummy.js')
-rw-r--r--media/CodeMirror-0.62/js/parsedummy.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/media/CodeMirror-0.62/js/parsedummy.js b/media/CodeMirror-0.62/js/parsedummy.js
new file mode 100644
index 0000000..9e63caa
--- /dev/null
+++ b/media/CodeMirror-0.62/js/parsedummy.js
@@ -0,0 +1,32 @@
+var DummyParser = Editor.Parser = (function() {
+ function tokenizeDummy(source) {
+ while (!source.endOfLine()) source.next();
+ return "text";
+ }
+ function parseDummy(source) {
+ function indentTo(n) {return function() {return n;}}
+ source = tokenizer(source, tokenizeDummy);
+ var space = 0;
+
+ var iter = {
+ next: function() {
+ var tok = source.next();
+ if (tok.type == "whitespace") {
+ if (tok.value == "\n") tok.indentation = indentTo(space);
+ else space = tok.value.length;
+ }
+ return tok;
+ },
+ copy: function() {
+ var _space = space;
+ return function(_source) {
+ space = _space;
+ source = tokenizer(_source, tokenizeDummy);
+ return iter;
+ };
+ }
+ };
+ return iter;
+ }
+ return {make: parseDummy};
+})();