[TASK] Update codemirror to recent version 0.9.4
authorTobias Liebig <tobias.liebig@typo3.org>
Mon, 10 Oct 2011 12:45:50 +0000 (14:45 +0200)
committerXavier Perseguers <xavier@typo3.org>
Mon, 10 Oct 2011 14:02:16 +0000 (16:02 +0200)
TYPO3 4.5 already uses the codemirror library 0.9.4. It has not yet been updated for 4.6.

Change-Id: I5ada44a795d47465025fb8e7c6de1ff61f5249d9
Resolves: #28854
Releases: 4.6
Reviewed-on: http://review.typo3.org/5670
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
13 files changed:
typo3/contrib/codemirror/VERSION_0.93 [deleted file]
typo3/contrib/codemirror/VERSION_0.94 [new file with mode: 0644]
typo3/contrib/codemirror/contrib/csharp/index.html
typo3/contrib/codemirror/contrib/csharp/js/parsecsharp.js
typo3/contrib/codemirror/contrib/ometa/index.html
typo3/contrib/codemirror/contrib/php/js/parsephp.js
typo3/contrib/codemirror/contrib/php/js/tokenizephp.js
typo3/contrib/codemirror/contrib/plsql/index.html
typo3/contrib/codemirror/contrib/python/js/parsepython.js
typo3/contrib/codemirror/contrib/scheme/index.html
typo3/contrib/codemirror/contrib/sql/css/sqlcolors.css
typo3/contrib/codemirror/contrib/sql/index.html
typo3/contrib/codemirror/contrib/sql/js/parsesql.js

diff --git a/typo3/contrib/codemirror/VERSION_0.93 b/typo3/contrib/codemirror/VERSION_0.93
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/typo3/contrib/codemirror/VERSION_0.94 b/typo3/contrib/codemirror/VERSION_0.94
new file mode 100644 (file)
index 0000000..e69de29
index e846f02..3b128f3 100644 (file)
@@ -11,7 +11,7 @@
 <p>Written by <a href="http://skilltesting.com/">Boris Gaber and Christopher Buchino</a> (<a
 href="http://skilltesting.com/codemirror-parser-license/">license</a>).</p>
 
-<div style="border-top: 1px solid black; border-bottom: 1px solid black;">
+<div class="border">
 <textarea id="code" cols="120" rows="50">
 using System;
 
index 2145711..10dcb41 100644 (file)
@@ -283,7 +283,6 @@ var JSParser = Editor.Parser = (function() {
     // For loops.
     function forspec1(type){
       if (type == "var") cont(vardef1, forspec2);
-      else if (type == "keyword d") cont(vardef1, forspec2);
       else if (type == ";") pass(forspec2);
       else if (type == "variable") cont(formaybein);
       else pass(forspec2);
index bd25d6a..7bf59fd 100644 (file)
@@ -12,7 +12,7 @@
 <p>Adapted from the official Javascript parser by Eric KEDJI
   &lt;<a href="mailto:eric.kedji@gmail.com">eric.kedji@gmail.com</a>&gt;.</p>
 
-<div style="border-top: 1px solid black; border-bottom: 1px solid black;">
+<div class="border">
 <textarea id="code" cols="120" rows="30">
 // Source: http://www.tinlizzie.org/ometa-js/#Lisp
 // Inspired by McCarthy's meta-circular lisp
index 7d0ad1f..9823195 100644 (file)
@@ -221,8 +221,7 @@ var PHPParser = Editor.Parser = (function() {
     }
     // Pop off the current lexical context.
     function poplex(){
-      if (lexical.prev)
-        lexical = lexical.prev;
+      lexical = lexical.prev;
     }
     poplex.lex = true;
     // The 'lex' flag on these actions is used by the 'next' function
@@ -253,8 +252,9 @@ var PHPParser = Editor.Parser = (function() {
         else
           ok = wanted.indexOf(type);
         if (ok >= 0) {
-          if (execute && typeof(execute[ok]) == "function") pass(execute[ok]);
-          else cont();
+          if (execute && typeof(execute[ok]) == "function")
+            execute[ok](token);
+            cont();  // just consume the token
         }
         else {
           if (!marked) mark(token.style);
@@ -272,7 +272,7 @@ var PHPParser = Editor.Parser = (function() {
     function statement(token){
       var type = token.type;
       if (type == "keyword a") cont(pushlex("form"), expression, altsyntax, statement, poplex);
-      else if (type == "keyword b") cont(pushlex("form"), altsyntax, statement, poplex);
+      else if (type == "keyword b") cont(pushlex("form"), statement, poplex);
       else if (type == "{") cont(pushlex("}"), block, poplex);
       else if (type == "function") funcdef();
       // technically, "class implode {...}" is correct, but we'll flag that as an error because it overrides a predefined function
@@ -280,8 +280,7 @@ var PHPParser = Editor.Parser = (function() {
       else if (type == "foreach") cont(pushlex("form"), require("("), pushlex(")"), expression, require("as"), require("variable"), /* => $value */ expect(")"), altsyntax, poplex, statement, poplex);
       else if (type == "for") cont(pushlex("form"), require("("), pushlex(")"), expression, require(";"), expression, require(";"), expression, require(")"), altsyntax, poplex, statement, poplex);
       // public final function foo(), protected static $bar;
-      else if (type == "modifier") cont(require(["modifier", "variable", "function", "abstract"],
-                                                [null, commasep(require("variable")), funcdef, absfun]));
+      else if (type == "modifier") cont(require(["modifier", "variable", "function", "abstract"], [null, null, funcdef, absfun]));
       else if (type == "abstract") abs();
       else if (type == "switch") cont(pushlex("form"), require("("), expression, require(")"), pushlex("}", "switch"), require([":", "{"]), block, poplex, poplex);
       else if (type == "case") cont(expression, require(":"));
index 62962c2..8b14458 100644 (file)
@@ -463,127 +463,7 @@ var tokenizePHP = (function() {
       "xdebug_get_collected_errors", "xdebug_start_code_coverage",
       "xdebug_stop_code_coverage", "xdebug_get_code_coverage",
       "xdebug_get_function_count", "xdebug_dump_superglobals",
-      "_", /* alias for gettext()*/ 
-      "get_called_class","class_alias","gc_collect_cycles","gc_enabled","gc_enable",
-      "gc_disable","date_create_from_format","date_parse_from_format",
-      "date_get_last_errors","date_add","date_sub","date_diff","date_timestamp_set",
-      "date_timestamp_get","timezone_location_get","timezone_version_get",
-      "date_interval_create_from_date_string","date_interval_format",
-      "libxml_disable_entity_loader","openssl_pkey_free","openssl_pkey_new",
-      "openssl_pkey_export","openssl_pkey_export_to_file","openssl_pkey_get_private",
-      "openssl_pkey_get_public","openssl_pkey_get_details","openssl_free_key",
-      "openssl_get_privatekey","openssl_get_publickey","openssl_x509_read",
-      "openssl_x509_free","openssl_x509_parse","openssl_x509_checkpurpose",
-      "openssl_x509_check_private_key","openssl_x509_export","openssl_x509_export_to_file",
-      "openssl_pkcs12_export","openssl_pkcs12_export_to_file","openssl_pkcs12_read",
-      "openssl_csr_new","openssl_csr_export","openssl_csr_export_to_file",
-      "openssl_csr_sign","openssl_csr_get_subject","openssl_csr_get_public_key",
-      "openssl_digest","openssl_encrypt","openssl_decrypt","openssl_cipher_iv_length",
-      "openssl_sign","openssl_verify","openssl_seal","openssl_open","openssl_pkcs7_verify",
-      "openssl_pkcs7_decrypt","openssl_pkcs7_sign","openssl_pkcs7_encrypt",
-      "openssl_private_encrypt","openssl_private_decrypt","openssl_public_encrypt",
-      "openssl_public_decrypt","openssl_get_md_methods","openssl_get_cipher_methods",
-      "openssl_dh_compute_key","openssl_random_pseudo_bytes","openssl_error_string",
-      "preg_filter","bzopen","bzread","bzwrite","bzflush","bzclose","bzerrno",
-      "bzerrstr","bzerror","bzcompress","bzdecompress","curl_init","curl_copy_handle",
-      "curl_version","curl_setopt","curl_setopt_array","curl_exec","curl_getinfo",
-      "curl_error","curl_errno","curl_close","curl_multi_init","curl_multi_add_handle",
-      "curl_multi_remove_handle","curl_multi_select","curl_multi_exec","curl_multi_getcontent",
-      "curl_multi_info_read","curl_multi_close","exif_read_data","read_exif_data",
-      "exif_tagname","exif_thumbnail","exif_imagetype","ftp_ssl_connect",
-      "imagecolorclosesthwb","imagecreatefromxpm","textdomain","gettext","dgettext",
-      "dcgettext","bindtextdomain","ngettext","dngettext","dcngettext",
-      "bind_textdomain_codeset","hash_copy","imap_open","imap_reopen","imap_close",
-      "imap_num_msg","imap_num_recent","imap_headers","imap_headerinfo",
-      "imap_rfc822_parse_headers","imap_rfc822_write_address","imap_rfc822_parse_adrlist",
-      "imap_body","imap_bodystruct","imap_fetchbody","imap_savebody","imap_fetchheader",
-      "imap_fetchstructure","imap_gc","imap_expunge","imap_delete","imap_undelete",
-      "imap_check","imap_listscan","imap_mail_copy","imap_mail_move","imap_mail_compose",
-      "imap_createmailbox","imap_renamemailbox","imap_deletemailbox","imap_subscribe",
-      "imap_unsubscribe","imap_append","imap_ping","imap_base64","imap_qprint","imap_8bit",
-      "imap_binary","imap_utf8","imap_status","imap_mailboxmsginfo","imap_setflag_full",
-      "imap_clearflag_full","imap_sort","imap_uid","imap_msgno","imap_list","imap_lsub",
-      "imap_fetch_overview","imap_alerts","imap_errors","imap_last_error","imap_search",
-      "imap_utf7_decode","imap_utf7_encode","imap_mime_header_decode","imap_thread",
-      "imap_timeout","imap_get_quota","imap_get_quotaroot","imap_set_quota","imap_setacl",
-      "imap_getacl","imap_mail","imap_header","imap_listmailbox","imap_getmailboxes",
-      "imap_scanmailbox","imap_listsubscribed","imap_getsubscribed","imap_fetchtext",
-      "imap_scan","imap_create","imap_rename","json_last_error","mb_encoding_aliases",
-      "mcrypt_ecb","mcrypt_cbc","mcrypt_cfb","mcrypt_ofb","mcrypt_get_key_size",
-      "mcrypt_get_block_size","mcrypt_get_cipher_name","mcrypt_create_iv","mcrypt_list_algorithms",
-      "mcrypt_list_modes","mcrypt_get_iv_size","mcrypt_encrypt","mcrypt_decrypt",
-      "mcrypt_module_open","mcrypt_generic_init","mcrypt_generic","mdecrypt_generic",
-      "mcrypt_generic_end","mcrypt_generic_deinit","mcrypt_enc_self_test",
-      "mcrypt_enc_is_block_algorithm_mode","mcrypt_enc_is_block_algorithm",
-      "mcrypt_enc_is_block_mode","mcrypt_enc_get_block_size","mcrypt_enc_get_key_size",
-      "mcrypt_enc_get_supported_key_sizes","mcrypt_enc_get_iv_size",
-      "mcrypt_enc_get_algorithms_name","mcrypt_enc_get_modes_name","mcrypt_module_self_test",
-      "mcrypt_module_is_block_algorithm_mode","mcrypt_module_is_block_algorithm",
-      "mcrypt_module_is_block_mode","mcrypt_module_get_algo_block_size",
-      "mcrypt_module_get_algo_key_size","mcrypt_module_get_supported_key_sizes",
-      "mcrypt_module_close","mysqli_refresh","posix_kill","posix_getpid","posix_getppid",
-      "posix_getuid","posix_setuid","posix_geteuid","posix_seteuid","posix_getgid",
-      "posix_setgid","posix_getegid","posix_setegid","posix_getgroups","posix_getlogin",
-      "posix_getpgrp","posix_setsid","posix_setpgid","posix_getpgid","posix_getsid",
-      "posix_uname","posix_times","posix_ctermid","posix_ttyname","posix_isatty",
-      "posix_getcwd","posix_mkfifo","posix_mknod","posix_access","posix_getgrnam",
-      "posix_getgrgid","posix_getpwnam","posix_getpwuid","posix_getrlimit",
-      "posix_get_last_error","posix_errno","posix_strerror","posix_initgroups",
-      "pspell_new","pspell_new_personal","pspell_new_config","pspell_check",
-      "pspell_suggest","pspell_store_replacement","pspell_add_to_personal",
-      "pspell_add_to_session","pspell_clear_session","pspell_save_wordlist",
-      "pspell_config_create","pspell_config_runtogether","pspell_config_mode",
-      "pspell_config_ignore","pspell_config_personal","pspell_config_dict_dir",
-      "pspell_config_data_dir","pspell_config_repl","pspell_config_save_repl",
-      "snmpget","snmpgetnext","snmpwalk","snmprealwalk","snmpwalkoid",
-      "snmp_get_quick_print","snmp_set_quick_print","snmp_set_enum_print",
-      "snmp_set_oid_output_format","snmp_set_oid_numeric_print","snmpset",
-      "snmp2_get","snmp2_getnext","snmp2_walk","snmp2_real_walk","snmp2_set",
-      "snmp3_get","snmp3_getnext","snmp3_walk","snmp3_real_walk","snmp3_set",
-      "snmp_set_valueretrieval","snmp_get_valueretrieval","snmp_read_mib",
-      "use_soap_error_handler","is_soap_fault","socket_create_pair","time_nanosleep",
-      "time_sleep_until","strptime","php_ini_loaded_file","money_format","lcfirst",
-      "nl_langinfo","str_getcsv","readlink","linkinfo","symlink","link","proc_nice",
-      "atanh","asinh","acosh","expm1","log1p","inet_ntop","inet_pton","getopt",
-      "sys_getloadavg","getrusage","quoted_printable_encode","forward_static_call",
-      "forward_static_call_array","header_remove","parse_ini_string","gethostname",
-      "dns_check_record","checkdnsrr","dns_get_mx","getmxrr","dns_get_record",
-      "stream_context_get_params","stream_context_set_default","stream_socket_pair",
-      "stream_supports_lock","stream_set_read_buffer","stream_resolve_include_path",
-      "stream_is_local","fnmatch","chroot","lchown","lchgrp","realpath_cache_size",
-      "realpath_cache_get","array_replace","array_replace_recursive","ftok","xmlrpc_encode",
-      "xmlrpc_decode","xmlrpc_decode_request","xmlrpc_encode_request","xmlrpc_get_type",
-      "xmlrpc_set_type","xmlrpc_is_fault","xmlrpc_server_create","xmlrpc_server_destroy",
-      "xmlrpc_server_register_method","xmlrpc_server_call_method",
-      "xmlrpc_parse_method_descriptions","xmlrpc_server_add_introspection_data",
-      "xmlrpc_server_register_introspection_callback","zip_open","zip_close",
-      "zip_read","zip_entry_open","zip_entry_close","zip_entry_read","zip_entry_filesize",
-      "zip_entry_name","zip_entry_compressedsize","zip_entry_compressionmethod",
-      "svn_checkout","svn_cat","svn_ls","svn_log","svn_auth_set_parameter",
-      "svn_auth_get_parameter","svn_client_version","svn_config_ensure","svn_diff",
-      "svn_cleanup","svn_revert","svn_resolved","svn_commit","svn_lock","svn_unlock",
-      "svn_add","svn_status","svn_update","svn_import","svn_info","svn_export",
-      "svn_copy","svn_switch","svn_blame","svn_delete","svn_mkdir","svn_move",
-      "svn_proplist","svn_propget","svn_repos_create","svn_repos_recover",
-      "svn_repos_hotcopy","svn_repos_open","svn_repos_fs",
-      "svn_repos_fs_begin_txn_for_commit","svn_repos_fs_commit_txn",
-      "svn_fs_revision_root","svn_fs_check_path","svn_fs_revision_prop",
-      "svn_fs_dir_entries","svn_fs_node_created_rev","svn_fs_youngest_rev",
-      "svn_fs_file_contents","svn_fs_file_length","svn_fs_txn_root","svn_fs_make_file",
-      "svn_fs_make_dir","svn_fs_apply_text","svn_fs_copy","svn_fs_delete",
-      "svn_fs_begin_txn2","svn_fs_is_dir","svn_fs_is_file","svn_fs_node_prop",
-      "svn_fs_change_node_prop","svn_fs_contents_changed","svn_fs_props_changed",
-      "svn_fs_abort_txn","sqlite_open","sqlite_popen","sqlite_close","sqlite_query",
-      "sqlite_exec","sqlite_array_query","sqlite_single_query","sqlite_fetch_array",
-      "sqlite_fetch_object","sqlite_fetch_single","sqlite_fetch_string",
-      "sqlite_fetch_all","sqlite_current","sqlite_column","sqlite_libversion",
-      "sqlite_libencoding","sqlite_changes","sqlite_last_insert_rowid",
-      "sqlite_num_rows","sqlite_num_fields","sqlite_field_name","sqlite_seek",
-      "sqlite_rewind","sqlite_next","sqlite_prev","sqlite_valid","sqlite_has_more",
-      "sqlite_has_prev","sqlite_escape_string","sqlite_busy_timeout","sqlite_last_error",
-      "sqlite_error_string","sqlite_unbuffered_query","sqlite_create_aggregate",
-      "sqlite_create_function","sqlite_factory","sqlite_udf_encode_binary",
-      "sqlite_udf_decode_binary","sqlite_fetch_column_types"
+      "_" // alias for gettext()
     ].forEach(function(element, index, array) {
       result[element] = token("t_string", "php-predefined-function");
     });
@@ -840,85 +720,10 @@ var tokenizePHP = (function() {
       "EACCELERATOR_SHM_AND_DISK", "EACCELERATOR_SHM", "EACCELERATOR_SHM_ONLY",
       "EACCELERATOR_DISK_ONLY", "EACCELERATOR_NONE", "XDEBUG_TRACE_APPEND",
       "XDEBUG_TRACE_COMPUTERIZED", "XDEBUG_TRACE_HTML", "XDEBUG_CC_UNUSED",
-      "XDEBUG_CC_DEAD_CODE", "STDIN", "STDOUT", "STDERR", "DNS_HINFO", 
-      "DNS_PTR", "SQLITE_EMPTY", "SVN_SHOW_UPDATES", "SVN_NO_IGNORE", "MSG_EOF",
-      "DNS_MX", "GD_EXTRA_VERSION", "PHP_VERSION_ID", "SQLITE_OK", 
-      "LIBXML_LOADED_VERSION", "RADIXCHAR", "OPENSSL_VERSION_TEXT",  "OPENSSL_VERSION_NUMBER",
-      "PCRE_VERSION", "CURLOPT_FILE", "CURLOPT_INFILE", "CURLOPT_URL", "CURLOPT_PROXY",
-      "CURLE_FUNCTION_NOT_FOUND", "SOCKET_ENOMSG", "CURLOPT_HTTPHEADER", "SOCKET_EIDRM",
-      "CURLOPT_PROGRESSFUNCTION", "SOCKET_ECHRNG", "SOCKET_EL2NSYNC", "SOCKET_EL3HLT",
-      "SOCKET_EL3RST", "SOCKET_ELNRNG", "SOCKET_ENOCSI", "SOCKET_EL2HLT", "SOCKET_EBADE",
-      "SOCKET_EXFULL", "CURLOPT_USERPWD",  "CURLOPT_PROXYUSERPWD", "CURLOPT_RANGE",
-      "CURLOPT_TIMEOUT_MS",  "CURLOPT_POSTFIELDS",  "CURLOPT_REFERER", "CURLOPT_USERAGENT",
-      "CURLOPT_FTPPORT", "SOCKET_ERESTART", "SQLITE_CONSTRAINT", "SQLITE_MISMATCH",
-      "SQLITE_MISUSE", "CURLOPT_COOKIE", "CURLE_SSL_CERTPROBLEM", "CURLOPT_SSLCERT",
-      "CURLOPT_KEYPASSWD", "CURLOPT_WRITEHEADER", "CURLOPT_SSL_VERIFYHOST",
-      "CURLOPT_COOKIEFILE", "CURLE_HTTP_RANGE_ERROR", "CURLE_HTTP_POST_ERROR",
-      "CURLOPT_CUSTOMREQUEST", "CURLOPT_STDERR", "SOCKET_EBADR", "CURLOPT_RETURNTRANSFER",
-      "CURLOPT_QUOTE", "CURLOPT_POSTQUOTE", "CURLOPT_INTERFACE", "CURLOPT_KRB4LEVEL",
-      "SOCKET_ENODATA", "SOCKET_ESRMNT",  "CURLOPT_WRITEFUNCTION", "CURLOPT_READFUNCTION",
-      "CURLOPT_HEADERFUNCTION", "SOCKET_EADV", "SOCKET_EPROTO", "SOCKET_EMULTIHOP",
-      "SOCKET_EBADMSG",  "CURLOPT_FORBID_REUSE", "CURLOPT_RANDOM_FILE", "CURLOPT_EGDSOCKET",
-      "SOCKET_EREMCHG", "CURLOPT_CONNECTTIMEOUT_MS", "CURLOPT_CAINFO", "CURLOPT_CAPATH",
-      "CURLOPT_COOKIEJAR", "CURLOPT_SSL_CIPHER_LIST", "CURLOPT_BINARYTRANSFER",
-      "SQLITE_DONE", "CURLOPT_HTTP_VERSION", "CURLOPT_SSLKEY", "CURLOPT_SSLKEYTYPE",
-      "CURLOPT_SSLENGINE", "CURLOPT_SSLCERTTYPE", "CURLE_OUT_OF_MEMORY", "CURLOPT_ENCODING",
-      "CURLE_SSL_CIPHER", "SOCKET_EREMOTEIO", "CURLOPT_HTTP200ALIASES", "CURLAUTH_ANY",
-      "CURLAUTH_ANYSAFE", "CURLOPT_PRIVATE", "CURLINFO_EFFECTIVE_URL", "CURLINFO_HTTP_CODE",
-      "CURLINFO_HEADER_SIZE", "CURLINFO_REQUEST_SIZE", "CURLINFO_TOTAL_TIME",
-      "CURLINFO_NAMELOOKUP_TIME", "CURLINFO_CONNECT_TIME", "CURLINFO_PRETRANSFER_TIME",
-      "CURLINFO_SIZE_UPLOAD", "CURLINFO_SIZE_DOWNLOAD", "CURLINFO_SPEED_DOWNLOAD",
-      "CURLINFO_SPEED_UPLOAD", "CURLINFO_FILETIME", "CURLINFO_SSL_VERIFYRESULT",
-      "CURLINFO_CONTENT_LENGTH_DOWNLOAD", "CURLINFO_CONTENT_LENGTH_UPLOAD",
-      "CURLINFO_STARTTRANSFER_TIME", "CURLINFO_CONTENT_TYPE", "CURLINFO_REDIRECT_TIME",
-      "CURLINFO_REDIRECT_COUNT", "CURLINFO_PRIVATE", "CURLINFO_CERTINFO",
-      "SQLITE_PROTOCOL", "SQLITE_SCHEMA", "SQLITE_TOOBIG", "SQLITE_NOLFS", 
-      "SQLITE_AUTH", "SQLITE_FORMAT", "SOCKET_ENOTTY", "SQLITE_NOTADB",
-      "SOCKET_ENOSPC", "SOCKET_ESPIPE", "SOCKET_EROFS", "SOCKET_EMLINK", "GD_RELEASE_VERSION",
-      "SOCKET_ENOLCK", "SOCKET_ENOSYS", "SOCKET_EUNATCH", "SOCKET_ENOANO", "SOCKET_EBADRQC",
-      "SOCKET_EBADSLT", "SOCKET_ENOSTR", "SOCKET_ETIME", "SOCKET_ENOSR", "SVN_REVISION_HEAD",
-      "XSD_ENTITY", "XSD_NOTATION", "CURLOPT_CERTINFO", "CURLOPT_POSTREDIR", "CURLOPT_SSH_AUTH_TYPES",
-      "CURLOPT_SSH_PUBLIC_KEYFILE", "CURLOPT_SSH_PRIVATE_KEYFILE", "CURLOPT_SSH_HOST_PUBLIC_KEY_MD5",
-      "CURLE_SSH", "CURLOPT_REDIR_PROTOCOLS", "CURLOPT_PROTOCOLS", "XSD_NONNEGATIVEINTEGER",
-      "XSD_BYTE","DNS_SRV","DNS_A6", "DNS_NAPTR", "DNS_AAAA", "FILTER_SANITIZE_FULL_SPECIAL_CHARS",
-      "ABDAY_1", "SVN_REVISION_UNSPECIFIED", "SVN_REVISION_BASE", "SVN_REVISION_COMMITTED",
-      "SVN_REVISION_PREV", "GD_VERSION", "MCRYPT_TRIPLEDES", "MCRYPT_ARCFOUR_IV", "MCRYPT_ARCFOUR",
-      "MCRYPT_BLOWFISH", "MCRYPT_BLOWFISH_COMPAT", "MCRYPT_CAST_128", "MCRYPT_CAST_256",
-      "MCRYPT_ENIGNA", "MCRYPT_DES", "MCRYPT_GOST", "MCRYPT_LOKI97", "MCRYPT_PANAMA",
-      "MCRYPT_RC2", "MCRYPT_RIJNDAEL_128", "MCRYPT_RIJNDAEL_192", "MCRYPT_RIJNDAEL_256",
-      "MCRYPT_SAFER64", "MCRYPT_SAFER128","MCRYPT_SAFERPLUS", "MCRYPT_SERPENT", "MCRYPT_THREEWAY",
-      "MCRYPT_TWOFISH", "MCRYPT_WAKE", "MCRYPT_XTEA", "MCRYPT_IDEA", "MCRYPT_MARS",
-      "MCRYPT_RC6", "MCRYPT_SKIPJACK", "MCRYPT_MODE_CBC", "MCRYPT_MODE_CFB", "MCRYPT_MODE_ECB",
-      "MCRYPT_MODE_NOFB", "MCRYPT_MODE_OFB", "MCRYPT_MODE_STREAM", "CL_EXPUNGE",
-      "SQLITE_ROW", "POSIX_S_IFBLK", "POSIX_S_IFSOCK",  "XSD_IDREF", "ABDAY_2",
-      "ABDAY_3", "ABDAY_4", "ABDAY_5", "ABDAY_6", "ABDAY_7", "DAY_1", "DAY_2",
-      "DAY_3", "DAY_4", "DAY_5", "DAY_6", "DAY_7", "ABMON_1", "ABMON_2", "ABMON_3",
-      "ABMON_4", "ABMON_5", "ABMON_6", "ABMON_7","ABMON_8", "ABMON_9", "ABMON_10",
-      "ABMON_11",  "ABMON_12", "MON_1", "MON_2", "MON_3", "MON_4", "MON_5",  "MON_6",
-      "MON_7",  "MON_8", "MON_9", "MON_10", "MON_11", "MON_12", "AM_STR", "PM_STR",
-      "D_T_FMT",  "D_FMT", "T_FMT", "T_FMT_AMPM", "ERA", "ERA_D_T_FMT", "ERA_D_FMT",
-      "ERA_T_FMT", "ALT_DIGITS", "CRNCYSTR", "THOUSEP",  "YESEXPR", "NOEXPR",
-      "SOCKET_ENOMEDIUM", "GLOB_AVAILABLE_FLAGS", "XSD_SHORT", "XSD_NMTOKENS",
-      "LOG_LOCAL3", "LOG_LOCAL4", "LOG_LOCAL5", "LOG_LOCAL6", "LOG_LOCAL7",
-      "DNS_ANY", "DNS_ALL", "SOCKET_ENOLINK",  "SOCKET_ECOMM", "SOAP_FUNCTIONS_ALL",
-      "UNKNOWN_TYPE", "XSD_BASE64BINARY", "XSD_ANYURI", "XSD_QNAME", "SOCKET_EISNAM",
-      "SOCKET_EMEDIUMTYPE", "XSD_NCNAME", "XSD_ID", "XSD_ENTITIES", "XSD_INTEGER",
-      "XSD_NONPOSITIVEINTEGER", "XSD_NEGATIVEINTEGER", "XSD_LONG", "XSD_INT",
-      "XSD_UNSIGNEDLONG", "XSD_UNSIGNEDINT", "XSD_UNSIGNEDSHORT", "XSD_UNSIGNEDBYTE",
-      "XSD_POSITIVEINTEGER", "XSD_ANYTYPE", "XSD_ANYXML", "APACHE_MAP", "XSD_1999_TIMEINSTANT",
-      "XSD_NAMESPACE", "XSD_1999_NAMESPACE", "SOCKET_ENOTUNIQ", "SOCKET_EBADFD",
-      "SOCKET_ESTRPIPE", "T_GOTO", "T_NAMESPACE", "T_NS_C", "T_DIR", "T_NS_SEPARATOR",
-      "LIBXSLT_VERSION","LIBEXSLT_DOTTED_VERSION", "LIBEXSLT_VERSION",  "SVN_AUTH_PARAM_DEFAULT_USERNAME",
-      "SVN_AUTH_PARAM_DEFAULT_PASSWORD", "SVN_AUTH_PARAM_NON_INTERACTIVE",
-      "SVN_AUTH_PARAM_DONT_STORE_PASSWORDS", "SVN_AUTH_PARAM_NO_AUTH_CACHE",
-      "SVN_AUTH_PARAM_SSL_SERVER_FAILURES", "SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO",
-      "SVN_AUTH_PARAM_CONFIG", "SVN_AUTH_PARAM_SERVER_GROUP",
-      "SVN_AUTH_PARAM_CONFIG_DIR", "PHP_SVN_AUTH_PARAM_IGNORE_SSL_VERIFY_ERRORS",
-      "SVN_FS_CONFIG_FS_TYPE", "SVN_FS_TYPE_BDB", "SVN_FS_TYPE_FSFS", "SVN_PROP_REVISION_DATE",
-      "SVN_PROP_REVISION_ORIG_DATE", "SVN_PROP_REVISION_AUTHOR", "SVN_PROP_REVISION_LOG"
-      ].forEach(function(element, index, array) {
-         result[element] = token("atom", "php-predefined-constant");
-      });
+      "XDEBUG_CC_DEAD_CODE", "STDIN", "STDOUT", "STDERR"
+    ].forEach(function(element, index, array) {
+      result[element] = token("atom", "php-predefined-constant");
+    });
 
     // PHP declared classes - output of get_declared_classes(). Differs from http://php.net/manual/en/reserved.classes.php
     [  "stdClass", "Exception", "ErrorException", "COMPersistHelper", "com_exception",
@@ -949,13 +754,7 @@ var tokenizePHP = (function() {
       "UnderflowException", "UnexpectedValueException", "SplObjectStorage",
       "XMLReader", "XMLWriter", "mysqli_sql_exception", "mysqli_driver", "mysqli",
       "mysqli_warning", "mysqli_result", "mysqli_stmt", "PDOException", "PDO",
-      "PDOStatement", "PDORow","Closure", "DateInterval", "DatePeriod", "FilesystemIterator",
-      "GlobIterator", "MultipleIterator", "RecursiveTreeIterator", "SoapClient",
-      "SoapFault", "SoapHeader", "SoapParam", "SoapServer", "SoapVar", "SplDoublyLinkedList",
-      "SplFixedArray", "SplHeap", "SplMaxHeap", "SplMinHeap", "SplPriorityQueue",
-      "SplQueue", "SplStack", "SQLite3", "SQLite3Result", "SQLite3Stmt", "SQLiteDatabase",
-      "SQLiteException", "SQLiteResult", "SQLiteUnbuffered", "Svn", "SvnNode", "SvnWc",
-      "SvnWcSchedule", "XSLTProcessor", "ZipArchive"
+      "PDOStatement", "PDORow"
     ].forEach(function(element, index, array) {
       result[element] = token("t_string", "php-predefined-class");
     });
@@ -965,7 +764,7 @@ var tokenizePHP = (function() {
   }();
 
   // Helper regexps
-  var isOperatorChar = /[+*&%\/=<>!?.|^@-]/;
+  var isOperatorChar = /[+*&%\/=<>!?.|-]/;
   var isHexDigit = /[0-9A-Fa-f]/;
   var isWordChar = /[\w\$_\\]/;
 
@@ -1169,7 +968,7 @@ var tokenizePHP = (function() {
     else if (ch == ":" && source.equals(":")) {
       source.next();
       // the T_DOUBLE_COLON can only follow a T_STRING (class name)
-      return {type: "t_double_colon", style: "php-operator"};
+      return {type: "t_double_colon", style: "php-operator"}
     }
     // with punctuation, the type of the token is the symbol itself
     else if (/[\[\]{}\(\),;:]/.test(ch)) {
index 4c3548a..28919e8 100644 (file)
@@ -12,7 +12,7 @@ highlighter.</p>
 <p>Written by Peter Raganitsch (<a href="LICENSE">license</a>), based
 on John Benediktsson <a href="../sql/index.html">SQL parser</a>.</p>
 
-<div style="border-top: 1px solid black; border-bottom: 1px solid black;">
+<div class="border">
 <textarea id="code" cols="120" rows="50">
 PROCEDURE generateResult
   ( pRoutineType   IN VARCHAR2
index 787703d..0bd6d5c 100644 (file)
@@ -292,6 +292,7 @@ var PythonParser = Editor.Parser = (function() {
                             break;
                         }
                         ch = source.next();
+                        ch = source.next();
                     }
                     if (ch == terminator.charAt(0)) {
                         matches.push(terminator);
index e488376..ae00974 100644 (file)
@@ -15,7 +15,6 @@
         font-size: 10pt;
         font-family: monospace;
         padding-top: .4em;
-        line-height: normal;
       }
     </style>
   </head>
@@ -24,7 +23,7 @@
 <p>This page demonstrates <a href="index.html">CodeMirror</a>'s
 Scheme parser. (<a href="LICENSE">license</a>)</p>
 
-<div style="border-top: 1px solid black; border-bottom: 1px solid black;">
+<div class="border">
 <textarea id="code" cols="120" rows="30">
 (define (factorial x)
   (cond
index 9584252..d9a6add 100644 (file)
@@ -38,10 +38,6 @@ span.sql-word {
   color: black;
 }
 
-span.sql-quoted-word {
-  color: #680;
-}
-
 span.sql-function {
   color: darkorange;
 }
@@ -57,3 +53,5 @@ span.sql-separator {
 span.sql-number {
   color: darkcyan;
 }
+
+
index 3cea8ed..20f4f42 100644 (file)
@@ -11,7 +11,7 @@ highlighter.</p>
 
 <p>Written by John Benediktsson (<a href="LICENSE">license</a>).</p>
 
-<div style="border-top: 1px solid black; border-bottom: 1px solid black;">
+<div class="border">
 <textarea id="code" cols="120" rows="50">
 create table if not exists table1(
   a  bigint(13) not null primary key,
index 9b05d60..9e381e0 100644 (file)
@@ -38,9 +38,7 @@ var SqlParser = Editor.Parser = (function() {
     "or", "in", "not", "xor", "like", "using", "on", "order", "group", "by",
     "asc", "desc", "limit", "offset", "union", "all", "as", "distinct", "set",
     "commit", "rollback", "replace", "view", "database", "separator", "if",
-    "exists", "null", "truncate", "status", "show", "lock", "unique", "having",
-    "drop", "procedure", "begin", "end", "delimiter", "call", "else", "leave", 
-    "declare", "temporary", "then"
+    "exists", "null", "truncate", "status", "show", "lock", "unique", "having"
   ]);
 
   var types = wordRegexp([
@@ -58,8 +56,6 @@ var SqlParser = Editor.Parser = (function() {
 
   var operatorChars = /[*+\-<>=&|:\/]/;
 
-  var CFG = {};
-
   var tokenizeSql = (function() {
     function normal(source, setState) {
       var ch = source.next();
@@ -78,10 +74,6 @@ var SqlParser = Editor.Parser = (function() {
       else if (ch == "," || ch == ";") {
         return "sql-separator"
       }
-      else if (ch == '#') {
-        while (!source.endOfLine()) source.next();
-        return "sql-comment";
-      }
       else if (ch == '-') {
         if (source.peek() == "-") {
           while (!source.endOfLine()) source.next();
@@ -99,16 +91,8 @@ var SqlParser = Editor.Parser = (function() {
           return "sql-operator";
       }
       else if (operatorChars.test(ch)) {
-
-        if(ch == "/" && source.peek() == "*"){
-          setState(inBlock("sql-comment", "*/"));
-          return null;
-        }
-        else{
-          source.nextWhileMatches(operatorChars);
-          return "sql-operator";
-        }
-        
+        source.nextWhileMatches(operatorChars);
+        return "sql-operator";
       }
       else if (/\d/.test(ch)) {
         source.nextWhileMatches(/\d/);
@@ -160,24 +144,9 @@ var SqlParser = Editor.Parser = (function() {
             setState(normal);
             break;
           }
-          escaped = CFG.extension == 'T-SQL' ?
-                                  !escaped && quote == ch && source.equals(quote) :
-                                  !escaped && ch == "\\";
-        }        
-        return quote == "`" ? "sql-quoted-word" : "sql-literal";
-      };
-    }
-
-    function inBlock(style, terminator) {
-      return function(source, setState) {
-        while (!source.endOfLine()) {
-          if (source.lookAhead(terminator, true)) {
-            setState(normal);
-            break;
-          }
-          source.next();
+          escaped = !escaped && ch == "\\";
         }
-        return style;
+        return quote == "`" ? "sql-word" : "sql-literal";
       };
     }
 
@@ -255,13 +224,5 @@ var SqlParser = Editor.Parser = (function() {
     return iter;
   }
 
-  function configure (parserConfig) {
-    for (var p in parserConfig) {
-      if (parserConfig.hasOwnProperty(p)) {
-        CFG[p] = parserConfig[p];
-      }
-    }
-  }
-
-  return {make: parseSql, electricChars: ")", configure: configure};
+  return {make: parseSql, electricChars: ")"};
 })();