##// END OF EJS Templates
Updating ipython CM mode.
Brian E. Granger -
Show More
@@ -1,3 +1,6 b''
1 // This is an ipython mode for CodeMirror. We started from the CM Python mode and renamed
2 // it to ipython. We have then marked all other changes we have made to the file.
3
1 CodeMirror.defineMode("ipython", function(conf, parserConf) {
4 CodeMirror.defineMode("ipython", function(conf, parserConf) {
2 var ERRORCLASS = 'error';
5 var ERRORCLASS = 'error';
3
6
@@ -5,7 +8,9 b' CodeMirror.defineMode("ipython", function(conf, parserConf) {'
5 return new RegExp("^((" + words.join(")|(") + "))\\b");
8 return new RegExp("^((" + words.join(")|(") + "))\\b");
6 }
9 }
7
10
8 var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!]");
11 // IPython-specific changes: add '?' as recognized character using \\?
12 var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!\\?]");
13 // End IPython changes.
9 var singleDelimiters = parserConf.singleDelimiters || new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]');
14 var singleDelimiters = parserConf.singleDelimiters || new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]');
10 var doubleOperators = parserConf.doubleOperators || new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))");
15 var doubleOperators = parserConf.doubleOperators || new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))");
11 var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))");
16 var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))");
@@ -337,4 +342,4 b' CodeMirror.defineMode("ipython", function(conf, parserConf) {'
337 return external;
342 return external;
338 });
343 });
339
344
340 CodeMirror.defineMIME("text/x-python", "python");
345 CodeMirror.defineMIME("text/x-ipython", "ipython");
General Comments 0
You need to be logged in to leave comments. Login now