: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Brainfuck mode created by Michael Kaminsky https://github.com/mkaminsky11
if (typeof exports == "object" && typeof module == "object")
mod(require("../../lib/codemirror"))
else if (typeof define == "function" && define.amd)
define(["../../lib/codemirror"], mod)
})(function(CodeMirror) {
var reserve = "><+-.,[]".split("");
where reserved characters cannot be used
this is ok to use [ ] and stuff
CodeMirror.defineMode("brainfuck", function() {
token: function(stream, state) {
if (stream.eatSpace()) return null
state.commentLine = false;
var ch = stream.next().toString();
if(reserve.indexOf(ch) !== -1){
if(state.commentLine === true){
state.commentLine = false;
if(ch === "]" || ch === "["){
else if(ch === "+" || ch === "-"){
else if(ch === "<" || ch === ">"){
else if(ch === "." || ch === ","){
state.commentLine = true;
state.commentLine = false;
state.commentLine = false;
CodeMirror.defineMIME("text/x-brainfuck","brainfuck")