Server IP : 195.201.23.43 / Your IP : 18.217.148.255 Web Server : Apache System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 User : kdecoratie ( 1041) PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/kdecoratie/public_html/media/editors/codemirror/mode/cmake/ |
Upload File : |
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) define(["../../lib/codemirror"], mod); else mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineMode("cmake", function () { var variable_regex = /({)?[a-zA-Z0-9_]+(})?/; function tokenString(stream, state) { var current, prev, found_var = false; while (!stream.eol() && (current = stream.next()) != state.pending) { if (current === '$' && prev != '\\' && state.pending == '"') { found_var = true; break; } prev = current; } if (found_var) { stream.backUp(1); } if (current == state.pending) { state.continueString = false; } else { state.continueString = true; } return "string"; } function tokenize(stream, state) { var ch = stream.next(); // Have we found a variable? if (ch === '$') { if (stream.match(variable_regex)) { return 'variable-2'; } return 'variable'; } // Should we still be looking for the end of a string? if (state.continueString) { // If so, go through the loop again stream.backUp(1); return tokenString(stream, state); } // Do we just have a function on our hands? // In 'cmake_minimum_required (VERSION 2.8.8)', 'cmake_minimum_required' is matched if (stream.match(/(\s+)?\w+\(/) || stream.match(/(\s+)?\w+\ \(/)) { stream.backUp(1); return 'def'; } if (ch == "#") { stream.skipToEnd(); return "comment"; } // Have we found a string? if (ch == "'" || ch == '"') { // Store the type (single or double) state.pending = ch; // Perform the looping function to find the end return tokenString(stream, state); } if (ch == '(' || ch == ')') { return 'bracket'; } if (ch.match(/[0-9]/)) { return 'number'; } stream.eatWhile(/[\w-]/); return null; } return { startState: function () { var state = {}; state.inDefinition = false; state.inInclude = false; state.continueString = false; state.pending = false; return state; }, token: function (stream, state) { if (stream.eatSpace()) return null; return tokenize(stream, state); } }; }); CodeMirror.defineMIME("text/x-cmake", "cmake"); });Private