plsql.js
4.9 KB
CodeMirror.defineMode("plsql",function(e,t){function r(e,t,r){return t.tokenize=r,r(e,t)}function n(e,t){return s=e,t}function a(e,t){var a=e.next();return'"'==a||"'"==a?r(e,t,o(a)):/[\[\]{}\(\),;\.]/.test(a)?n(a):/\d/.test(a)?(e.eatWhile(/[\w\.]/),n("number","number")):"/"==a?e.eat("*")?r(e,t,i):(e.eatWhile(m),n("operator","operator")):"-"==a?e.eat("-")?(e.skipToEnd(),n("comment","comment")):(e.eatWhile(m),n("operator","operator")):"@"==a||"$"==a?(e.eatWhile(/[\w\d\$_]/),n("word","variable")):m.test(a)?(e.eatWhile(m),n("operator","operator")):(e.eatWhile(/[\w\$_]/),l&&l.propertyIsEnumerable(e.current().toLowerCase())?n("keyword","keyword"):c&&c.propertyIsEnumerable(e.current().toLowerCase())?n("keyword","builtin"):u&&u.propertyIsEnumerable(e.current().toLowerCase())?n("keyword","variable-2"):p&&p.propertyIsEnumerable(e.current().toLowerCase())?n("keyword","variable-3"):n("word","plsql-word"))}function o(e){return function(t,r){for(var o,i=!1,s=!1;null!=(o=t.next());){if(o==e&&!i){s=!0;break}i=!i&&"\\"==o}return(s||!i&&!d)&&(r.tokenize=a),n("string","plsql-string")}}function i(e,t){for(var r,o=!1;r=e.next();){if("/"==r&&o){t.tokenize=a;break}o="*"==r}return n("comment","plsql-comment")}var s,l=(e.indentUnit,t.keywords),c=t.functions,u=t.types,p=t.sqlplus,d=t.multiLineStrings,m=/[+\-*&%=<>!?:\/|]/;return{startState:function(e){return{tokenize:a,startOfLine:!0}},token:function(e,t){if(e.eatSpace())return null;var r=t.tokenize(e,t);return r}}}),function(){function e(e){for(var t={},r=e.split(" "),n=0;n<r.length;++n)t[r[n]]=!0;return t}var t="abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work",r="abs acos add_months ascii asin atan atan2 average bfilename ceil chartorowid chr concat convert cos cosh count decode deref dual dump dup_val_on_index empty error exp false floor found glb greatest hextoraw initcap instr instrb isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mod months_between new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null nvl others power rawtohex reftohex round rowcount rowidtochar rpad rtrim sign sin sinh soundex sqlcode sqlerrm sqrt stddev substr substrb sum sysdate tan tanh to_char to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid upper user userenv variance vsize",n="bfile blob character clob dec float int integer mlslabel natural naturaln nchar nclob number numeric nvarchar2 real rowtype signtype smallint string varchar varchar2",a="appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap";CodeMirror.defineMIME("text/x-plsql",{name:"plsql",keywords:e(t),functions:e(r),types:e(n),sqlplus:e(a)})}();