codemirror-rails 3.24 → 4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/lib/codemirror/rails/version.rb +2 -2
  3. data/vendor/assets/javascripts/codemirror.js +3001 -1798
  4. data/vendor/assets/javascripts/codemirror/addons/comment/comment.js +24 -4
  5. data/vendor/assets/javascripts/codemirror/addons/comment/continuecomment.js +47 -32
  6. data/vendor/assets/javascripts/codemirror/addons/dialog/dialog.js +9 -2
  7. data/vendor/assets/javascripts/codemirror/addons/display/fullscreen.js +9 -2
  8. data/vendor/assets/javascripts/codemirror/addons/display/placeholder.js +9 -2
  9. data/vendor/assets/javascripts/codemirror/addons/display/rulers.js +9 -2
  10. data/vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js +76 -37
  11. data/vendor/assets/javascripts/codemirror/addons/edit/closetag.js +59 -37
  12. data/vendor/assets/javascripts/codemirror/addons/edit/continuelist.js +25 -17
  13. data/vendor/assets/javascripts/codemirror/addons/edit/matchbrackets.js +67 -46
  14. data/vendor/assets/javascripts/codemirror/addons/edit/matchtags.js +10 -3
  15. data/vendor/assets/javascripts/codemirror/addons/edit/trailingspace.js +23 -14
  16. data/vendor/assets/javascripts/codemirror/addons/fold/brace-fold.js +12 -3
  17. data/vendor/assets/javascripts/codemirror/addons/fold/comment-fold.js +12 -0
  18. data/vendor/assets/javascripts/codemirror/addons/fold/foldcode.js +28 -3
  19. data/vendor/assets/javascripts/codemirror/addons/fold/foldgutter.js +9 -2
  20. data/vendor/assets/javascripts/codemirror/addons/fold/indent-fold.js +12 -1
  21. data/vendor/assets/javascripts/codemirror/addons/fold/markdown-fold.js +12 -0
  22. data/vendor/assets/javascripts/codemirror/addons/fold/xml-fold.js +9 -4
  23. data/vendor/assets/javascripts/codemirror/addons/hint/anyword-hint.js +9 -2
  24. data/vendor/assets/javascripts/codemirror/addons/hint/css-hint.js +10 -3
  25. data/vendor/assets/javascripts/codemirror/addons/hint/html-hint.js +11 -3
  26. data/vendor/assets/javascripts/codemirror/addons/hint/javascript-hint.js +9 -4
  27. data/vendor/assets/javascripts/codemirror/addons/hint/python-hint.js +11 -3
  28. data/vendor/assets/javascripts/codemirror/addons/hint/show-hint.js +10 -4
  29. data/vendor/assets/javascripts/codemirror/addons/hint/sql-hint.js +9 -2
  30. data/vendor/assets/javascripts/codemirror/addons/hint/xml-hint.js +22 -34
  31. data/vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js +12 -1
  32. data/vendor/assets/javascripts/codemirror/addons/lint/css-lint.js +12 -1
  33. data/vendor/assets/javascripts/codemirror/addons/lint/javascript-lint.js +9 -4
  34. data/vendor/assets/javascripts/codemirror/addons/lint/json-lint.js +12 -1
  35. data/vendor/assets/javascripts/codemirror/addons/lint/lint.js +12 -8
  36. data/vendor/assets/javascripts/codemirror/addons/lint/yaml-lint.js +12 -1
  37. data/vendor/assets/javascripts/codemirror/addons/merge/merge.js +18 -16
  38. data/vendor/assets/javascripts/codemirror/addons/mode/loadmode.js +9 -2
  39. data/vendor/assets/javascripts/codemirror/addons/mode/multiplex.js +12 -0
  40. data/vendor/assets/javascripts/codemirror/addons/mode/overlay.js +15 -10
  41. data/vendor/assets/javascripts/codemirror/addons/runmode/colorize.js +11 -3
  42. data/vendor/assets/javascripts/codemirror/addons/runmode/runmode-standalone.js +0 -2
  43. data/vendor/assets/javascripts/codemirror/addons/runmode/runmode.js +12 -0
  44. data/vendor/assets/javascripts/codemirror/addons/runmode/runmode.node.js +4 -0
  45. data/vendor/assets/javascripts/codemirror/addons/scroll/scrollpastend.js +9 -2
  46. data/vendor/assets/javascripts/codemirror/addons/search/match-highlighter.js +12 -3
  47. data/vendor/assets/javascripts/codemirror/addons/search/search.js +24 -16
  48. data/vendor/assets/javascripts/codemirror/addons/search/searchcursor.js +21 -2
  49. data/vendor/assets/javascripts/codemirror/addons/selection/active-line.js +38 -17
  50. data/vendor/assets/javascripts/codemirror/addons/selection/mark-selection.js +16 -9
  51. data/vendor/assets/javascripts/codemirror/addons/tern/tern.js +33 -5
  52. data/vendor/assets/javascripts/codemirror/addons/wrap/hardwrap.js +27 -2
  53. data/vendor/assets/javascripts/codemirror/keymaps/emacs.js +12 -5
  54. data/vendor/assets/javascripts/codemirror/keymaps/sublime.js +505 -0
  55. data/vendor/assets/javascripts/codemirror/keymaps/vim.js +138 -179
  56. data/vendor/assets/javascripts/codemirror/modes/apl.js +12 -0
  57. data/vendor/assets/javascripts/codemirror/modes/asterisk.js +12 -0
  58. data/vendor/assets/javascripts/codemirror/modes/clike.js +15 -4
  59. data/vendor/assets/javascripts/codemirror/modes/clojure.js +13 -0
  60. data/vendor/assets/javascripts/codemirror/modes/cobol.js +12 -0
  61. data/vendor/assets/javascripts/codemirror/modes/coffeescript.js +12 -0
  62. data/vendor/assets/javascripts/codemirror/modes/commonlisp.js +12 -0
  63. data/vendor/assets/javascripts/codemirror/modes/css.js +18 -27
  64. data/vendor/assets/javascripts/codemirror/modes/d.js +12 -2
  65. data/vendor/assets/javascripts/codemirror/modes/diff.js +12 -0
  66. data/vendor/assets/javascripts/codemirror/modes/dtd.js +12 -0
  67. data/vendor/assets/javascripts/codemirror/modes/ecl.js +12 -0
  68. data/vendor/assets/javascripts/codemirror/modes/eiffel.js +12 -0
  69. data/vendor/assets/javascripts/codemirror/modes/erlang.js +13 -1
  70. data/vendor/assets/javascripts/codemirror/modes/fortran.js +12 -0
  71. data/vendor/assets/javascripts/codemirror/modes/gas.js +12 -0
  72. data/vendor/assets/javascripts/codemirror/modes/gfm.js +12 -0
  73. data/vendor/assets/javascripts/codemirror/modes/gherkin.js +12 -0
  74. data/vendor/assets/javascripts/codemirror/modes/go.js +12 -1
  75. data/vendor/assets/javascripts/codemirror/modes/groovy.js +12 -0
  76. data/vendor/assets/javascripts/codemirror/modes/haml.js +12 -0
  77. data/vendor/assets/javascripts/codemirror/modes/haskell.js +12 -0
  78. data/vendor/assets/javascripts/codemirror/modes/haxe.js +18 -9
  79. data/vendor/assets/javascripts/codemirror/modes/htmlembedded.js +12 -0
  80. data/vendor/assets/javascripts/codemirror/modes/htmlmixed.js +12 -0
  81. data/vendor/assets/javascripts/codemirror/modes/http.js +12 -0
  82. data/vendor/assets/javascripts/codemirror/modes/jade.js +12 -0
  83. data/vendor/assets/javascripts/codemirror/modes/javascript.js +23 -16
  84. data/vendor/assets/javascripts/codemirror/modes/jinja2.js +53 -118
  85. data/vendor/assets/javascripts/codemirror/modes/julia.js +12 -0
  86. data/vendor/assets/javascripts/codemirror/modes/livescript.js +17 -4
  87. data/vendor/assets/javascripts/codemirror/modes/lua.js +12 -0
  88. data/vendor/assets/javascripts/codemirror/modes/markdown.js +12 -0
  89. data/vendor/assets/javascripts/codemirror/modes/mirc.js +13 -0
  90. data/vendor/assets/javascripts/codemirror/modes/mllike.js +12 -1
  91. data/vendor/assets/javascripts/codemirror/modes/nginx.js +12 -0
  92. data/vendor/assets/javascripts/codemirror/modes/ntriples.js +13 -0
  93. data/vendor/assets/javascripts/codemirror/modes/octave.js +12 -0
  94. data/vendor/assets/javascripts/codemirror/modes/pascal.js +12 -0
  95. data/vendor/assets/javascripts/codemirror/modes/pegjs.js +12 -0
  96. data/vendor/assets/javascripts/codemirror/modes/perl.js +84 -73
  97. data/vendor/assets/javascripts/codemirror/modes/php.js +20 -101
  98. data/vendor/assets/javascripts/codemirror/modes/pig.js +12 -0
  99. data/vendor/assets/javascripts/codemirror/modes/properties.js +12 -0
  100. data/vendor/assets/javascripts/codemirror/modes/puppet.js +13 -0
  101. data/vendor/assets/javascripts/codemirror/modes/python.js +21 -11
  102. data/vendor/assets/javascripts/codemirror/modes/q.js +12 -0
  103. data/vendor/assets/javascripts/codemirror/modes/r.js +13 -3
  104. data/vendor/assets/javascripts/codemirror/modes/{rpm-spec.js → rpm.js} +34 -2
  105. data/vendor/assets/javascripts/codemirror/modes/rst.js +12 -0
  106. data/vendor/assets/javascripts/codemirror/modes/ruby.js +11 -0
  107. data/vendor/assets/javascripts/codemirror/modes/rust.js +12 -0
  108. data/vendor/assets/javascripts/codemirror/modes/sass.js +12 -0
  109. data/vendor/assets/javascripts/codemirror/modes/scheme.js +13 -0
  110. data/vendor/assets/javascripts/codemirror/modes/shell.js +12 -0
  111. data/vendor/assets/javascripts/codemirror/modes/sieve.js +11 -4
  112. data/vendor/assets/javascripts/codemirror/modes/smalltalk.js +12 -0
  113. data/vendor/assets/javascripts/codemirror/modes/smarty.js +13 -0
  114. data/vendor/assets/javascripts/codemirror/modes/smartymixed.js +14 -2
  115. data/vendor/assets/javascripts/codemirror/modes/solr.js +12 -0
  116. data/vendor/assets/javascripts/codemirror/modes/sparql.js +12 -0
  117. data/vendor/assets/javascripts/codemirror/modes/sql.js +12 -0
  118. data/vendor/assets/javascripts/codemirror/modes/stex.js +12 -0
  119. data/vendor/assets/javascripts/codemirror/modes/tcl.js +13 -0
  120. data/vendor/assets/javascripts/codemirror/modes/tiddlywiki.js +13 -0
  121. data/vendor/assets/javascripts/codemirror/modes/tiki.js +12 -0
  122. data/vendor/assets/javascripts/codemirror/modes/toml.js +12 -0
  123. data/vendor/assets/javascripts/codemirror/modes/turtle.js +12 -0
  124. data/vendor/assets/javascripts/codemirror/modes/vb.js +12 -0
  125. data/vendor/assets/javascripts/codemirror/modes/vbscript.js +13 -0
  126. data/vendor/assets/javascripts/codemirror/modes/velocity.js +12 -0
  127. data/vendor/assets/javascripts/codemirror/modes/verilog.js +89 -236
  128. data/vendor/assets/javascripts/codemirror/modes/xml.js +41 -60
  129. data/vendor/assets/javascripts/codemirror/modes/xquery.js +12 -0
  130. data/vendor/assets/javascripts/codemirror/modes/yaml.js +12 -0
  131. data/vendor/assets/javascripts/codemirror/modes/z80.js +12 -0
  132. data/vendor/assets/stylesheets/codemirror.css +15 -10
  133. data/vendor/assets/stylesheets/codemirror/themes/ambiance.css +1 -0
  134. data/vendor/assets/stylesheets/codemirror/themes/lesser-dark.css +4 -0
  135. data/vendor/assets/stylesheets/codemirror/themes/mdn-like.css +1 -1
  136. data/vendor/assets/stylesheets/codemirror/themes/pastel-on-dark.css +1 -0
  137. data/vendor/assets/stylesheets/codemirror/themes/rubyblue.css +2 -0
  138. data/vendor/assets/stylesheets/codemirror/themes/solarized.css +17 -3
  139. metadata +20 -25
  140. data/vendor/assets/javascripts/codemirror/keymaps/extra.js +0 -43
  141. data/vendor/assets/javascripts/codemirror/modes/django.js +0 -55
  142. data/vendor/assets/javascripts/codemirror/modes/dylan.js +0 -284
  143. data/vendor/assets/javascripts/codemirror/modes/less.js +0 -347
  144. data/vendor/assets/javascripts/codemirror/modes/rpm-changes.js +0 -19
  145. data/vendor/assets/stylesheets/codemirror/modes/rpm-spec.css +0 -5
@@ -1,4 +1,13 @@
1
- (function() {
1
+ (function(mod) {
2
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
3
+ mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../clike/clike"));
4
+ else if (typeof define == "function" && define.amd) // AMD
5
+ define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../clike/clike"], mod);
6
+ else // Plain browser env
7
+ mod(CodeMirror);
8
+ })(function(CodeMirror) {
9
+ "use strict";
10
+
2
11
  function keywords(str) {
3
12
  var obj = {}, words = str.split(" ");
4
13
  for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
@@ -11,88 +20,17 @@
11
20
  return "string";
12
21
  };
13
22
  }
14
-
15
- // Helper for stringWithEscapes
16
- function matchSequence(list) {
17
- if (list.length == 0) return stringWithEscapes;
18
- return function (stream, state) {
19
- var patterns = list[0];
20
- for (var i = 0; i < patterns.length; i++) if (stream.match(patterns[i][0])) {
21
- state.tokenize = matchSequence(list.slice(1));
22
- return patterns[i][1];
23
- }
24
- state.tokenize = stringWithEscapes;
25
- return "string";
26
- };
27
- }
28
- function stringWithEscapes(stream, state) {
29
- var escaped = false, next, end = false;
30
-
31
- if (stream.current() == '"') return "string";
32
-
33
- // "Complex" syntax
34
- if (stream.match("${", false) || stream.match("{$", false)) {
35
- state.tokenize = null;
36
- return "string";
37
- }
38
-
39
- // Simple syntax
40
- if (stream.match(/\$[a-zA-Z_][a-zA-Z0-9_]*/)) {
41
- // After the variable name there may appear array or object operator.
42
- if (stream.match("[", false)) {
43
- // Match array operator
44
- state.tokenize = matchSequence([
45
- [["[", null]],
46
- [[/\d[\w\.]*/, "number"],
47
- [/\$[a-zA-Z_][a-zA-Z0-9_]*/, "variable-2"],
48
- [/[\w\$]+/, "variable"]],
49
- [["]", null]]
50
- ]);
51
- }
52
- if (stream.match(/\-\>\w/, false)) {
53
- // Match object operator
54
- state.tokenize = matchSequence([
55
- [["->", null]],
56
- [[/[\w]+/, "variable"]]
57
- ]);
58
- }
59
- return "variable-2";
60
- }
61
-
62
- // Normal string
63
- while (
64
- !stream.eol() &&
65
- (!stream.match("{$", false)) &&
66
- (!stream.match(/(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/, false) || escaped)
67
- ) {
68
- next = stream.next();
69
- if (!escaped && next == '"') { end = true; break; }
70
- escaped = !escaped && next == "\\";
71
- }
72
- if (end) {
73
- state.tokenize = null;
74
- state.phpEncapsStack.pop();
75
- }
76
- return "string";
77
- }
78
-
79
- var phpKeywords = "abstract and array as break case catch class clone const continue declare default " +
80
- "do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final " +
81
- "for foreach function global goto if implements interface instanceof namespace " +
82
- "new or private protected public static switch throw trait try use var while xor " +
83
- "die echo empty exit eval include include_once isset list require require_once return " +
84
- "print unset __halt_compiler self static parent yield insteadof finally";
85
- var phpAtoms = "true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__";
86
- var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once";
87
- CodeMirror.registerHelper("hintWords", "php", [phpKeywords, phpAtoms, phpBuiltin].join(" ").split(" "));
88
-
89
23
  var phpConfig = {
90
24
  name: "clike",
91
- helperType: "php",
92
- keywords: keywords(phpKeywords),
25
+ keywords: keywords("abstract and array as break case catch class clone const continue declare default " +
26
+ "do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final " +
27
+ "for foreach function global goto if implements interface instanceof namespace " +
28
+ "new or private protected public static switch throw trait try use var while xor " +
29
+ "die echo empty exit eval include include_once isset list require require_once return " +
30
+ "print unset __halt_compiler self static parent yield insteadof finally"),
93
31
  blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"),
94
- atoms: keywords(phpAtoms),
95
- builtin: keywords(phpBuiltin),
32
+ atoms: keywords("true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__"),
33
+ builtin: keywords("func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once"),
96
34
  multiLineStrings: true,
97
35
  hooks: {
98
36
  "$": function(stream) {
@@ -117,24 +55,6 @@
117
55
  return "comment";
118
56
  }
119
57
  return false;
120
- },
121
- '"': function(stream, state) {
122
- if (!state.phpEncapsStack)
123
- state.phpEncapsStack = [];
124
- state.phpEncapsStack.push(0);
125
- state.tokenize = stringWithEscapes;
126
- return state.tokenize(stream, state);
127
- },
128
- "{": function(_stream, state) {
129
- if (state.phpEncapsStack && state.phpEncapsStack.length > 0)
130
- state.phpEncapsStack[state.phpEncapsStack.length - 1]++;
131
- return false;
132
- },
133
- "}": function(_stream, state) {
134
- if (state.phpEncapsStack && state.phpEncapsStack.length > 0)
135
- if (--state.phpEncapsStack[state.phpEncapsStack.length - 1] == 0)
136
- state.tokenize = stringWithEscapes;
137
- return false;
138
58
  }
139
59
  }
140
60
  };
@@ -174,8 +94,7 @@
174
94
  state.curState = state.html;
175
95
  return "meta";
176
96
  } else {
177
- var result = phpMode.token(stream, state.curState);
178
- return (stream.pos <= stream.start) ? phpMode.token(stream, state.curState) : result;
97
+ return phpMode.token(stream, state.curState);
179
98
  }
180
99
  }
181
100
 
@@ -218,4 +137,4 @@
218
137
  CodeMirror.defineMIME("application/x-httpd-php", "php");
219
138
  CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true});
220
139
  CodeMirror.defineMIME("text/x-php", phpConfig);
221
- })();
140
+ });
@@ -4,6 +4,16 @@
4
4
  * @link https://github.com/prasanthj/pig-codemirror-2
5
5
  * This implementation is adapted from PL/SQL mode in CodeMirror 2.
6
6
  */
7
+ (function(mod) {
8
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
9
+ mod(require("../../lib/codemirror"));
10
+ else if (typeof define == "function" && define.amd) // AMD
11
+ define(["../../lib/codemirror"], mod);
12
+ else // Plain browser env
13
+ mod(CodeMirror);
14
+ })(function(CodeMirror) {
15
+ "use strict";
16
+
7
17
  CodeMirror.defineMode("pig", function(_config, parserConfig) {
8
18
  var keywords = parserConfig.keywords,
9
19
  builtins = parserConfig.builtins,
@@ -171,3 +181,5 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
171
181
 
172
182
  CodeMirror.registerHelper("hintWords", "pig", (pBuiltins + pTypes + pKeywords).split(" "));
173
183
  }());
184
+
185
+ });
@@ -1,3 +1,13 @@
1
+ (function(mod) {
2
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
3
+ mod(require("../../lib/codemirror"));
4
+ else if (typeof define == "function" && define.amd) // AMD
5
+ define(["../../lib/codemirror"], mod);
6
+ else // Plain browser env
7
+ mod(CodeMirror);
8
+ })(function(CodeMirror) {
9
+ "use strict";
10
+
1
11
  CodeMirror.defineMode("properties", function() {
2
12
  return {
3
13
  token: function(stream, state) {
@@ -61,3 +71,5 @@ CodeMirror.defineMode("properties", function() {
61
71
 
62
72
  CodeMirror.defineMIME("text/x-properties", "properties");
63
73
  CodeMirror.defineMIME("text/x-ini", "properties");
74
+
75
+ });
@@ -1,3 +1,13 @@
1
+ (function(mod) {
2
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
3
+ mod(require("../../lib/codemirror"));
4
+ else if (typeof define == "function" && define.amd) // AMD
5
+ define(["../../lib/codemirror"], mod);
6
+ else // Plain browser env
7
+ mod(CodeMirror);
8
+ })(function(CodeMirror) {
9
+ "use strict";
10
+
1
11
  CodeMirror.defineMode("puppet", function () {
2
12
  // Stores the words from the define method
3
13
  var words = {};
@@ -201,4 +211,7 @@ CodeMirror.defineMode("puppet", function () {
201
211
  }
202
212
  };
203
213
  });
214
+
204
215
  CodeMirror.defineMIME("text/x-puppet", "puppet");
216
+
217
+ });
@@ -1,3 +1,14 @@
1
+ (function(mod) {
2
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
3
+ mod(require("../../lib/codemirror"));
4
+ else if (typeof define == "function" && define.amd) // AMD
5
+ define(["../../lib/codemirror"], mod);
6
+ else // Plain browser env
7
+ mod(CodeMirror);
8
+ })(function(CodeMirror) {
9
+ "use strict";
10
+
11
+
1
12
  CodeMirror.defineMode("python", function(conf, parserConf) {
2
13
  var ERRORCLASS = 'error';
3
14
 
@@ -365,14 +376,13 @@ CodeMirror.defineMode("python", function(conf, parserConf) {
365
376
 
366
377
  CodeMirror.defineMIME("text/x-python", "python");
367
378
 
368
- (function() {
369
- "use strict";
370
- var words = function(str){return str.split(' ');};
371
-
372
- CodeMirror.defineMIME("text/x-cython", {
373
- name: "python",
374
- extra_keywords: words("by cdef cimport cpdef ctypedef enum except"+
375
- "extern gil include nogil property public"+
376
- "readonly struct union DEF IF ELIF ELSE")
377
- });
378
- })();
379
+ var words = function(str){return str.split(' ');};
380
+
381
+ CodeMirror.defineMIME("text/x-cython", {
382
+ name: "python",
383
+ extra_keywords: words("by cdef cimport cpdef ctypedef enum except"+
384
+ "extern gil include nogil property public"+
385
+ "readonly struct union DEF IF ELIF ELSE")
386
+ });
387
+
388
+ });
@@ -1,3 +1,13 @@
1
+ (function(mod) {
2
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
3
+ mod(require("../../lib/codemirror"));
4
+ else if (typeof define == "function" && define.amd) // AMD
5
+ define(["../../lib/codemirror"], mod);
6
+ else // Plain browser env
7
+ mod(CodeMirror);
8
+ })(function(CodeMirror) {
9
+ "use strict";
10
+
1
11
  CodeMirror.defineMode("q",function(config){
2
12
  var indentUnit=config.indentUnit,
3
13
  curPunc,
@@ -122,3 +132,5 @@ CodeMirror.defineMode("q",function(config){
122
132
  };
123
133
  });
124
134
  CodeMirror.defineMIME("text/x-q","q");
135
+
136
+ });
@@ -1,3 +1,13 @@
1
+ (function(mod) {
2
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
3
+ mod(require("../../lib/codemirror"));
4
+ else if (typeof define == "function" && define.amd) // AMD
5
+ define(["../../lib/codemirror"], mod);
6
+ else // Plain browser env
7
+ mod(CodeMirror);
8
+ })(function(CodeMirror) {
9
+ "use strict";
10
+
1
11
  CodeMirror.defineMode("r", function(config) {
2
12
  function wordObj(str) {
3
13
  var words = str.split(" "), res = {};
@@ -138,10 +148,10 @@ CodeMirror.defineMode("r", function(config) {
138
148
  if (ctx.type == "block") return ctx.indent + (firstChar == "{" ? 0 : config.indentUnit);
139
149
  else if (ctx.align) return ctx.column + (closing ? 0 : 1);
140
150
  else return ctx.indent + (closing ? 0 : config.indentUnit);
141
- },
142
-
143
- lineComment: "#"
151
+ }
144
152
  };
145
153
  });
146
154
 
147
155
  CodeMirror.defineMIME("text/x-rsrc", "r");
156
+
157
+ });
@@ -1,6 +1,36 @@
1
+ (function(mod) {
2
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
3
+ mod(require("../../lib/codemirror"));
4
+ else if (typeof define == "function" && define.amd) // AMD
5
+ define(["../../lib/codemirror"], mod);
6
+ else // Plain browser env
7
+ mod(CodeMirror);
8
+ })(function(CodeMirror) {
9
+ "use strict";
10
+
11
+ CodeMirror.defineMode("rpm-changes", function() {
12
+ var headerSeperator = /^-+$/;
13
+ var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /;
14
+ var simpleEmail = /^[\w+.-]+@[\w.-]+/;
15
+
16
+ return {
17
+ token: function(stream) {
18
+ if (stream.sol()) {
19
+ if (stream.match(headerSeperator)) { return 'tag'; }
20
+ if (stream.match(headerLine)) { return 'tag'; }
21
+ }
22
+ if (stream.match(simpleEmail)) { return 'string'; }
23
+ stream.next();
24
+ return null;
25
+ }
26
+ };
27
+ });
28
+
29
+ CodeMirror.defineMIME("text/x-rpm-changes", "rpm-changes");
30
+
1
31
  // Quick and dirty spec file highlighting
2
32
 
3
- CodeMirror.defineMode("spec", function() {
33
+ CodeMirror.defineMode("rpm-spec", function() {
4
34
  var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/;
5
35
 
6
36
  var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/;
@@ -63,4 +93,6 @@ CodeMirror.defineMode("spec", function() {
63
93
  };
64
94
  });
65
95
 
66
- CodeMirror.defineMIME("text/x-rpm-spec", "spec");
96
+ CodeMirror.defineMIME("text/x-rpm-spec", "rpm-spec");
97
+
98
+ });
@@ -1,3 +1,13 @@
1
+ (function(mod) {
2
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
3
+ mod(require("../../lib/codemirror"), require("../python/python"), require("../stex/stex"), require("../../addon/mode/overlay"));
4
+ else if (typeof define == "function" && define.amd) // AMD
5
+ define(["../../lib/codemirror", "../python/python", "../stex/stex", "../../addon/mode/overlay"], mod);
6
+ else // Plain browser env
7
+ mod(CodeMirror);
8
+ })(function(CodeMirror) {
9
+ "use strict";
10
+
1
11
  CodeMirror.defineMode('rst', function (config, options) {
2
12
 
3
13
  var rx_strong = /^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/;
@@ -561,3 +571,5 @@ CodeMirror.defineMIME('text/x-rst', 'rst');
561
571
 
562
572
  ///////////////////////////////////////////////////////////////////////////////
563
573
  ///////////////////////////////////////////////////////////////////////////////
574
+
575
+ });
@@ -1,3 +1,13 @@
1
+ (function(mod) {
2
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
3
+ mod(require("../../lib/codemirror"));
4
+ else if (typeof define == "function" && define.amd) // AMD
5
+ define(["../../lib/codemirror"], mod);
6
+ else // Plain browser env
7
+ mod(CodeMirror);
8
+ })(function(CodeMirror) {
9
+ "use strict";
10
+
1
11
  CodeMirror.defineMode("ruby", function(config) {
2
12
  function wordObj(words) {
3
13
  var o = {};
@@ -248,3 +258,4 @@ CodeMirror.defineMode("ruby", function(config) {
248
258
 
249
259
  CodeMirror.defineMIME("text/x-ruby", "ruby");
250
260
 
261
+ });
@@ -1,3 +1,13 @@
1
+ (function(mod) {
2
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
3
+ mod(require("../../lib/codemirror"));
4
+ else if (typeof define == "function" && define.amd) // AMD
5
+ define(["../../lib/codemirror"], mod);
6
+ else // Plain browser env
7
+ mod(CodeMirror);
8
+ })(function(CodeMirror) {
9
+ "use strict";
10
+
1
11
  CodeMirror.defineMode("rust", function() {
2
12
  var indentUnit = 4, altIndentUnit = 2;
3
13
  var valKeywords = {
@@ -434,3 +444,5 @@ CodeMirror.defineMode("rust", function() {
434
444
  });
435
445
 
436
446
  CodeMirror.defineMIME("text/x-rustsrc", "rust");
447
+
448
+ });
@@ -1,3 +1,13 @@
1
+ (function(mod) {
2
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
3
+ mod(require("../../lib/codemirror"));
4
+ else if (typeof define == "function" && define.amd) // AMD
5
+ define(["../../lib/codemirror"], mod);
6
+ else // Plain browser env
7
+ mod(CodeMirror);
8
+ })(function(CodeMirror) {
9
+ "use strict";
10
+
1
11
  CodeMirror.defineMode("sass", function(config) {
2
12
  var tokenRegexp = function(words){
3
13
  return new RegExp("^" + words.join("|"));
@@ -328,3 +338,5 @@ CodeMirror.defineMode("sass", function(config) {
328
338
  });
329
339
 
330
340
  CodeMirror.defineMIME("text/x-sass", "sass");
341
+
342
+ });
@@ -1,6 +1,17 @@
1
1
  /**
2
2
  * Author: Koh Zi Han, based on implementation by Koh Zi Chun
3
3
  */
4
+
5
+ (function(mod) {
6
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
7
+ mod(require("../../lib/codemirror"));
8
+ else if (typeof define == "function" && define.amd) // AMD
9
+ define(["../../lib/codemirror"], mod);
10
+ else // Plain browser env
11
+ mod(CodeMirror);
12
+ })(function(CodeMirror) {
13
+ "use strict";
14
+
4
15
  CodeMirror.defineMode("scheme", function () {
5
16
  var BUILTIN = "builtin", COMMENT = "comment", STRING = "string",
6
17
  ATOM = "atom", NUMBER = "number", BRACKET = "bracket";
@@ -230,3 +241,5 @@ CodeMirror.defineMode("scheme", function () {
230
241
  });
231
242
 
232
243
  CodeMirror.defineMIME("text/x-scheme", "scheme");
244
+
245
+ });