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 | 4 | CodeMirror.defineMode("ipython", function(conf, parserConf) { |
|
2 | 5 | var ERRORCLASS = 'error'; |
|
3 | 6 | |
@@ -5,7 +8,9 b' CodeMirror.defineMode("ipython", function(conf, parserConf) {' | |||
|
5 | 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 | 14 | var singleDelimiters = parserConf.singleDelimiters || new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); |
|
10 | 15 | var doubleOperators = parserConf.doubleOperators || new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); |
|
11 | 16 | var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); |
@@ -337,4 +342,4 b' CodeMirror.defineMode("ipython", function(conf, parserConf) {' | |||
|
337 | 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