1950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com(function(mod) { 2950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (typeof exports == "object" && typeof module == "object") // CommonJS 3950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com mod(require("../../lib/codemirror")); 4950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com else if (typeof define == "function" && define.amd) // AMD 5950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com define(["../../lib/codemirror"], mod); 6950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com else // Plain browser env 7950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com mod(CodeMirror); 8950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com})(function(CodeMirror) { 9950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com"use strict"; 10950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 11950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.comCodeMirror.defineMode("clike", function(config, parserConfig) { 12950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var indentUnit = config.indentUnit, 13950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, 14950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com dontAlignCalls = parserConfig.dontAlignCalls, 15950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com keywords = parserConfig.keywords || {}, 16950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com builtin = parserConfig.builtin || {}, 17950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com blockKeywords = parserConfig.blockKeywords || {}, 18950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com atoms = parserConfig.atoms || {}, 19950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com hooks = parserConfig.hooks || {}, 20950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com multiLineStrings = parserConfig.multiLineStrings; 21950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var isOperatorChar = /[+\-*&%=<>!?|\/]/; 22950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 23950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var curPunc; 24950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 25950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com function tokenBase(stream, state) { 26950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var ch = stream.next(); 27950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (hooks[ch]) { 28950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var result = hooks[ch](stream, state); 29950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (result !== false) return result; 30950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 31950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (ch == '"' || ch == "'") { 32950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com state.tokenize = tokenString(ch); 33950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return state.tokenize(stream, state); 34950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 35950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (/[\[\]{}\(\),;\:\.]/.test(ch)) { 36950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com curPunc = ch; 37950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return null; 38950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 39950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (/\d/.test(ch)) { 40950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com stream.eatWhile(/[\w\.]/); 41950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return "number"; 42950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 43950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (ch == "/") { 44950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (stream.eat("*")) { 45950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com state.tokenize = tokenComment; 46950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return tokenComment(stream, state); 47950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 48950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (stream.eat("/")) { 49950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com stream.skipToEnd(); 50950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return "comment"; 51950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 52950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 53950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (isOperatorChar.test(ch)) { 54950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com stream.eatWhile(isOperatorChar); 55950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return "operator"; 56950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 57950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com stream.eatWhile(/[\w\$_]/); 58950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var cur = stream.current(); 59950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (keywords.propertyIsEnumerable(cur)) { 60950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; 61950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return "keyword"; 62950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 63950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (builtin.propertyIsEnumerable(cur)) { 64950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; 65950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return "builtin"; 66950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 67950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (atoms.propertyIsEnumerable(cur)) return "atom"; 68950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return "variable"; 69950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 70950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 71950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com function tokenString(quote) { 72950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return function(stream, state) { 73950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var escaped = false, next, end = false; 74950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com while ((next = stream.next()) != null) { 75950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (next == quote && !escaped) {end = true; break;} 76950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com escaped = !escaped && next == "\\"; 77950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 78950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (end || !(escaped || multiLineStrings)) 79950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com state.tokenize = null; 80950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return "string"; 81950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com }; 82950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 83950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 84950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com function tokenComment(stream, state) { 85950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var maybeEnd = false, ch; 86950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com while (ch = stream.next()) { 87950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (ch == "/" && maybeEnd) { 88950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com state.tokenize = null; 89950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com break; 90950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 91950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com maybeEnd = (ch == "*"); 92950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 93950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return "comment"; 94950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 95950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 96950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com function Context(indented, column, type, align, prev) { 97950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com this.indented = indented; 98950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com this.column = column; 99950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com this.type = type; 100950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com this.align = align; 101950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com this.prev = prev; 102950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 103950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com function pushContext(state, col, type) { 104950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var indent = state.indented; 105950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (state.context && state.context.type == "statement") 106950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com indent = state.context.indented; 107950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return state.context = new Context(indent, col, type, null, state.context); 108950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 109950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com function popContext(state) { 110950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var t = state.context.type; 111950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (t == ")" || t == "]" || t == "}") 112950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com state.indented = state.context.indented; 113950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return state.context = state.context.prev; 114950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 115950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 116950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com // Interface 117950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 118950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return { 119950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com startState: function(basecolumn) { 120950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return { 121950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com tokenize: null, 122950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), 123950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com indented: 0, 124950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com startOfLine: true 125950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com }; 126950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com }, 127950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 128950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com token: function(stream, state) { 129950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var ctx = state.context; 130950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (stream.sol()) { 131950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (ctx.align == null) ctx.align = false; 132950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com state.indented = stream.indentation(); 133950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com state.startOfLine = true; 134950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 135950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (stream.eatSpace()) return null; 136950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com curPunc = null; 137950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var style = (state.tokenize || tokenBase)(stream, state); 138950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (style == "comment" || style == "meta") return style; 139950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (ctx.align == null) ctx.align = true; 140950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 141950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state); 142950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com else if (curPunc == "{") pushContext(state, stream.column(), "}"); 143950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com else if (curPunc == "[") pushContext(state, stream.column(), "]"); 144950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com else if (curPunc == "(") pushContext(state, stream.column(), ")"); 145950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com else if (curPunc == "}") { 146950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com while (ctx.type == "statement") ctx = popContext(state); 147950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (ctx.type == "}") ctx = popContext(state); 148950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com while (ctx.type == "statement") ctx = popContext(state); 149950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 150950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com else if (curPunc == ctx.type) popContext(state); 151950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com else if (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || (ctx.type == "statement" && curPunc == "newstatement")) 152950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com pushContext(state, stream.column(), "statement"); 153950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com state.startOfLine = false; 154950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return style; 155950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com }, 156950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 157950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com indent: function(state, textAfter) { 158950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; 159950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); 160950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; 161950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var closing = firstChar == ctx.type; 162950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); 163950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com else if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1); 164950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit; 165950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com else return ctx.indented + (closing ? 0 : indentUnit); 166950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com }, 167950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 168950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com electricChars: "{}", 169950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com blockCommentStart: "/*", 170950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com blockCommentEnd: "*/", 171950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com lineComment: "//", 172950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com fold: "brace" 173950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com }; 174950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com}); 175950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 176950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com function words(str) { 177950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var obj = {}, words = str.split(" "); 178950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com for (var i = 0; i < words.length; ++i) obj[words[i]] = true; 179950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return obj; 180950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 181950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var cKeywords = "auto if break int case long char register continue return default short do sizeof " + 182950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "double static else struct entry switch extern typedef float union for unsigned " + 183950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "goto while enum void const signed volatile"; 184950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 185950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com function cppHook(stream, state) { 186950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (!state.startOfLine) return false; 187950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com for (;;) { 188950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (stream.skipTo("\\")) { 189950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com stream.next(); 190950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (stream.eol()) { 191950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com state.tokenize = cppHook; 192950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com break; 193950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 194950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } else { 195950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com stream.skipToEnd(); 196950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com state.tokenize = null; 197950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com break; 198950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 199950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 200950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return "meta"; 201950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 202950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 203950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com function cpp11StringHook(stream, state) { 204950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com stream.backUp(1); 205950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com // Raw strings. 206950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (stream.match(/(R|u8R|uR|UR|LR)/)) { 207950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var match = stream.match(/"(.{0,16})\(/); 208950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (!match) { 209950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return false; 210950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 211950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com state.cpp11RawStringDelim = match[1]; 212950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com state.tokenize = tokenRawString; 213950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return tokenRawString(stream, state); 214950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 215950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com // Unicode strings/chars. 216950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (stream.match(/(u8|u|U|L)/)) { 217950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (stream.match(/["']/, /* eat */ false)) { 218950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return "string"; 219950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 220950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return false; 221950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 222950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com // Ignore this hook. 223950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com stream.next(); 224950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return false; 225950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 226950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 227950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com // C#-style strings where "" escapes a quote. 228950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com function tokenAtString(stream, state) { 229950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var next; 230950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com while ((next = stream.next()) != null) { 231950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (next == '"' && !stream.eat('"')) { 232950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com state.tokenize = null; 233950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com break; 234950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 235950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 236950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return "string"; 237950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 238950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 239950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com // C++11 raw string literal is <prefix>"<delim>( anything )<delim>", where 240950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com // <delim> can be a string up to 16 characters long. 241950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com function tokenRawString(stream, state) { 242950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var closingSequence = new RegExp(".*?\\)" + state.cpp11RawStringDelim + '"'); 243950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var match = stream.match(closingSequence); 244950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (match) { 245950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com state.tokenize = null; 246950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } else { 247950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com stream.skipToEnd(); 248950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 249950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return "string"; 250950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 251950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 252950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com function def(mimes, mode) { 253950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (typeof mimes == "string") mimes = [mimes]; 254950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com var words = []; 255950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com function add(obj) { 256950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop)) 257950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com words.push(prop); 258950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 259950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com add(mode.keywords); 260950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com add(mode.builtin); 261950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com add(mode.atoms); 262950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (words.length) { 263950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com mode.helperType = mimes[0]; 264950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com CodeMirror.registerHelper("hintWords", mimes[0], words); 265950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 266950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 267950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com for (var i = 0; i < mimes.length; ++i) 268950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com CodeMirror.defineMIME(mimes[i], mode); 269950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 270950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 271950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com def(["text/x-csrc", "text/x-c", "text/x-chdr"], { 272950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com name: "clike", 273950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com keywords: words(cKeywords), 274950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com blockKeywords: words("case do else for if switch while struct"), 275950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com atoms: words("null"), 276950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com hooks: {"#": cppHook}, 277950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com modeProps: {fold: ["brace", "include"]} 278950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com }); 279950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 280950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com def(["text/x-c++src", "text/x-c++hdr"], { 281950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com name: "clike", 282950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " + 283950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "static_cast typeid catch operator template typename class friend private " + 284950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "this using const_cast inline public throw virtual delete mutable protected " + 285950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final " + 286950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "static_assert override"), 287950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com blockKeywords: words("catch class do else finally for if struct switch try while"), 288950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com atoms: words("true false null"), 289950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com hooks: { 290950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "#": cppHook, 291950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "u": cpp11StringHook, 292950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "U": cpp11StringHook, 293950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "L": cpp11StringHook, 294950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "R": cpp11StringHook 295950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com }, 296950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com modeProps: {fold: ["brace", "include"]} 297950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com }); 298950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com def("text/x-java", { 299950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com name: "clike", 300950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com keywords: words("abstract assert boolean break byte case catch char class const continue default " + 301950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "do double else enum extends final finally float for goto if implements import " + 302950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "instanceof int interface long native new package private protected public " + 303950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "return short static strictfp super switch synchronized this throw throws transient " + 304950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "try void volatile while"), 305950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com blockKeywords: words("catch class do else finally for if switch try while"), 306950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com atoms: words("true false null"), 307950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com hooks: { 308950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "@": function(stream) { 309950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com stream.eatWhile(/[\w\$_]/); 310950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return "meta"; 311950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 312950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com }, 313950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com modeProps: {fold: ["brace", "import"]} 314950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com }); 315950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com def("text/x-csharp", { 316950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com name: "clike", 317950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com keywords: words("abstract as base break case catch checked class const continue" + 318950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com " default delegate do else enum event explicit extern finally fixed for" + 319950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com " foreach goto if implicit in interface internal is lock namespace new" + 320950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com " operator out override params private protected public readonly ref return sealed" + 321950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com " sizeof stackalloc static struct switch this throw try typeof unchecked" + 322950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com " unsafe using virtual void volatile while add alias ascending descending dynamic from get" + 323950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com " global group into join let orderby partial remove select set value var yield"), 324950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com blockKeywords: words("catch class do else finally for foreach if struct switch try while"), 325950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com builtin: words("Boolean Byte Char DateTime DateTimeOffset Decimal Double" + 326950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com " Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32" + 327950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com " UInt64 bool byte char decimal double short int long object" + 328950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com " sbyte float string ushort uint ulong"), 329950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com atoms: words("true false null"), 330950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com hooks: { 331950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "@": function(stream, state) { 332950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com if (stream.eat('"')) { 333950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com state.tokenize = tokenAtString; 334950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return tokenAtString(stream, state); 335950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 336950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com stream.eatWhile(/[\w\$_]/); 337950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return "meta"; 338950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 339950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 340950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com }); 341950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com def("text/x-scala", { 342950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com name: "clike", 343950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com keywords: words( 344950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 345950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com /* scala */ 346950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "abstract case catch class def do else extends false final finally for forSome if " + 347950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "implicit import lazy match new null object override package private protected return " + 348950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "sealed super this throw trait try trye type val var while with yield _ : = => <- <: " + 349950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "<% >: # @ " + 350950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 351950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com /* package scala */ 352950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "assert assume require print println printf readLine readBoolean readByte readShort " + 353950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "readChar readInt readLong readFloat readDouble " + 354950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 355950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " + 356950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " + 357950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " + 358950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " + 359950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: " + 360950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 361950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com /* package java.lang */ 362950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " + 363950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " + 364950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " + 365950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void" 366950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 367950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 368950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com ), 369950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com blockKeywords: words("catch class do else finally for forSome if match switch try while"), 370950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com atoms: words("true false null"), 371950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com hooks: { 372950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "@": function(stream) { 373950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com stream.eatWhile(/[\w\$_]/); 374950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com return "meta"; 375950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 376950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com } 377950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com }); 378950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com def(["x-shader/x-vertex", "x-shader/x-fragment"], { 379950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com name: "clike", 380950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com keywords: words("float int bool void " + 381950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " + 382950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "mat2 mat3 mat4 " + 383950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "sampler1D sampler2D sampler3D samplerCube " + 384950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "sampler1DShadow sampler2DShadow" + 385950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "const attribute uniform varying " + 386950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "break continue discard return " + 387950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "for while do if else struct " + 388950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "in out inout"), 389950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com blockKeywords: words("for while do if else struct"), 390950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com builtin: words("radians degrees sin cos tan asin acos atan " + 391950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "pow exp log exp2 sqrt inversesqrt " + 392950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "abs sign floor ceil fract mod min max clamp mix step smootstep " + 393950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "length distance dot cross normalize ftransform faceforward " + 394950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "reflect refract matrixCompMult " + 395950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "lessThan lessThanEqual greaterThan greaterThanEqual " + 396950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "equal notEqual any all not " + 397950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "texture1D texture1DProj texture1DLod texture1DProjLod " + 398950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "texture2D texture2DProj texture2DLod texture2DProjLod " + 399950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "texture3D texture3DProj texture3DLod texture3DProjLod " + 400950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "textureCube textureCubeLod " + 401950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "shadow1D shadow2D shadow1DProj shadow2DProj " + 402950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " + 403950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "dFdx dFdy fwidth " + 404950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "noise1 noise2 noise3 noise4"), 405950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com atoms: words("true false " + 406950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " + 407950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " + 408950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " + 409950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_FogCoord " + 410950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_Position gl_PointSize gl_ClipVertex " + 411950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " + 412950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_TexCoord gl_FogFragCoord " + 413950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_FragCoord gl_FrontFacing " + 414950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_FragColor gl_FragData gl_FragDepth " + 415950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " + 416950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " + 417950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " + 418950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " + 419950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_ProjectionMatrixInverseTranspose " + 420950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_ModelViewProjectionMatrixInverseTranspose " + 421950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_TextureMatrixInverseTranspose " + 422950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_NormalScale gl_DepthRange gl_ClipPlane " + 423950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " + 424950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_FrontLightModelProduct gl_BackLightModelProduct " + 425950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " + 426950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_FogParameters " + 427950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " + 428950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " + 429950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " + 430950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " + 431950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com "gl_MaxDrawBuffers"), 432950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com hooks: {"#": cppHook}, 433950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com modeProps: {fold: ["brace", "include"]} 434950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com }); 435950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com 436950306ccf1af3f07944636df55daf3da878b7fc4fmalita@google.com}); 437