Adding tests and limiting CM mode to python 3.

Brian E. Granger 12 years ago
parent 2dfd4079ec
commit a67c7e83a6

@ -15,7 +15,12 @@ CodeMirror.requireMode('python',function(){
}
pythonConf.name = 'python';
pythonConf.singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!\\?]");
pythonConf.identifiers = new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*");
if (pythonConf.version === 3) {
console.log('setting up for python 3');
pythonConf.identifiers = new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*");
} else if (pythonConf.version === 2) {
pythonConf.identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*");
}
return CodeMirror.getMode(conf, pythonConf);
}, 'python');

Loading…
Cancel
Save