mode-pgsql.js 78 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507
  1. ace.define("ace/mode/doc_comment_highlight_rules",[], function(require, exports, module) {
  2. "use strict";
  3. var oop = require("../lib/oop");
  4. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  5. var DocCommentHighlightRules = function() {
  6. this.$rules = {
  7. "start" : [ {
  8. token : "comment.doc.tag",
  9. regex : "@[\\w\\d_]+" // TODO: fix email addresses
  10. },
  11. DocCommentHighlightRules.getTagRule(),
  12. {
  13. defaultToken : "comment.doc",
  14. caseInsensitive: true
  15. }]
  16. };
  17. };
  18. oop.inherits(DocCommentHighlightRules, TextHighlightRules);
  19. DocCommentHighlightRules.getTagRule = function(start) {
  20. return {
  21. token : "comment.doc.tag.storage.type",
  22. regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
  23. };
  24. };
  25. DocCommentHighlightRules.getStartRule = function(start) {
  26. return {
  27. token : "comment.doc", // doc comment
  28. regex : "\\/\\*(?=\\*)",
  29. next : start
  30. };
  31. };
  32. DocCommentHighlightRules.getEndRule = function (start) {
  33. return {
  34. token : "comment.doc", // closing comment
  35. regex : "\\*\\/",
  36. next : start
  37. };
  38. };
  39. exports.DocCommentHighlightRules = DocCommentHighlightRules;
  40. });
  41. ace.define("ace/mode/perl_highlight_rules",[], function(require, exports, module) {
  42. "use strict";
  43. var oop = require("../lib/oop");
  44. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  45. var PerlHighlightRules = function() {
  46. var keywords = (
  47. "base|constant|continue|else|elsif|for|foreach|format|goto|if|last|local|my|next|" +
  48. "no|package|parent|redo|require|scalar|sub|unless|until|while|use|vars"
  49. );
  50. var buildinConstants = ("ARGV|ENV|INC|SIG");
  51. var builtinFunctions = (
  52. "getprotobynumber|getprotobyname|getservbyname|gethostbyaddr|" +
  53. "gethostbyname|getservbyport|getnetbyaddr|getnetbyname|getsockname|" +
  54. "getpeername|setpriority|getprotoent|setprotoent|getpriority|" +
  55. "endprotoent|getservent|setservent|endservent|sethostent|socketpair|" +
  56. "getsockopt|gethostent|endhostent|setsockopt|setnetent|quotemeta|" +
  57. "localtime|prototype|getnetent|endnetent|rewinddir|wantarray|getpwuid|" +
  58. "closedir|getlogin|readlink|endgrent|getgrgid|getgrnam|shmwrite|" +
  59. "shutdown|readline|endpwent|setgrent|readpipe|formline|truncate|" +
  60. "dbmclose|syswrite|setpwent|getpwnam|getgrent|getpwent|ucfirst|sysread|" +
  61. "setpgrp|shmread|sysseek|sysopen|telldir|defined|opendir|connect|" +
  62. "lcfirst|getppid|binmode|syscall|sprintf|getpgrp|readdir|seekdir|" +
  63. "waitpid|reverse|unshift|symlink|dbmopen|semget|msgrcv|rename|listen|" +
  64. "chroot|msgsnd|shmctl|accept|unpack|exists|fileno|shmget|system|" +
  65. "unlink|printf|gmtime|msgctl|semctl|values|rindex|substr|splice|" +
  66. "length|msgget|select|socket|return|caller|delete|alarm|ioctl|index|" +
  67. "undef|lstat|times|srand|chown|fcntl|close|write|umask|rmdir|study|" +
  68. "sleep|chomp|untie|print|utime|mkdir|atan2|split|crypt|flock|chmod|" +
  69. "BEGIN|bless|chdir|semop|shift|reset|link|stat|chop|grep|fork|dump|" +
  70. "join|open|tell|pipe|exit|glob|warn|each|bind|sort|pack|eval|push|" +
  71. "keys|getc|kill|seek|sqrt|send|wait|rand|tied|read|time|exec|recv|" +
  72. "eof|chr|int|ord|exp|pos|pop|sin|log|abs|oct|hex|tie|cos|vec|END|ref|" +
  73. "map|die|uc|lc|do"
  74. );
  75. var keywordMapper = this.createKeywordMapper({
  76. "keyword": keywords,
  77. "constant.language": buildinConstants,
  78. "support.function": builtinFunctions
  79. }, "identifier");
  80. this.$rules = {
  81. "start" : [
  82. {
  83. token : "comment.doc",
  84. regex : "^=(?:begin|item)\\b",
  85. next : "block_comment"
  86. }, {
  87. token : "string.regexp",
  88. regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
  89. }, {
  90. token : "string", // single line
  91. regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
  92. }, {
  93. token : "string", // multi line string start
  94. regex : '["].*\\\\$',
  95. next : "qqstring"
  96. }, {
  97. token : "string", // single line
  98. regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
  99. }, {
  100. token : "string", // multi line string start
  101. regex : "['].*\\\\$",
  102. next : "qstring"
  103. }, {
  104. token : "constant.numeric", // hex
  105. regex : "0x[0-9a-fA-F]+\\b"
  106. }, {
  107. token : "constant.numeric", // float
  108. regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
  109. }, {
  110. token : keywordMapper,
  111. regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  112. }, {
  113. token : "keyword.operator",
  114. regex : "%#|\\$#|\\.\\.\\.|\\|\\|=|>>=|<<=|<=>|&&=|=>|!~|\\^=|&=|\\|=|\\.=|x=|%=|\\/=|\\*=|\\-=|\\+=|=~|\\*\\*|\\-\\-|\\.\\.|\\|\\||&&|\\+\\+|\\->|!=|==|>=|<=|>>|<<|,|=|\\?\\:|\\^|\\||x|%|\\/|\\*|<|&|\\\\|~|!|>|\\.|\\-|\\+|\\-C|\\-b|\\-S|\\-u|\\-t|\\-p|\\-l|\\-d|\\-f|\\-g|\\-s|\\-z|\\-k|\\-e|\\-O|\\-T|\\-B|\\-M|\\-A|\\-X|\\-W|\\-c|\\-R|\\-o|\\-x|\\-w|\\-r|\\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)"
  115. }, {
  116. token : "comment",
  117. regex : "#.*$"
  118. }, {
  119. token : "lparen",
  120. regex : "[[({]"
  121. }, {
  122. token : "rparen",
  123. regex : "[\\])}]"
  124. }, {
  125. token : "text",
  126. regex : "\\s+"
  127. }
  128. ],
  129. "qqstring" : [
  130. {
  131. token : "string",
  132. regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
  133. next : "start"
  134. }, {
  135. token : "string",
  136. regex : '.+'
  137. }
  138. ],
  139. "qstring" : [
  140. {
  141. token : "string",
  142. regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
  143. next : "start"
  144. }, {
  145. token : "string",
  146. regex : '.+'
  147. }
  148. ],
  149. "block_comment": [
  150. {
  151. token: "comment.doc",
  152. regex: "^=cut\\b",
  153. next: "start"
  154. },
  155. {
  156. defaultToken: "comment.doc"
  157. }
  158. ]
  159. };
  160. };
  161. oop.inherits(PerlHighlightRules, TextHighlightRules);
  162. exports.PerlHighlightRules = PerlHighlightRules;
  163. });
  164. ace.define("ace/mode/python_highlight_rules",[], function(require, exports, module) {
  165. "use strict";
  166. var oop = require("../lib/oop");
  167. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  168. var PythonHighlightRules = function() {
  169. var keywords = (
  170. "and|as|assert|break|class|continue|def|del|elif|else|except|exec|" +
  171. "finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|" +
  172. "raise|return|try|while|with|yield|async|await"
  173. );
  174. var builtinConstants = (
  175. "True|False|None|NotImplemented|Ellipsis|__debug__"
  176. );
  177. var builtinFunctions = (
  178. "abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" +
  179. "eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" +
  180. "binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|" +
  181. "float|list|raw_input|unichr|callable|format|locals|reduce|unicode|" +
  182. "chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|" +
  183. "cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|" +
  184. "__import__|complex|hash|min|set|apply|delattr|help|next|setattr|" +
  185. "buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern"
  186. );
  187. var keywordMapper = this.createKeywordMapper({
  188. "invalid.deprecated": "debugger",
  189. "support.function": builtinFunctions,
  190. "variable.language": "self|cls",
  191. "constant.language": builtinConstants,
  192. "keyword": keywords
  193. }, "identifier");
  194. var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?";
  195. var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
  196. var octInteger = "(?:0[oO]?[0-7]+)";
  197. var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
  198. var binInteger = "(?:0[bB][01]+)";
  199. var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")";
  200. var exponent = "(?:[eE][+-]?\\d+)";
  201. var fraction = "(?:\\.\\d+)";
  202. var intPart = "(?:\\d+)";
  203. var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
  204. var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")";
  205. var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
  206. var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})";
  207. this.$rules = {
  208. "start" : [ {
  209. token : "comment",
  210. regex : "#.*$"
  211. }, {
  212. token : "string", // multi line """ string start
  213. regex : strPre + '"{3}',
  214. next : "qqstring3"
  215. }, {
  216. token : "string", // " string
  217. regex : strPre + '"(?=.)',
  218. next : "qqstring"
  219. }, {
  220. token : "string", // multi line ''' string start
  221. regex : strPre + "'{3}",
  222. next : "qstring3"
  223. }, {
  224. token : "string", // ' string
  225. regex : strPre + "'(?=.)",
  226. next : "qstring"
  227. }, {
  228. token : "constant.numeric", // imaginary
  229. regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b"
  230. }, {
  231. token : "constant.numeric", // float
  232. regex : floatNumber
  233. }, {
  234. token : "constant.numeric", // long integer
  235. regex : integer + "[lL]\\b"
  236. }, {
  237. token : "constant.numeric", // integer
  238. regex : integer + "\\b"
  239. }, {
  240. token : keywordMapper,
  241. regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  242. }, {
  243. token : "keyword.operator",
  244. regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="
  245. }, {
  246. token : "paren.lparen",
  247. regex : "[\\[\\(\\{]"
  248. }, {
  249. token : "paren.rparen",
  250. regex : "[\\]\\)\\}]"
  251. }, {
  252. token : "text",
  253. regex : "\\s+"
  254. } ],
  255. "qqstring3" : [ {
  256. token : "constant.language.escape",
  257. regex : stringEscape
  258. }, {
  259. token : "string", // multi line """ string end
  260. regex : '"{3}',
  261. next : "start"
  262. }, {
  263. defaultToken : "string"
  264. } ],
  265. "qstring3" : [ {
  266. token : "constant.language.escape",
  267. regex : stringEscape
  268. }, {
  269. token : "string", // multi line ''' string end
  270. regex : "'{3}",
  271. next : "start"
  272. }, {
  273. defaultToken : "string"
  274. } ],
  275. "qqstring" : [{
  276. token : "constant.language.escape",
  277. regex : stringEscape
  278. }, {
  279. token : "string",
  280. regex : "\\\\$",
  281. next : "qqstring"
  282. }, {
  283. token : "string",
  284. regex : '"|$',
  285. next : "start"
  286. }, {
  287. defaultToken: "string"
  288. }],
  289. "qstring" : [{
  290. token : "constant.language.escape",
  291. regex : stringEscape
  292. }, {
  293. token : "string",
  294. regex : "\\\\$",
  295. next : "qstring"
  296. }, {
  297. token : "string",
  298. regex : "'|$",
  299. next : "start"
  300. }, {
  301. defaultToken: "string"
  302. }]
  303. };
  304. };
  305. oop.inherits(PythonHighlightRules, TextHighlightRules);
  306. exports.PythonHighlightRules = PythonHighlightRules;
  307. });
  308. ace.define("ace/mode/json_highlight_rules",[], function(require, exports, module) {
  309. "use strict";
  310. var oop = require("../lib/oop");
  311. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  312. var JsonHighlightRules = function() {
  313. this.$rules = {
  314. "start" : [
  315. {
  316. token : "variable", // single line
  317. regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'
  318. }, {
  319. token : "string", // single line
  320. regex : '"',
  321. next : "string"
  322. }, {
  323. token : "constant.numeric", // hex
  324. regex : "0[xX][0-9a-fA-F]+\\b"
  325. }, {
  326. token : "constant.numeric", // float
  327. regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
  328. }, {
  329. token : "constant.language.boolean",
  330. regex : "(?:true|false)\\b"
  331. }, {
  332. token : "text", // single quoted strings are not allowed
  333. regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
  334. }, {
  335. token : "comment", // comments are not allowed, but who cares?
  336. regex : "\\/\\/.*$"
  337. }, {
  338. token : "comment.start", // comments are not allowed, but who cares?
  339. regex : "\\/\\*",
  340. next : "comment"
  341. }, {
  342. token : "paren.lparen",
  343. regex : "[[({]"
  344. }, {
  345. token : "paren.rparen",
  346. regex : "[\\])}]"
  347. }, {
  348. token : "text",
  349. regex : "\\s+"
  350. }
  351. ],
  352. "string" : [
  353. {
  354. token : "constant.language.escape",
  355. regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/
  356. }, {
  357. token : "string",
  358. regex : '"|$',
  359. next : "start"
  360. }, {
  361. defaultToken : "string"
  362. }
  363. ],
  364. "comment" : [
  365. {
  366. token : "comment.end", // comments are not allowed, but who cares?
  367. regex : "\\*\\/",
  368. next : "start"
  369. }, {
  370. defaultToken: "comment"
  371. }
  372. ]
  373. };
  374. };
  375. oop.inherits(JsonHighlightRules, TextHighlightRules);
  376. exports.JsonHighlightRules = JsonHighlightRules;
  377. });
  378. ace.define("ace/mode/javascript_highlight_rules",[], function(require, exports, module) {
  379. "use strict";
  380. var oop = require("../lib/oop");
  381. var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
  382. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  383. var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
  384. var JavaScriptHighlightRules = function(options) {
  385. var keywordMapper = this.createKeywordMapper({
  386. "variable.language":
  387. "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
  388. "Namespace|QName|XML|XMLList|" + // E4X
  389. "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
  390. "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
  391. "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
  392. "SyntaxError|TypeError|URIError|" +
  393. "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
  394. "isNaN|parseFloat|parseInt|" +
  395. "JSON|Math|" + // Other
  396. "this|arguments|prototype|window|document" , // Pseudo
  397. "keyword":
  398. "const|yield|import|get|set|async|await|" +
  399. "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
  400. "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
  401. "__parent__|__count__|escape|unescape|with|__proto__|" +
  402. "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
  403. "storage.type":
  404. "const|let|var|function",
  405. "constant.language":
  406. "null|Infinity|NaN|undefined",
  407. "support.function":
  408. "alert",
  409. "constant.language.boolean": "true|false"
  410. }, "identifier");
  411. var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
  412. var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
  413. "u[0-9a-fA-F]{4}|" + // unicode
  414. "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
  415. "[0-2][0-7]{0,2}|" + // oct
  416. "3[0-7][0-7]?|" + // oct
  417. "[4-7][0-7]?|" + //oct
  418. ".)";
  419. this.$rules = {
  420. "no_regex" : [
  421. DocCommentHighlightRules.getStartRule("doc-start"),
  422. comments("no_regex"),
  423. {
  424. token : "string",
  425. regex : "'(?=.)",
  426. next : "qstring"
  427. }, {
  428. token : "string",
  429. regex : '"(?=.)',
  430. next : "qqstring"
  431. }, {
  432. token : "constant.numeric", // hexadecimal, octal and binary
  433. regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
  434. }, {
  435. token : "constant.numeric", // decimal integers and floats
  436. regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
  437. }, {
  438. token : [
  439. "storage.type", "punctuation.operator", "support.function",
  440. "punctuation.operator", "entity.name.function", "text","keyword.operator"
  441. ],
  442. regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
  443. next: "function_arguments"
  444. }, {
  445. token : [
  446. "storage.type", "punctuation.operator", "entity.name.function", "text",
  447. "keyword.operator", "text", "storage.type", "text", "paren.lparen"
  448. ],
  449. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  450. next: "function_arguments"
  451. }, {
  452. token : [
  453. "entity.name.function", "text", "keyword.operator", "text", "storage.type",
  454. "text", "paren.lparen"
  455. ],
  456. regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  457. next: "function_arguments"
  458. }, {
  459. token : [
  460. "storage.type", "punctuation.operator", "entity.name.function", "text",
  461. "keyword.operator", "text",
  462. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  463. ],
  464. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
  465. next: "function_arguments"
  466. }, {
  467. token : [
  468. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  469. ],
  470. regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
  471. next: "function_arguments"
  472. }, {
  473. token : [
  474. "entity.name.function", "text", "punctuation.operator",
  475. "text", "storage.type", "text", "paren.lparen"
  476. ],
  477. regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
  478. next: "function_arguments"
  479. }, {
  480. token : [
  481. "text", "text", "storage.type", "text", "paren.lparen"
  482. ],
  483. regex : "(:)(\\s*)(function)(\\s*)(\\()",
  484. next: "function_arguments"
  485. }, {
  486. token : "keyword",
  487. regex : "from(?=\\s*('|\"))"
  488. }, {
  489. token : "keyword",
  490. regex : "(?:" + kwBeforeRe + ")\\b",
  491. next : "start"
  492. }, {
  493. token : ["support.constant"],
  494. regex : /that\b/
  495. }, {
  496. token : ["storage.type", "punctuation.operator", "support.function.firebug"],
  497. regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
  498. }, {
  499. token : keywordMapper,
  500. regex : identifierRe
  501. }, {
  502. token : "punctuation.operator",
  503. regex : /[.](?![.])/,
  504. next : "property"
  505. }, {
  506. token : "storage.type",
  507. regex : /=>/
  508. }, {
  509. token : "keyword.operator",
  510. regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
  511. next : "start"
  512. }, {
  513. token : "punctuation.operator",
  514. regex : /[?:,;.]/,
  515. next : "start"
  516. }, {
  517. token : "paren.lparen",
  518. regex : /[\[({]/,
  519. next : "start"
  520. }, {
  521. token : "paren.rparen",
  522. regex : /[\])}]/
  523. }, {
  524. token: "comment",
  525. regex: /^#!.*$/
  526. }
  527. ],
  528. property: [{
  529. token : "text",
  530. regex : "\\s+"
  531. }, {
  532. token : [
  533. "storage.type", "punctuation.operator", "entity.name.function", "text",
  534. "keyword.operator", "text",
  535. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  536. ],
  537. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
  538. next: "function_arguments"
  539. }, {
  540. token : "punctuation.operator",
  541. regex : /[.](?![.])/
  542. }, {
  543. token : "support.function",
  544. regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
  545. }, {
  546. token : "support.function.dom",
  547. regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
  548. }, {
  549. token : "support.constant",
  550. regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
  551. }, {
  552. token : "identifier",
  553. regex : identifierRe
  554. }, {
  555. regex: "",
  556. token: "empty",
  557. next: "no_regex"
  558. }
  559. ],
  560. "start": [
  561. DocCommentHighlightRules.getStartRule("doc-start"),
  562. comments("start"),
  563. {
  564. token: "string.regexp",
  565. regex: "\\/",
  566. next: "regex"
  567. }, {
  568. token : "text",
  569. regex : "\\s+|^$",
  570. next : "start"
  571. }, {
  572. token: "empty",
  573. regex: "",
  574. next: "no_regex"
  575. }
  576. ],
  577. "regex": [
  578. {
  579. token: "regexp.keyword.operator",
  580. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  581. }, {
  582. token: "string.regexp",
  583. regex: "/[sxngimy]*",
  584. next: "no_regex"
  585. }, {
  586. token : "invalid",
  587. regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
  588. }, {
  589. token : "constant.language.escape",
  590. regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
  591. }, {
  592. token : "constant.language.delimiter",
  593. regex: /\|/
  594. }, {
  595. token: "constant.language.escape",
  596. regex: /\[\^?/,
  597. next: "regex_character_class"
  598. }, {
  599. token: "empty",
  600. regex: "$",
  601. next: "no_regex"
  602. }, {
  603. defaultToken: "string.regexp"
  604. }
  605. ],
  606. "regex_character_class": [
  607. {
  608. token: "regexp.charclass.keyword.operator",
  609. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  610. }, {
  611. token: "constant.language.escape",
  612. regex: "]",
  613. next: "regex"
  614. }, {
  615. token: "constant.language.escape",
  616. regex: "-"
  617. }, {
  618. token: "empty",
  619. regex: "$",
  620. next: "no_regex"
  621. }, {
  622. defaultToken: "string.regexp.charachterclass"
  623. }
  624. ],
  625. "function_arguments": [
  626. {
  627. token: "variable.parameter",
  628. regex: identifierRe
  629. }, {
  630. token: "punctuation.operator",
  631. regex: "[, ]+"
  632. }, {
  633. token: "punctuation.operator",
  634. regex: "$"
  635. }, {
  636. token: "empty",
  637. regex: "",
  638. next: "no_regex"
  639. }
  640. ],
  641. "qqstring" : [
  642. {
  643. token : "constant.language.escape",
  644. regex : escapedRe
  645. }, {
  646. token : "string",
  647. regex : "\\\\$",
  648. consumeLineEnd : true
  649. }, {
  650. token : "string",
  651. regex : '"|$',
  652. next : "no_regex"
  653. }, {
  654. defaultToken: "string"
  655. }
  656. ],
  657. "qstring" : [
  658. {
  659. token : "constant.language.escape",
  660. regex : escapedRe
  661. }, {
  662. token : "string",
  663. regex : "\\\\$",
  664. consumeLineEnd : true
  665. }, {
  666. token : "string",
  667. regex : "'|$",
  668. next : "no_regex"
  669. }, {
  670. defaultToken: "string"
  671. }
  672. ]
  673. };
  674. if (!options || !options.noES6) {
  675. this.$rules.no_regex.unshift({
  676. regex: "[{}]", onMatch: function(val, state, stack) {
  677. this.next = val == "{" ? this.nextState : "";
  678. if (val == "{" && stack.length) {
  679. stack.unshift("start", state);
  680. }
  681. else if (val == "}" && stack.length) {
  682. stack.shift();
  683. this.next = stack.shift();
  684. if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
  685. return "paren.quasi.end";
  686. }
  687. return val == "{" ? "paren.lparen" : "paren.rparen";
  688. },
  689. nextState: "start"
  690. }, {
  691. token : "string.quasi.start",
  692. regex : /`/,
  693. push : [{
  694. token : "constant.language.escape",
  695. regex : escapedRe
  696. }, {
  697. token : "paren.quasi.start",
  698. regex : /\${/,
  699. push : "start"
  700. }, {
  701. token : "string.quasi.end",
  702. regex : /`/,
  703. next : "pop"
  704. }, {
  705. defaultToken: "string.quasi"
  706. }]
  707. });
  708. if (!options || options.jsx != false)
  709. JSX.call(this);
  710. }
  711. this.embedRules(DocCommentHighlightRules, "doc-",
  712. [ DocCommentHighlightRules.getEndRule("no_regex") ]);
  713. this.normalizeRules();
  714. };
  715. oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
  716. function JSX() {
  717. var tagRegex = identifierRe.replace("\\d", "\\d\\-");
  718. var jsxTag = {
  719. onMatch : function(val, state, stack) {
  720. var offset = val.charAt(1) == "/" ? 2 : 1;
  721. if (offset == 1) {
  722. if (state != this.nextState)
  723. stack.unshift(this.next, this.nextState, 0);
  724. else
  725. stack.unshift(this.next);
  726. stack[2]++;
  727. } else if (offset == 2) {
  728. if (state == this.nextState) {
  729. stack[1]--;
  730. if (!stack[1] || stack[1] < 0) {
  731. stack.shift();
  732. stack.shift();
  733. }
  734. }
  735. }
  736. return [{
  737. type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
  738. value: val.slice(0, offset)
  739. }, {
  740. type: "meta.tag.tag-name.xml",
  741. value: val.substr(offset)
  742. }];
  743. },
  744. regex : "</?" + tagRegex + "",
  745. next: "jsxAttributes",
  746. nextState: "jsx"
  747. };
  748. this.$rules.start.unshift(jsxTag);
  749. var jsxJsRule = {
  750. regex: "{",
  751. token: "paren.quasi.start",
  752. push: "start"
  753. };
  754. this.$rules.jsx = [
  755. jsxJsRule,
  756. jsxTag,
  757. {include : "reference"},
  758. {defaultToken: "string"}
  759. ];
  760. this.$rules.jsxAttributes = [{
  761. token : "meta.tag.punctuation.tag-close.xml",
  762. regex : "/?>",
  763. onMatch : function(value, currentState, stack) {
  764. if (currentState == stack[0])
  765. stack.shift();
  766. if (value.length == 2) {
  767. if (stack[0] == this.nextState)
  768. stack[1]--;
  769. if (!stack[1] || stack[1] < 0) {
  770. stack.splice(0, 2);
  771. }
  772. }
  773. this.next = stack[0] || "start";
  774. return [{type: this.token, value: value}];
  775. },
  776. nextState: "jsx"
  777. },
  778. jsxJsRule,
  779. comments("jsxAttributes"),
  780. {
  781. token : "entity.other.attribute-name.xml",
  782. regex : tagRegex
  783. }, {
  784. token : "keyword.operator.attribute-equals.xml",
  785. regex : "="
  786. }, {
  787. token : "text.tag-whitespace.xml",
  788. regex : "\\s+"
  789. }, {
  790. token : "string.attribute-value.xml",
  791. regex : "'",
  792. stateName : "jsx_attr_q",
  793. push : [
  794. {token : "string.attribute-value.xml", regex: "'", next: "pop"},
  795. {include : "reference"},
  796. {defaultToken : "string.attribute-value.xml"}
  797. ]
  798. }, {
  799. token : "string.attribute-value.xml",
  800. regex : '"',
  801. stateName : "jsx_attr_qq",
  802. push : [
  803. {token : "string.attribute-value.xml", regex: '"', next: "pop"},
  804. {include : "reference"},
  805. {defaultToken : "string.attribute-value.xml"}
  806. ]
  807. },
  808. jsxTag
  809. ];
  810. this.$rules.reference = [{
  811. token : "constant.language.escape.reference.xml",
  812. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  813. }];
  814. }
  815. function comments(next) {
  816. return [
  817. {
  818. token : "comment", // multi line comment
  819. regex : /\/\*/,
  820. next: [
  821. DocCommentHighlightRules.getTagRule(),
  822. {token : "comment", regex : "\\*\\/", next : next || "pop"},
  823. {defaultToken : "comment", caseInsensitive: true}
  824. ]
  825. }, {
  826. token : "comment",
  827. regex : "\\/\\/",
  828. next: [
  829. DocCommentHighlightRules.getTagRule(),
  830. {token : "comment", regex : "$|^", next : next || "pop"},
  831. {defaultToken : "comment", caseInsensitive: true}
  832. ]
  833. }
  834. ];
  835. }
  836. exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
  837. });
  838. ace.define("ace/mode/pgsql_highlight_rules",[], function(require, exports, module) {
  839. var oop = require("../lib/oop");
  840. var lang = require("../lib/lang");
  841. var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
  842. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  843. var PerlHighlightRules = require("./perl_highlight_rules").PerlHighlightRules;
  844. var PythonHighlightRules = require("./python_highlight_rules").PythonHighlightRules;
  845. var JsonHighlightRules = require("./json_highlight_rules").JsonHighlightRules;
  846. var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
  847. var PgsqlHighlightRules = function() {
  848. var keywords = (
  849. "abort|absolute|abstime|access|aclitem|action|add|admin|after|aggregate|all|also|alter|always|" +
  850. "analyse|analyze|and|any|anyarray|anyelement|anyenum|anynonarray|anyrange|array|as|asc|" +
  851. "assertion|assignment|asymmetric|at|attribute|authorization|backward|before|begin|between|" +
  852. "bigint|binary|bit|bool|boolean|both|box|bpchar|by|bytea|cache|called|cascade|cascaded|case|cast|" +
  853. "catalog|chain|char|character|characteristics|check|checkpoint|cid|cidr|circle|class|close|" +
  854. "cluster|coalesce|collate|collation|column|comment|comments|commit|committed|concurrently|" +
  855. "configuration|connection|constraint|constraints|content|continue|conversion|copy|cost|" +
  856. "create|cross|cstring|csv|current|current_catalog|current_date|current_role|" +
  857. "current_schema|current_time|current_timestamp|current_user|cursor|cycle|data|database|" +
  858. "date|daterange|day|deallocate|dec|decimal|declare|default|defaults|deferrable|deferred|" +
  859. "definer|delete|delimiter|delimiters|desc|dictionary|disable|discard|distinct|do|document|" +
  860. "domain|double|drop|each|else|enable|encoding|encrypted|end|enum|escape|event|event_trigger|" +
  861. "except|exclude|excluding|exclusive|execute|exists|explain|extension|external|extract|false|" +
  862. "family|fdw_handler|fetch|first|float|float4|float8|following|for|force|foreign|forward|" +
  863. "freeze|from|full|function|functions|global|grant|granted|greatest|group|gtsvector|handler|" +
  864. "having|header|hold|hour|identity|if|ilike|immediate|immutable|implicit|in|including|" +
  865. "increment|index|indexes|inet|inherit|inherits|initially|inline|inner|inout|input|" +
  866. "insensitive|insert|instead|int|int2|int2vector|int4|int4range|int8|int8range|integer|" +
  867. "internal|intersect|interval|into|invoker|is|isnull|isolation|join|json|key|label|language|" +
  868. "language_handler|large|last|lateral|lc_collate|lc_ctype|leading|leakproof|least|left|level|" +
  869. "like|limit|line|listen|load|local|localtime|localtimestamp|location|lock|lseg|macaddr|" +
  870. "mapping|match|materialized|maxvalue|minute|minvalue|mode|money|month|move|name|names|" +
  871. "national|natural|nchar|next|no|none|not|nothing|notify|notnull|nowait|null|nullif|nulls|" +
  872. "numeric|numrange|object|of|off|offset|oid|oids|oidvector|on|only|opaque|operator|option|" +
  873. "options|or|order|out|outer|over|overlaps|overlay|owned|owner|parser|partial|partition|passing|" +
  874. "password|path|pg_attribute|pg_auth_members|pg_authid|pg_class|pg_database|pg_node_tree|" +
  875. "pg_proc|pg_type|placing|plans|point|polygon|position|preceding|precision|prepare|prepared|" +
  876. "preserve|primary|prior|privileges|procedural|procedure|program|quote|range|read|real|" +
  877. "reassign|recheck|record|recursive|ref|refcursor|references|refresh|regclass|regconfig|" +
  878. "regdictionary|regoper|regoperator|regproc|regprocedure|regtype|reindex|relative|release|" +
  879. "reltime|rename|repeatable|replace|replica|reset|restart|restrict|returning|returns|revoke|" +
  880. "right|role|rollback|row|rows|rule|savepoint|schema|scroll|search|second|security|select|" +
  881. "sequence|sequences|serializable|server|session|session_user|set|setof|share|show|similar|" +
  882. "simple|smallint|smgr|snapshot|some|stable|standalone|start|statement|statistics|stdin|" +
  883. "stdout|storage|strict|strip|substring|symmetric|sysid|system|table|tables|tablespace|temp|" +
  884. "template|temporary|text|then|tid|time|timestamp|timestamptz|timetz|tinterval|to|trailing|" +
  885. "transaction|treat|trigger|trim|true|truncate|trusted|tsquery|tsrange|tstzrange|tsvector|" +
  886. "txid_snapshot|type|types|unbounded|uncommitted|unencrypted|union|unique|unknown|unlisten|" +
  887. "unlogged|until|update|user|using|uuid|vacuum|valid|validate|validator|value|values|varbit|" +
  888. "varchar|variadic|varying|verbose|version|view|void|volatile|when|where|whitespace|window|" +
  889. "with|without|work|wrapper|write|xid|xml|xmlattributes|xmlconcat|xmlelement|xmlexists|" +
  890. "xmlforest|xmlparse|xmlpi|xmlroot|xmlserialize|year|yes|zone"
  891. );
  892. var builtinFunctions = (
  893. "RI_FKey_cascade_del|RI_FKey_cascade_upd|RI_FKey_check_ins|RI_FKey_check_upd|" +
  894. "RI_FKey_noaction_del|RI_FKey_noaction_upd|RI_FKey_restrict_del|RI_FKey_restrict_upd|" +
  895. "RI_FKey_setdefault_del|RI_FKey_setdefault_upd|RI_FKey_setnull_del|" +
  896. "RI_FKey_setnull_upd|abbrev|abs|abstime|abstimeeq|abstimege|abstimegt|abstimein|abstimele|" +
  897. "abstimelt|abstimene|abstimeout|abstimerecv|abstimesend|aclcontains|acldefault|" +
  898. "aclexplode|aclinsert|aclitemeq|aclitemin|aclitemout|aclremove|acos|age|any_in|any_out|" +
  899. "anyarray_in|anyarray_out|anyarray_recv|anyarray_send|anyelement_in|anyelement_out|" +
  900. "anyenum_in|anyenum_out|anynonarray_in|anynonarray_out|anyrange_in|anyrange_out|" +
  901. "anytextcat|area|areajoinsel|areasel|array_agg|array_agg_finalfn|array_agg_transfn|" +
  902. "array_append|array_cat|array_dims|array_eq|array_fill|array_ge|array_gt|array_in|" +
  903. "array_larger|array_le|array_length|array_lower|array_lt|array_ndims|array_ne|array_out|" +
  904. "array_prepend|array_recv|array_remove|array_replace|array_send|array_smaller|" +
  905. "array_to_json|array_to_string|array_typanalyze|array_upper|arraycontained|" +
  906. "arraycontains|arraycontjoinsel|arraycontsel|arrayoverlap|ascii|ascii_to_mic|" +
  907. "ascii_to_utf8|asin|atan|atan2|avg|big5_to_euc_tw|big5_to_mic|big5_to_utf8|bit_and|bit_in|" +
  908. "bit_length|bit_or|bit_out|bit_recv|bit_send|bitand|bitcat|bitcmp|biteq|bitge|bitgt|bitle|" +
  909. "bitlt|bitne|bitnot|bitor|bitshiftleft|bitshiftright|bittypmodin|bittypmodout|bitxor|bool|" +
  910. "bool_and|bool_or|booland_statefunc|booleq|boolge|boolgt|boolin|boolle|boollt|boolne|" +
  911. "boolor_statefunc|boolout|boolrecv|boolsend|box|box_above|box_above_eq|box_add|box_below|" +
  912. "box_below_eq|box_center|box_contain|box_contain_pt|box_contained|box_distance|box_div|" +
  913. "box_eq|box_ge|box_gt|box_in|box_intersect|box_le|box_left|box_lt|box_mul|box_out|" +
  914. "box_overabove|box_overbelow|box_overlap|box_overleft|box_overright|box_recv|box_right|" +
  915. "box_same|box_send|box_sub|bpchar_larger|bpchar_pattern_ge|bpchar_pattern_gt|" +
  916. "bpchar_pattern_le|bpchar_pattern_lt|bpchar_smaller|bpcharcmp|bpchareq|bpcharge|" +
  917. "bpchargt|bpchariclike|bpcharicnlike|bpcharicregexeq|bpcharicregexne|bpcharin|bpcharle|" +
  918. "bpcharlike|bpcharlt|bpcharne|bpcharnlike|bpcharout|bpcharrecv|bpcharregexeq|" +
  919. "bpcharregexne|bpcharsend|bpchartypmodin|bpchartypmodout|broadcast|btabstimecmp|" +
  920. "btarraycmp|btbeginscan|btboolcmp|btbpchar_pattern_cmp|btbuild|btbuildempty|" +
  921. "btbulkdelete|btcanreturn|btcharcmp|btcostestimate|btendscan|btfloat48cmp|btfloat4cmp|" +
  922. "btfloat4sortsupport|btfloat84cmp|btfloat8cmp|btfloat8sortsupport|btgetbitmap|" +
  923. "btgettuple|btinsert|btint24cmp|btint28cmp|btint2cmp|btint2sortsupport|btint42cmp|" +
  924. "btint48cmp|btint4cmp|btint4sortsupport|btint82cmp|btint84cmp|btint8cmp|" +
  925. "btint8sortsupport|btmarkpos|btnamecmp|btnamesortsupport|btoidcmp|btoidsortsupport|" +
  926. "btoidvectorcmp|btoptions|btrecordcmp|btreltimecmp|btrescan|btrestrpos|btrim|" +
  927. "bttext_pattern_cmp|bttextcmp|bttidcmp|bttintervalcmp|btvacuumcleanup|" +
  928. "bytea_string_agg_finalfn|bytea_string_agg_transfn|byteacat|byteacmp|byteaeq|byteage|" +
  929. "byteagt|byteain|byteale|bytealike|bytealt|byteane|byteanlike|byteaout|bytearecv|byteasend|" +
  930. "cash_cmp|cash_div_cash|cash_div_flt4|cash_div_flt8|cash_div_int2|cash_div_int4|cash_eq|" +
  931. "cash_ge|cash_gt|cash_in|cash_le|cash_lt|cash_mi|cash_mul_flt4|cash_mul_flt8|" +
  932. "cash_mul_int2|cash_mul_int4|cash_ne|cash_out|cash_pl|cash_recv|cash_send|cash_words|" +
  933. "cashlarger|cashsmaller|cbrt|ceil|ceiling|center|char|char_length|character_length|chareq|" +
  934. "charge|chargt|charin|charle|charlt|charne|charout|charrecv|charsend|chr|cideq|cidin|cidout|" +
  935. "cidr|cidr_in|cidr_out|cidr_recv|cidr_send|cidrecv|cidsend|circle|circle_above|" +
  936. "circle_add_pt|circle_below|circle_center|circle_contain|circle_contain_pt|" +
  937. "circle_contained|circle_distance|circle_div_pt|circle_eq|circle_ge|circle_gt|circle_in|" +
  938. "circle_le|circle_left|circle_lt|circle_mul_pt|circle_ne|circle_out|circle_overabove|" +
  939. "circle_overbelow|circle_overlap|circle_overleft|circle_overright|circle_recv|" +
  940. "circle_right|circle_same|circle_send|circle_sub_pt|clock_timestamp|close_lb|close_ls|" +
  941. "close_lseg|close_pb|close_pl|close_ps|close_sb|close_sl|col_description|concat|concat_ws|" +
  942. "contjoinsel|contsel|convert|convert_from|convert_to|corr|cos|cot|count|covar_pop|" +
  943. "covar_samp|cstring_in|cstring_out|cstring_recv|cstring_send|cume_dist|current_database|" +
  944. "current_query|current_schema|current_schemas|current_setting|current_user|currtid|" +
  945. "currtid2|currval|cursor_to_xml|cursor_to_xmlschema|database_to_xml|" +
  946. "database_to_xml_and_xmlschema|database_to_xmlschema|date|date_cmp|date_cmp_timestamp|" +
  947. "date_cmp_timestamptz|date_eq|date_eq_timestamp|date_eq_timestamptz|date_ge|" +
  948. "date_ge_timestamp|date_ge_timestamptz|date_gt|date_gt_timestamp|date_gt_timestamptz|" +
  949. "date_in|date_larger|date_le|date_le_timestamp|date_le_timestamptz|date_lt|" +
  950. "date_lt_timestamp|date_lt_timestamptz|date_mi|date_mi_interval|date_mii|date_ne|" +
  951. "date_ne_timestamp|date_ne_timestamptz|date_out|date_part|date_pl_interval|date_pli|" +
  952. "date_recv|date_send|date_smaller|date_sortsupport|date_trunc|daterange|" +
  953. "daterange_canonical|daterange_subdiff|datetime_pl|datetimetz_pl|dcbrt|decode|degrees|" +
  954. "dense_rank|dexp|diagonal|diameter|dispell_init|dispell_lexize|dist_cpoly|dist_lb|dist_pb|" +
  955. "dist_pc|dist_pl|dist_ppath|dist_ps|dist_sb|dist_sl|div|dlog1|dlog10|domain_in|domain_recv|" +
  956. "dpow|dround|dsimple_init|dsimple_lexize|dsnowball_init|dsnowball_lexize|dsqrt|" +
  957. "dsynonym_init|dsynonym_lexize|dtrunc|elem_contained_by_range|encode|enum_cmp|enum_eq|" +
  958. "enum_first|enum_ge|enum_gt|enum_in|enum_larger|enum_last|enum_le|enum_lt|enum_ne|enum_out|" +
  959. "enum_range|enum_recv|enum_send|enum_smaller|eqjoinsel|eqsel|euc_cn_to_mic|" +
  960. "euc_cn_to_utf8|euc_jis_2004_to_shift_jis_2004|euc_jis_2004_to_utf8|euc_jp_to_mic|" +
  961. "euc_jp_to_sjis|euc_jp_to_utf8|euc_kr_to_mic|euc_kr_to_utf8|euc_tw_to_big5|" +
  962. "euc_tw_to_mic|euc_tw_to_utf8|event_trigger_in|event_trigger_out|every|exp|factorial|" +
  963. "family|fdw_handler_in|fdw_handler_out|first_value|float4|float48div|float48eq|float48ge|" +
  964. "float48gt|float48le|float48lt|float48mi|float48mul|float48ne|float48pl|float4_accum|" +
  965. "float4abs|float4div|float4eq|float4ge|float4gt|float4in|float4larger|float4le|float4lt|" +
  966. "float4mi|float4mul|float4ne|float4out|float4pl|float4recv|float4send|float4smaller|" +
  967. "float4um|float4up|float8|float84div|float84eq|float84ge|float84gt|float84le|float84lt|" +
  968. "float84mi|float84mul|float84ne|float84pl|float8_accum|float8_avg|float8_corr|" +
  969. "float8_covar_pop|float8_covar_samp|float8_regr_accum|float8_regr_avgx|" +
  970. "float8_regr_avgy|float8_regr_intercept|float8_regr_r2|float8_regr_slope|" +
  971. "float8_regr_sxx|float8_regr_sxy|float8_regr_syy|float8_stddev_pop|float8_stddev_samp|" +
  972. "float8_var_pop|float8_var_samp|float8abs|float8div|float8eq|float8ge|float8gt|float8in|" +
  973. "float8larger|float8le|float8lt|float8mi|float8mul|float8ne|float8out|float8pl|float8recv|" +
  974. "float8send|float8smaller|float8um|float8up|floor|flt4_mul_cash|flt8_mul_cash|" +
  975. "fmgr_c_validator|fmgr_internal_validator|fmgr_sql_validator|format|format_type|" +
  976. "gb18030_to_utf8|gbk_to_utf8|generate_series|generate_subscripts|get_bit|get_byte|" +
  977. "get_current_ts_config|getdatabaseencoding|getpgusername|gin_cmp_prefix|" +
  978. "gin_cmp_tslexeme|gin_extract_tsquery|gin_extract_tsvector|gin_tsquery_consistent|" +
  979. "ginarrayconsistent|ginarrayextract|ginbeginscan|ginbuild|ginbuildempty|ginbulkdelete|" +
  980. "gincostestimate|ginendscan|gingetbitmap|gininsert|ginmarkpos|ginoptions|" +
  981. "ginqueryarrayextract|ginrescan|ginrestrpos|ginvacuumcleanup|gist_box_compress|" +
  982. "gist_box_consistent|gist_box_decompress|gist_box_penalty|gist_box_picksplit|" +
  983. "gist_box_same|gist_box_union|gist_circle_compress|gist_circle_consistent|" +
  984. "gist_point_compress|gist_point_consistent|gist_point_distance|gist_poly_compress|" +
  985. "gist_poly_consistent|gistbeginscan|gistbuild|gistbuildempty|gistbulkdelete|" +
  986. "gistcostestimate|gistendscan|gistgetbitmap|gistgettuple|gistinsert|gistmarkpos|" +
  987. "gistoptions|gistrescan|gistrestrpos|gistvacuumcleanup|gtsquery_compress|" +
  988. "gtsquery_consistent|gtsquery_decompress|gtsquery_penalty|gtsquery_picksplit|" +
  989. "gtsquery_same|gtsquery_union|gtsvector_compress|gtsvector_consistent|" +
  990. "gtsvector_decompress|gtsvector_penalty|gtsvector_picksplit|gtsvector_same|" +
  991. "gtsvector_union|gtsvectorin|gtsvectorout|has_any_column_privilege|" +
  992. "has_column_privilege|has_database_privilege|has_foreign_data_wrapper_privilege|" +
  993. "has_function_privilege|has_language_privilege|has_schema_privilege|" +
  994. "has_sequence_privilege|has_server_privilege|has_table_privilege|" +
  995. "has_tablespace_privilege|has_type_privilege|hash_aclitem|hash_array|hash_numeric|" +
  996. "hash_range|hashbeginscan|hashbpchar|hashbuild|hashbuildempty|hashbulkdelete|hashchar|" +
  997. "hashcostestimate|hashendscan|hashenum|hashfloat4|hashfloat8|hashgetbitmap|hashgettuple|" +
  998. "hashinet|hashinsert|hashint2|hashint2vector|hashint4|hashint8|hashmacaddr|hashmarkpos|" +
  999. "hashname|hashoid|hashoidvector|hashoptions|hashrescan|hashrestrpos|hashtext|" +
  1000. "hashvacuumcleanup|hashvarlena|height|host|hostmask|iclikejoinsel|iclikesel|" +
  1001. "icnlikejoinsel|icnlikesel|icregexeqjoinsel|icregexeqsel|icregexnejoinsel|icregexnesel|" +
  1002. "inet_client_addr|inet_client_port|inet_in|inet_out|inet_recv|inet_send|" +
  1003. "inet_server_addr|inet_server_port|inetand|inetmi|inetmi_int8|inetnot|inetor|inetpl|" +
  1004. "initcap|int2|int24div|int24eq|int24ge|int24gt|int24le|int24lt|int24mi|int24mul|int24ne|" +
  1005. "int24pl|int28div|int28eq|int28ge|int28gt|int28le|int28lt|int28mi|int28mul|int28ne|int28pl|" +
  1006. "int2_accum|int2_avg_accum|int2_mul_cash|int2_sum|int2abs|int2and|int2div|int2eq|int2ge|" +
  1007. "int2gt|int2in|int2larger|int2le|int2lt|int2mi|int2mod|int2mul|int2ne|int2not|int2or|int2out|" +
  1008. "int2pl|int2recv|int2send|int2shl|int2shr|int2smaller|int2um|int2up|int2vectoreq|" +
  1009. "int2vectorin|int2vectorout|int2vectorrecv|int2vectorsend|int2xor|int4|int42div|int42eq|" +
  1010. "int42ge|int42gt|int42le|int42lt|int42mi|int42mul|int42ne|int42pl|int48div|int48eq|int48ge|" +
  1011. "int48gt|int48le|int48lt|int48mi|int48mul|int48ne|int48pl|int4_accum|int4_avg_accum|" +
  1012. "int4_mul_cash|int4_sum|int4abs|int4and|int4div|int4eq|int4ge|int4gt|int4in|int4inc|" +
  1013. "int4larger|int4le|int4lt|int4mi|int4mod|int4mul|int4ne|int4not|int4or|int4out|int4pl|" +
  1014. "int4range|int4range_canonical|int4range_subdiff|int4recv|int4send|int4shl|int4shr|" +
  1015. "int4smaller|int4um|int4up|int4xor|int8|int82div|int82eq|int82ge|int82gt|int82le|int82lt|" +
  1016. "int82mi|int82mul|int82ne|int82pl|int84div|int84eq|int84ge|int84gt|int84le|int84lt|int84mi|" +
  1017. "int84mul|int84ne|int84pl|int8_accum|int8_avg|int8_avg_accum|int8_sum|int8abs|int8and|" +
  1018. "int8div|int8eq|int8ge|int8gt|int8in|int8inc|int8inc_any|int8inc_float8_float8|int8larger|" +
  1019. "int8le|int8lt|int8mi|int8mod|int8mul|int8ne|int8not|int8or|int8out|int8pl|int8pl_inet|" +
  1020. "int8range|int8range_canonical|int8range_subdiff|int8recv|int8send|int8shl|int8shr|" +
  1021. "int8smaller|int8um|int8up|int8xor|integer_pl_date|inter_lb|inter_sb|inter_sl|internal_in|" +
  1022. "internal_out|interval_accum|interval_avg|interval_cmp|interval_div|interval_eq|" +
  1023. "interval_ge|interval_gt|interval_hash|interval_in|interval_larger|interval_le|" +
  1024. "interval_lt|interval_mi|interval_mul|interval_ne|interval_out|interval_pl|" +
  1025. "interval_pl_date|interval_pl_time|interval_pl_timestamp|interval_pl_timestamptz|" +
  1026. "interval_pl_timetz|interval_recv|interval_send|interval_smaller|interval_transform|" +
  1027. "interval_um|intervaltypmodin|intervaltypmodout|intinterval|isclosed|isempty|isfinite|" +
  1028. "ishorizontal|iso8859_1_to_utf8|iso8859_to_utf8|iso_to_koi8r|iso_to_mic|iso_to_win1251|" +
  1029. "iso_to_win866|isopen|isparallel|isperp|isvertical|johab_to_utf8|json_agg|" +
  1030. "json_agg_finalfn|json_agg_transfn|json_array_element|json_array_element_text|" +
  1031. "json_array_elements|json_array_length|json_each|json_each_text|json_extract_path|" +
  1032. "json_extract_path_op|json_extract_path_text|json_extract_path_text_op|json_in|" +
  1033. "json_object_field|json_object_field_text|json_object_keys|json_out|" +
  1034. "json_populate_record|json_populate_recordset|json_recv|json_send|justify_days|" +
  1035. "justify_hours|justify_interval|koi8r_to_iso|koi8r_to_mic|koi8r_to_utf8|" +
  1036. "koi8r_to_win1251|koi8r_to_win866|koi8u_to_utf8|lag|language_handler_in|" +
  1037. "language_handler_out|last_value|lastval|latin1_to_mic|latin2_to_mic|latin2_to_win1250|" +
  1038. "latin3_to_mic|latin4_to_mic|lead|left|length|like|like_escape|likejoinsel|likesel|line|" +
  1039. "line_distance|line_eq|line_horizontal|line_in|line_interpt|line_intersect|line_out|" +
  1040. "line_parallel|line_perp|line_recv|line_send|line_vertical|ln|lo_close|lo_creat|lo_create|" +
  1041. "lo_export|lo_import|lo_lseek|lo_lseek64|lo_open|lo_tell|lo_tell64|lo_truncate|" +
  1042. "lo_truncate64|lo_unlink|log|loread|lower|lower_inc|lower_inf|lowrite|lpad|lseg|lseg_center|" +
  1043. "lseg_distance|lseg_eq|lseg_ge|lseg_gt|lseg_horizontal|lseg_in|lseg_interpt|" +
  1044. "lseg_intersect|lseg_le|lseg_length|lseg_lt|lseg_ne|lseg_out|lseg_parallel|lseg_perp|" +
  1045. "lseg_recv|lseg_send|lseg_vertical|ltrim|macaddr_and|macaddr_cmp|macaddr_eq|macaddr_ge|" +
  1046. "macaddr_gt|macaddr_in|macaddr_le|macaddr_lt|macaddr_ne|macaddr_not|macaddr_or|" +
  1047. "macaddr_out|macaddr_recv|macaddr_send|makeaclitem|masklen|max|md5|mic_to_ascii|" +
  1048. "mic_to_big5|mic_to_euc_cn|mic_to_euc_jp|mic_to_euc_kr|mic_to_euc_tw|mic_to_iso|" +
  1049. "mic_to_koi8r|mic_to_latin1|mic_to_latin2|mic_to_latin3|mic_to_latin4|mic_to_sjis|" +
  1050. "mic_to_win1250|mic_to_win1251|mic_to_win866|min|mktinterval|mod|money|mul_d_interval|" +
  1051. "name|nameeq|namege|namegt|nameiclike|nameicnlike|nameicregexeq|nameicregexne|namein|" +
  1052. "namele|namelike|namelt|namene|namenlike|nameout|namerecv|nameregexeq|nameregexne|namesend|" +
  1053. "neqjoinsel|neqsel|netmask|network|network_cmp|network_eq|network_ge|network_gt|" +
  1054. "network_le|network_lt|network_ne|network_sub|network_subeq|network_sup|network_supeq|" +
  1055. "nextval|nlikejoinsel|nlikesel|notlike|now|npoints|nth_value|ntile|numeric_abs|" +
  1056. "numeric_accum|numeric_add|numeric_avg|numeric_avg_accum|numeric_cmp|numeric_div|" +
  1057. "numeric_div_trunc|numeric_eq|numeric_exp|numeric_fac|numeric_ge|numeric_gt|numeric_in|" +
  1058. "numeric_inc|numeric_larger|numeric_le|numeric_ln|numeric_log|numeric_lt|numeric_mod|" +
  1059. "numeric_mul|numeric_ne|numeric_out|numeric_power|numeric_recv|numeric_send|" +
  1060. "numeric_smaller|numeric_sqrt|numeric_stddev_pop|numeric_stddev_samp|numeric_sub|" +
  1061. "numeric_transform|numeric_uminus|numeric_uplus|numeric_var_pop|numeric_var_samp|" +
  1062. "numerictypmodin|numerictypmodout|numnode|numrange|numrange_subdiff|obj_description|" +
  1063. "octet_length|oid|oideq|oidge|oidgt|oidin|oidlarger|oidle|oidlt|oidne|oidout|oidrecv|oidsend|" +
  1064. "oidsmaller|oidvectoreq|oidvectorge|oidvectorgt|oidvectorin|oidvectorle|oidvectorlt|" +
  1065. "oidvectorne|oidvectorout|oidvectorrecv|oidvectorsend|oidvectortypes|on_pb|on_pl|" +
  1066. "on_ppath|on_ps|on_sb|on_sl|opaque_in|opaque_out|overlaps|overlay|path|path_add|path_add_pt|" +
  1067. "path_center|path_contain_pt|path_distance|path_div_pt|path_in|path_inter|path_length|" +
  1068. "path_mul_pt|path_n_eq|path_n_ge|path_n_gt|path_n_le|path_n_lt|path_npoints|path_out|" +
  1069. "path_recv|path_send|path_sub_pt|pclose|percent_rank|pg_advisory_lock|" +
  1070. "pg_advisory_lock_shared|pg_advisory_unlock|pg_advisory_unlock_all|" +
  1071. "pg_advisory_unlock_shared|pg_advisory_xact_lock|pg_advisory_xact_lock_shared|" +
  1072. "pg_available_extension_versions|pg_available_extensions|pg_backend_pid|" +
  1073. "pg_backup_start_time|pg_cancel_backend|pg_char_to_encoding|pg_client_encoding|" +
  1074. "pg_collation_for|pg_collation_is_visible|pg_column_is_updatable|pg_column_size|" +
  1075. "pg_conf_load_time|pg_conversion_is_visible|pg_create_restore_point|" +
  1076. "pg_current_xlog_insert_location|pg_current_xlog_location|pg_cursor|pg_database_size|" +
  1077. "pg_describe_object|pg_encoding_max_length|pg_encoding_to_char|" +
  1078. "pg_event_trigger_dropped_objects|pg_export_snapshot|pg_extension_config_dump|" +
  1079. "pg_extension_update_paths|pg_function_is_visible|pg_get_constraintdef|pg_get_expr|" +
  1080. "pg_get_function_arguments|pg_get_function_identity_arguments|" +
  1081. "pg_get_function_result|pg_get_functiondef|pg_get_indexdef|pg_get_keywords|" +
  1082. "pg_get_multixact_members|pg_get_ruledef|pg_get_serial_sequence|pg_get_triggerdef|" +
  1083. "pg_get_userbyid|pg_get_viewdef|pg_has_role|pg_identify_object|pg_indexes_size|" +
  1084. "pg_is_in_backup|pg_is_in_recovery|pg_is_other_temp_schema|pg_is_xlog_replay_paused|" +
  1085. "pg_last_xact_replay_timestamp|pg_last_xlog_receive_location|" +
  1086. "pg_last_xlog_replay_location|pg_listening_channels|pg_lock_status|pg_ls_dir|" +
  1087. "pg_my_temp_schema|pg_node_tree_in|pg_node_tree_out|pg_node_tree_recv|" +
  1088. "pg_node_tree_send|pg_notify|pg_opclass_is_visible|pg_operator_is_visible|" +
  1089. "pg_opfamily_is_visible|pg_options_to_table|pg_postmaster_start_time|" +
  1090. "pg_prepared_statement|pg_prepared_xact|pg_read_binary_file|pg_read_file|" +
  1091. "pg_relation_filenode|pg_relation_filepath|pg_relation_is_updatable|pg_relation_size|" +
  1092. "pg_reload_conf|pg_rotate_logfile|pg_sequence_parameters|pg_show_all_settings|" +
  1093. "pg_size_pretty|pg_sleep|pg_start_backup|pg_stat_clear_snapshot|pg_stat_file|" +
  1094. "pg_stat_get_activity|pg_stat_get_analyze_count|pg_stat_get_autoanalyze_count|" +
  1095. "pg_stat_get_autovacuum_count|pg_stat_get_backend_activity|" +
  1096. "pg_stat_get_backend_activity_start|pg_stat_get_backend_client_addr|" +
  1097. "pg_stat_get_backend_client_port|pg_stat_get_backend_dbid|pg_stat_get_backend_idset|" +
  1098. "pg_stat_get_backend_pid|pg_stat_get_backend_start|pg_stat_get_backend_userid|" +
  1099. "pg_stat_get_backend_waiting|pg_stat_get_backend_xact_start|" +
  1100. "pg_stat_get_bgwriter_buf_written_checkpoints|" +
  1101. "pg_stat_get_bgwriter_buf_written_clean|pg_stat_get_bgwriter_maxwritten_clean|" +
  1102. "pg_stat_get_bgwriter_requested_checkpoints|pg_stat_get_bgwriter_stat_reset_time|" +
  1103. "pg_stat_get_bgwriter_timed_checkpoints|pg_stat_get_blocks_fetched|" +
  1104. "pg_stat_get_blocks_hit|pg_stat_get_buf_alloc|pg_stat_get_buf_fsync_backend|" +
  1105. "pg_stat_get_buf_written_backend|pg_stat_get_checkpoint_sync_time|" +
  1106. "pg_stat_get_checkpoint_write_time|pg_stat_get_db_blk_read_time|" +
  1107. "pg_stat_get_db_blk_write_time|pg_stat_get_db_blocks_fetched|" +
  1108. "pg_stat_get_db_blocks_hit|pg_stat_get_db_conflict_all|" +
  1109. "pg_stat_get_db_conflict_bufferpin|pg_stat_get_db_conflict_lock|" +
  1110. "pg_stat_get_db_conflict_snapshot|pg_stat_get_db_conflict_startup_deadlock|" +
  1111. "pg_stat_get_db_conflict_tablespace|pg_stat_get_db_deadlocks|" +
  1112. "pg_stat_get_db_numbackends|pg_stat_get_db_stat_reset_time|" +
  1113. "pg_stat_get_db_temp_bytes|pg_stat_get_db_temp_files|pg_stat_get_db_tuples_deleted|" +
  1114. "pg_stat_get_db_tuples_fetched|pg_stat_get_db_tuples_inserted|" +
  1115. "pg_stat_get_db_tuples_returned|pg_stat_get_db_tuples_updated|" +
  1116. "pg_stat_get_db_xact_commit|pg_stat_get_db_xact_rollback|pg_stat_get_dead_tuples|" +
  1117. "pg_stat_get_function_calls|pg_stat_get_function_self_time|" +
  1118. "pg_stat_get_function_total_time|pg_stat_get_last_analyze_time|" +
  1119. "pg_stat_get_last_autoanalyze_time|pg_stat_get_last_autovacuum_time|" +
  1120. "pg_stat_get_last_vacuum_time|pg_stat_get_live_tuples|pg_stat_get_numscans|" +
  1121. "pg_stat_get_tuples_deleted|pg_stat_get_tuples_fetched|" +
  1122. "pg_stat_get_tuples_hot_updated|pg_stat_get_tuples_inserted|" +
  1123. "pg_stat_get_tuples_returned|pg_stat_get_tuples_updated|pg_stat_get_vacuum_count|" +
  1124. "pg_stat_get_wal_senders|pg_stat_get_xact_blocks_fetched|" +
  1125. "pg_stat_get_xact_blocks_hit|pg_stat_get_xact_function_calls|" +
  1126. "pg_stat_get_xact_function_self_time|pg_stat_get_xact_function_total_time|" +
  1127. "pg_stat_get_xact_numscans|pg_stat_get_xact_tuples_deleted|" +
  1128. "pg_stat_get_xact_tuples_fetched|pg_stat_get_xact_tuples_hot_updated|" +
  1129. "pg_stat_get_xact_tuples_inserted|pg_stat_get_xact_tuples_returned|" +
  1130. "pg_stat_get_xact_tuples_updated|pg_stat_reset|pg_stat_reset_shared|" +
  1131. "pg_stat_reset_single_function_counters|pg_stat_reset_single_table_counters|" +
  1132. "pg_stop_backup|pg_switch_xlog|pg_table_is_visible|pg_table_size|" +
  1133. "pg_tablespace_databases|pg_tablespace_location|pg_tablespace_size|" +
  1134. "pg_terminate_backend|pg_timezone_abbrevs|pg_timezone_names|pg_total_relation_size|" +
  1135. "pg_trigger_depth|pg_try_advisory_lock|pg_try_advisory_lock_shared|" +
  1136. "pg_try_advisory_xact_lock|pg_try_advisory_xact_lock_shared|pg_ts_config_is_visible|" +
  1137. "pg_ts_dict_is_visible|pg_ts_parser_is_visible|pg_ts_template_is_visible|" +
  1138. "pg_type_is_visible|pg_typeof|pg_xlog_location_diff|pg_xlog_replay_pause|" +
  1139. "pg_xlog_replay_resume|pg_xlogfile_name|pg_xlogfile_name_offset|pi|plainto_tsquery|" +
  1140. "plpgsql_call_handler|plpgsql_inline_handler|plpgsql_validator|point|point_above|" +
  1141. "point_add|point_below|point_distance|point_div|point_eq|point_horiz|point_in|point_left|" +
  1142. "point_mul|point_ne|point_out|point_recv|point_right|point_send|point_sub|point_vert|" +
  1143. "poly_above|poly_below|poly_center|poly_contain|poly_contain_pt|poly_contained|" +
  1144. "poly_distance|poly_in|poly_left|poly_npoints|poly_out|poly_overabove|poly_overbelow|" +
  1145. "poly_overlap|poly_overleft|poly_overright|poly_recv|poly_right|poly_same|poly_send|" +
  1146. "polygon|popen|position|positionjoinsel|positionsel|postgresql_fdw_validator|pow|power|" +
  1147. "prsd_end|prsd_headline|prsd_lextype|prsd_nexttoken|prsd_start|pt_contained_circle|" +
  1148. "pt_contained_poly|query_to_xml|query_to_xml_and_xmlschema|query_to_xmlschema|" +
  1149. "querytree|quote_ident|quote_literal|quote_nullable|radians|radius|random|range_adjacent|" +
  1150. "range_after|range_before|range_cmp|range_contained_by|range_contains|" +
  1151. "range_contains_elem|range_eq|range_ge|range_gist_compress|range_gist_consistent|" +
  1152. "range_gist_decompress|range_gist_penalty|range_gist_picksplit|range_gist_same|" +
  1153. "range_gist_union|range_gt|range_in|range_intersect|range_le|range_lt|range_minus|" +
  1154. "range_ne|range_out|range_overlaps|range_overleft|range_overright|range_recv|range_send|" +
  1155. "range_typanalyze|range_union|rangesel|rank|record_eq|record_ge|record_gt|record_in|" +
  1156. "record_le|record_lt|record_ne|record_out|record_recv|record_send|regclass|regclassin|" +
  1157. "regclassout|regclassrecv|regclasssend|regconfigin|regconfigout|regconfigrecv|" +
  1158. "regconfigsend|regdictionaryin|regdictionaryout|regdictionaryrecv|regdictionarysend|" +
  1159. "regexeqjoinsel|regexeqsel|regexnejoinsel|regexnesel|regexp_matches|regexp_replace|" +
  1160. "regexp_split_to_array|regexp_split_to_table|regoperatorin|regoperatorout|" +
  1161. "regoperatorrecv|regoperatorsend|regoperin|regoperout|regoperrecv|regopersend|" +
  1162. "regprocedurein|regprocedureout|regprocedurerecv|regproceduresend|regprocin|regprocout|" +
  1163. "regprocrecv|regprocsend|regr_avgx|regr_avgy|regr_count|regr_intercept|regr_r2|" +
  1164. "regr_slope|regr_sxx|regr_sxy|regr_syy|regtypein|regtypeout|regtyperecv|regtypesend|" +
  1165. "reltime|reltimeeq|reltimege|reltimegt|reltimein|reltimele|reltimelt|reltimene|reltimeout|" +
  1166. "reltimerecv|reltimesend|repeat|replace|reverse|right|round|row_number|row_to_json|rpad|" +
  1167. "rtrim|scalargtjoinsel|scalargtsel|scalarltjoinsel|scalarltsel|schema_to_xml|" +
  1168. "schema_to_xml_and_xmlschema|schema_to_xmlschema|session_user|set_bit|set_byte|" +
  1169. "set_config|set_masklen|setseed|setval|setweight|shell_in|shell_out|" +
  1170. "shift_jis_2004_to_euc_jis_2004|shift_jis_2004_to_utf8|shobj_description|sign|" +
  1171. "similar_escape|sin|sjis_to_euc_jp|sjis_to_mic|sjis_to_utf8|slope|smgreq|smgrin|smgrne|" +
  1172. "smgrout|spg_kd_choose|spg_kd_config|spg_kd_inner_consistent|spg_kd_picksplit|" +
  1173. "spg_quad_choose|spg_quad_config|spg_quad_inner_consistent|spg_quad_leaf_consistent|" +
  1174. "spg_quad_picksplit|spg_range_quad_choose|spg_range_quad_config|" +
  1175. "spg_range_quad_inner_consistent|spg_range_quad_leaf_consistent|" +
  1176. "spg_range_quad_picksplit|spg_text_choose|spg_text_config|spg_text_inner_consistent|" +
  1177. "spg_text_leaf_consistent|spg_text_picksplit|spgbeginscan|spgbuild|spgbuildempty|" +
  1178. "spgbulkdelete|spgcanreturn|spgcostestimate|spgendscan|spggetbitmap|spggettuple|" +
  1179. "spginsert|spgmarkpos|spgoptions|spgrescan|spgrestrpos|spgvacuumcleanup|split_part|sqrt|" +
  1180. "statement_timestamp|stddev|stddev_pop|stddev_samp|string_agg|string_agg_finalfn|" +
  1181. "string_agg_transfn|string_to_array|strip|strpos|substr|substring|sum|" +
  1182. "suppress_redundant_updates_trigger|table_to_xml|table_to_xml_and_xmlschema|" +
  1183. "table_to_xmlschema|tan|text|text_ge|text_gt|text_larger|text_le|text_lt|text_pattern_ge|" +
  1184. "text_pattern_gt|text_pattern_le|text_pattern_lt|text_smaller|textanycat|textcat|texteq|" +
  1185. "texticlike|texticnlike|texticregexeq|texticregexne|textin|textlen|textlike|textne|" +
  1186. "textnlike|textout|textrecv|textregexeq|textregexne|textsend|thesaurus_init|" +
  1187. "thesaurus_lexize|tideq|tidge|tidgt|tidin|tidlarger|tidle|tidlt|tidne|tidout|tidrecv|tidsend|" +
  1188. "tidsmaller|time_cmp|time_eq|time_ge|time_gt|time_hash|time_in|time_larger|time_le|time_lt|" +
  1189. "time_mi_interval|time_mi_time|time_ne|time_out|time_pl_interval|time_recv|time_send|" +
  1190. "time_smaller|time_transform|timedate_pl|timemi|timenow|timeofday|timepl|timestamp_cmp|" +
  1191. "timestamp_cmp_date|timestamp_cmp_timestamptz|timestamp_eq|timestamp_eq_date|" +
  1192. "timestamp_eq_timestamptz|timestamp_ge|timestamp_ge_date|timestamp_ge_timestamptz|" +
  1193. "timestamp_gt|timestamp_gt_date|timestamp_gt_timestamptz|timestamp_hash|timestamp_in|" +
  1194. "timestamp_larger|timestamp_le|timestamp_le_date|timestamp_le_timestamptz|" +
  1195. "timestamp_lt|timestamp_lt_date|timestamp_lt_timestamptz|timestamp_mi|" +
  1196. "timestamp_mi_interval|timestamp_ne|timestamp_ne_date|timestamp_ne_timestamptz|" +
  1197. "timestamp_out|timestamp_pl_interval|timestamp_recv|timestamp_send|timestamp_smaller|" +
  1198. "timestamp_sortsupport|timestamp_transform|timestamptypmodin|timestamptypmodout|" +
  1199. "timestamptz_cmp|timestamptz_cmp_date|timestamptz_cmp_timestamp|timestamptz_eq|" +
  1200. "timestamptz_eq_date|timestamptz_eq_timestamp|timestamptz_ge|timestamptz_ge_date|" +
  1201. "timestamptz_ge_timestamp|timestamptz_gt|timestamptz_gt_date|" +
  1202. "timestamptz_gt_timestamp|timestamptz_in|timestamptz_larger|timestamptz_le|" +
  1203. "timestamptz_le_date|timestamptz_le_timestamp|timestamptz_lt|timestamptz_lt_date|" +
  1204. "timestamptz_lt_timestamp|timestamptz_mi|timestamptz_mi_interval|timestamptz_ne|" +
  1205. "timestamptz_ne_date|timestamptz_ne_timestamp|timestamptz_out|" +
  1206. "timestamptz_pl_interval|timestamptz_recv|timestamptz_send|timestamptz_smaller|" +
  1207. "timestamptztypmodin|timestamptztypmodout|timetypmodin|timetypmodout|timetz_cmp|" +
  1208. "timetz_eq|timetz_ge|timetz_gt|timetz_hash|timetz_in|timetz_larger|timetz_le|timetz_lt|" +
  1209. "timetz_mi_interval|timetz_ne|timetz_out|timetz_pl_interval|timetz_recv|timetz_send|" +
  1210. "timetz_smaller|timetzdate_pl|timetztypmodin|timetztypmodout|timezone|tinterval|" +
  1211. "tintervalct|tintervalend|tintervaleq|tintervalge|tintervalgt|tintervalin|tintervalle|" +
  1212. "tintervalleneq|tintervallenge|tintervallengt|tintervallenle|tintervallenlt|" +
  1213. "tintervallenne|tintervallt|tintervalne|tintervalout|tintervalov|tintervalrecv|" +
  1214. "tintervalrel|tintervalsame|tintervalsend|tintervalstart|to_ascii|to_char|to_date|to_hex|" +
  1215. "to_json|to_number|to_timestamp|to_tsquery|to_tsvector|transaction_timestamp|translate|" +
  1216. "trigger_in|trigger_out|trunc|ts_debug|ts_headline|ts_lexize|ts_match_qv|ts_match_tq|" +
  1217. "ts_match_tt|ts_match_vq|ts_parse|ts_rank|ts_rank_cd|ts_rewrite|ts_stat|ts_token_type|" +
  1218. "ts_typanalyze|tsmatchjoinsel|tsmatchsel|tsq_mcontained|tsq_mcontains|tsquery_and|" +
  1219. "tsquery_cmp|tsquery_eq|tsquery_ge|tsquery_gt|tsquery_le|tsquery_lt|tsquery_ne|" +
  1220. "tsquery_not|tsquery_or|tsqueryin|tsqueryout|tsqueryrecv|tsquerysend|tsrange|" +
  1221. "tsrange_subdiff|tstzrange|tstzrange_subdiff|tsvector_cmp|tsvector_concat|tsvector_eq|" +
  1222. "tsvector_ge|tsvector_gt|tsvector_le|tsvector_lt|tsvector_ne|tsvector_update_trigger|" +
  1223. "tsvector_update_trigger_column|tsvectorin|tsvectorout|tsvectorrecv|tsvectorsend|" +
  1224. "txid_current|txid_current_snapshot|txid_snapshot_in|txid_snapshot_out|" +
  1225. "txid_snapshot_recv|txid_snapshot_send|txid_snapshot_xip|txid_snapshot_xmax|" +
  1226. "txid_snapshot_xmin|txid_visible_in_snapshot|uhc_to_utf8|unique_key_recheck|unknownin|" +
  1227. "unknownout|unknownrecv|unknownsend|unnest|upper|upper_inc|upper_inf|utf8_to_ascii|" +
  1228. "utf8_to_big5|utf8_to_euc_cn|utf8_to_euc_jis_2004|utf8_to_euc_jp|utf8_to_euc_kr|" +
  1229. "utf8_to_euc_tw|utf8_to_gb18030|utf8_to_gbk|utf8_to_iso8859|utf8_to_iso8859_1|" +
  1230. "utf8_to_johab|utf8_to_koi8r|utf8_to_koi8u|utf8_to_shift_jis_2004|utf8_to_sjis|" +
  1231. "utf8_to_uhc|utf8_to_win|uuid_cmp|uuid_eq|uuid_ge|uuid_gt|uuid_hash|uuid_in|uuid_le|" +
  1232. "uuid_lt|uuid_ne|uuid_out|uuid_recv|uuid_send|var_pop|var_samp|varbit_in|varbit_out|" +
  1233. "varbit_recv|varbit_send|varbit_transform|varbitcmp|varbiteq|varbitge|varbitgt|varbitle|" +
  1234. "varbitlt|varbitne|varbittypmodin|varbittypmodout|varchar_transform|varcharin|" +
  1235. "varcharout|varcharrecv|varcharsend|varchartypmodin|varchartypmodout|variance|version|" +
  1236. "void_in|void_out|void_recv|void_send|width|width_bucket|win1250_to_latin2|" +
  1237. "win1250_to_mic|win1251_to_iso|win1251_to_koi8r|win1251_to_mic|win1251_to_win866|" +
  1238. "win866_to_iso|win866_to_koi8r|win866_to_mic|win866_to_win1251|win_to_utf8|xideq|" +
  1239. "xideqint4|xidin|xidout|xidrecv|xidsend|xml|xml_in|xml_is_well_formed|" +
  1240. "xml_is_well_formed_content|xml_is_well_formed_document|xml_out|xml_recv|xml_send|" +
  1241. "xmlagg|xmlcomment|xmlconcat2|xmlexists|xmlvalidate|xpath|xpath_exists"
  1242. );
  1243. var keywordMapper = this.createKeywordMapper({
  1244. "support.function": builtinFunctions,
  1245. "keyword": keywords
  1246. }, "identifier", true);
  1247. var sqlRules = [{
  1248. token : "string", // single line string -- assume dollar strings if multi-line for now
  1249. regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
  1250. }, {
  1251. token : "variable.language", // pg identifier
  1252. regex : '".*?"'
  1253. }, {
  1254. token : "constant.numeric", // float
  1255. regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
  1256. }, {
  1257. token : keywordMapper,
  1258. regex : "[a-zA-Z_][a-zA-Z0-9_$]*\\b" // TODO - Unicode in identifiers
  1259. }, {
  1260. token : "keyword.operator",
  1261. regex : "!|!!|!~|!~\\*|!~~|!~~\\*|#|##|#<|#<=|#<>|#=|#>|#>=|%|\\&|\\&\\&|\\&<|\\&<\\||\\&>|\\*|\\+|" +
  1262. "\\-|/|<|<#>|<\\->|<<|<<=|<<\\||<=|<>|<\\?>|<@|<\\^|=|>|>=|>>|>>=|>\\^|\\?#|\\?\\-|\\?\\-\\||" +
  1263. "\\?\\||\\?\\|\\||@|@\\-@|@>|@@|@@@|\\^|\\||\\|\\&>|\\|/|\\|>>|\\|\\||\\|\\|/|~|~\\*|~<=~|~<~|" +
  1264. "~=|~>=~|~>~|~~|~~\\*"
  1265. }, {
  1266. token : "paren.lparen",
  1267. regex : "[\\(]"
  1268. }, {
  1269. token : "paren.rparen",
  1270. regex : "[\\)]"
  1271. }, {
  1272. token : "text",
  1273. regex : "\\s+"
  1274. }
  1275. ];
  1276. this.$rules = {
  1277. "start" : [{
  1278. token : "comment",
  1279. regex : "--.*$"
  1280. },
  1281. DocCommentHighlightRules.getStartRule("doc-start"),
  1282. {
  1283. token : "comment", // multi-line comment
  1284. regex : "\\/\\*",
  1285. next : "comment"
  1286. },{
  1287. token : "keyword.statementBegin",
  1288. regex : "[a-zA-Z]+", // Could enumerate starting keywords but this allows things to work when new statements are added.
  1289. next : "statement"
  1290. },{
  1291. token : "support.buildin", // psql directive
  1292. regex : "^\\\\[\\S]+.*$"
  1293. }
  1294. ],
  1295. "statement" : [{
  1296. token : "comment",
  1297. regex : "--.*$"
  1298. }, {
  1299. token : "comment", // multi-line comment
  1300. regex : "\\/\\*",
  1301. next : "commentStatement"
  1302. }, {
  1303. token : "statementEnd",
  1304. regex : ";",
  1305. next : "start"
  1306. }, {
  1307. token : "string",
  1308. regex : "\\$perl\\$",
  1309. next : "perl-start"
  1310. }, {
  1311. token : "string",
  1312. regex : "\\$python\\$",
  1313. next : "python-start"
  1314. }, {
  1315. token : "string",
  1316. regex : "\\$json\\$",
  1317. next : "json-start"
  1318. }, {
  1319. token : "string",
  1320. regex : "\\$(js|javascript)\\$",
  1321. next : "javascript-start"
  1322. }, {
  1323. token : "string",
  1324. regex : "\\$[\\w_0-9]*\\$$", // dollar quote at the end of a line
  1325. next : "dollarSql"
  1326. }, {
  1327. token : "string",
  1328. regex : "\\$[\\w_0-9]*\\$",
  1329. next : "dollarStatementString"
  1330. }
  1331. ].concat(sqlRules),
  1332. "dollarSql" : [{
  1333. token : "comment",
  1334. regex : "--.*$"
  1335. }, {
  1336. token : "comment", // multi-line comment
  1337. regex : "\\/\\*",
  1338. next : "commentDollarSql"
  1339. }, {
  1340. token : "string", // end quoting with dollar at the start of a line
  1341. regex : "^\\$[\\w_0-9]*\\$",
  1342. next : "statement"
  1343. }, {
  1344. token : "string",
  1345. regex : "\\$[\\w_0-9]*\\$",
  1346. next : "dollarSqlString"
  1347. }
  1348. ].concat(sqlRules),
  1349. "comment" : [{
  1350. token : "comment", // closing comment
  1351. regex : "\\*\\/",
  1352. next : "start"
  1353. }, {
  1354. defaultToken : "comment"
  1355. }
  1356. ],
  1357. "commentStatement" : [{
  1358. token : "comment", // closing comment
  1359. regex : "\\*\\/",
  1360. next : "statement"
  1361. }, {
  1362. defaultToken : "comment"
  1363. }
  1364. ],
  1365. "commentDollarSql" : [{
  1366. token : "comment", // closing comment
  1367. regex : "\\*\\/",
  1368. next : "dollarSql"
  1369. }, {
  1370. defaultToken : "comment"
  1371. }
  1372. ],
  1373. "dollarStatementString" : [{
  1374. token : "string", // closing dollarstring
  1375. regex : ".*?\\$[\\w_0-9]*\\$",
  1376. next : "statement"
  1377. }, {
  1378. token : "string", // dollarstring spanning whole line
  1379. regex : ".+"
  1380. }
  1381. ],
  1382. "dollarSqlString" : [{
  1383. token : "string", // closing dollarstring
  1384. regex : ".*?\\$[\\w_0-9]*\\$",
  1385. next : "dollarSql"
  1386. }, {
  1387. token : "string", // dollarstring spanning whole line
  1388. regex : ".+"
  1389. }
  1390. ]
  1391. };
  1392. this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]);
  1393. this.embedRules(PerlHighlightRules, "perl-", [{token : "string", regex : "\\$perl\\$", next : "statement"}]);
  1394. this.embedRules(PythonHighlightRules, "python-", [{token : "string", regex : "\\$python\\$", next : "statement"}]);
  1395. this.embedRules(JsonHighlightRules, "json-", [{token : "string", regex : "\\$json\\$", next : "statement"}]);
  1396. this.embedRules(JavaScriptHighlightRules, "javascript-", [{token : "string", regex : "\\$(js|javascript)\\$", next : "statement"}]);
  1397. };
  1398. oop.inherits(PgsqlHighlightRules, TextHighlightRules);
  1399. exports.PgsqlHighlightRules = PgsqlHighlightRules;
  1400. });
  1401. ace.define("ace/mode/pgsql",[], function(require, exports, module) {
  1402. var oop = require("../lib/oop");
  1403. var TextMode = require("../mode/text").Mode;
  1404. var PgsqlHighlightRules = require("./pgsql_highlight_rules").PgsqlHighlightRules;
  1405. var Mode = function() {
  1406. this.HighlightRules = PgsqlHighlightRules;
  1407. this.$behaviour = this.$defaultBehaviour;
  1408. };
  1409. oop.inherits(Mode, TextMode);
  1410. (function() {
  1411. this.lineCommentStart = "--";
  1412. this.blockComment = {start: "/*", end: "*/"};
  1413. this.getNextLineIndent = function(state, line, tab) {
  1414. if (state == "start" || state == "keyword.statementEnd") {
  1415. return "";
  1416. } else {
  1417. return this.$getIndent(line); // Keep whatever indent the previous line has
  1418. }
  1419. };
  1420. this.$id = "ace/mode/pgsql";
  1421. }).call(Mode.prototype);
  1422. exports.Mode = Mode;
  1423. });
  1424. (function() {
  1425. ace.require(["ace/mode/pgsql"], function(m) {
  1426. if (typeof module == "object" && typeof exports == "object" && module) {
  1427. module.exports = m;
  1428. }
  1429. });
  1430. })();