3799d08c351633c98f6ae5ff08397674.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747
  1. ace.define("ace/mode/ion_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/*
  2. THIS FILE WAS GENERATED BY 'ligand' USING 'mode_highlight_rules.js'
  3. */
  4. "use strict";
  5. var oop = require("../lib/oop");
  6. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  7. var IonHighlightRules = function () {
  8. var k_keywords_bool = "TRUE|FALSE";
  9. var k_bool = k_keywords_bool;
  10. var k_keywords_null = "NULL.NULL|NULL.BOOL|NULL.INT|NULL.FLOAT|NULL.DECIMAL|NULL.TIMESTAMP|NULL.STRING|NULL.SYMBOL|NULL.BLOB|NULL.CLOB|"
  11. + "NULL.STRUCT|NULL.LIST|NULL.SEXP|NULL";
  12. var k_null = k_keywords_null;
  13. var keywordMapper = this.createKeywordMapper({
  14. "constant.language.bool.ion": k_bool,
  15. "constant.language.null.ion": k_null
  16. }, "constant.other.symbol.identifier.ion", true);
  17. var keywordMapperRule = {
  18. token: keywordMapper,
  19. regex: "\\b\\w+(?:\\.\\w+)?\\b"
  20. };
  21. this.$rules = {
  22. "start": [
  23. {
  24. "include": "value"
  25. }
  26. ],
  27. "value": [
  28. {
  29. "include": "whitespace"
  30. },
  31. {
  32. "include": "comment"
  33. },
  34. {
  35. "include": "annotation"
  36. },
  37. {
  38. "include": "string"
  39. },
  40. {
  41. "include": "number"
  42. },
  43. {
  44. "include": "keywords"
  45. },
  46. {
  47. "include": "symbol"
  48. },
  49. {
  50. "include": "clob"
  51. },
  52. {
  53. "include": "blob"
  54. },
  55. {
  56. "include": "struct"
  57. },
  58. {
  59. "include": "list"
  60. },
  61. {
  62. "include": "sexp"
  63. }
  64. ],
  65. "sexp": [
  66. {
  67. "token": "punctuation.definition.sexp.begin.ion",
  68. "regex": "\\(",
  69. "push": [
  70. {
  71. "token": "punctuation.definition.sexp.end.ion",
  72. "regex": "\\)",
  73. "next": "pop"
  74. },
  75. {
  76. "include": "comment"
  77. },
  78. {
  79. "include": "value"
  80. },
  81. {
  82. "token": "storage.type.symbol.operator.ion",
  83. "regex": "[\\!\\#\\%\\&\\*\\+\\-\\./\\;\\<\\=\\>\\?\\@\\^\\`\\|\\~]+"
  84. }
  85. ]
  86. }
  87. ],
  88. "comment": [
  89. {
  90. "token": "comment.line.ion",
  91. "regex": "//[^\\n]*"
  92. },
  93. {
  94. "token": "comment.block.ion",
  95. "regex": "/\\*",
  96. "push": [
  97. {
  98. "token": "comment.block.ion",
  99. "regex": "[*]/",
  100. "next": "pop"
  101. },
  102. {
  103. "token": "comment.block.ion",
  104. "regex": "[^*/]+"
  105. },
  106. {
  107. "token": "comment.block.ion",
  108. "regex": "[*/]+"
  109. }
  110. ]
  111. }
  112. ],
  113. "list": [
  114. {
  115. "token": "punctuation.definition.list.begin.ion",
  116. "regex": "\\[",
  117. "push": [
  118. {
  119. "token": "punctuation.definition.list.end.ion",
  120. "regex": "\\]",
  121. "next": "pop"
  122. },
  123. {
  124. "include": "comment"
  125. },
  126. {
  127. "include": "value"
  128. },
  129. {
  130. "token": "punctuation.definition.list.separator.ion",
  131. "regex": ","
  132. }
  133. ]
  134. }
  135. ],
  136. "struct": [
  137. {
  138. "token": "punctuation.definition.struct.begin.ion",
  139. "regex": "\\{",
  140. "push": [
  141. {
  142. "token": "punctuation.definition.struct.end.ion",
  143. "regex": "\\}",
  144. "next": "pop"
  145. },
  146. {
  147. "include": "comment"
  148. },
  149. {
  150. "include": "value"
  151. },
  152. {
  153. "token": "punctuation.definition.struct.separator.ion",
  154. "regex": ",|:"
  155. }
  156. ]
  157. }
  158. ],
  159. "blob": [
  160. {
  161. "token": [
  162. "punctuation.definition.blob.begin.ion",
  163. "string.other.blob.ion",
  164. "punctuation.definition.blob.end.ion"
  165. ],
  166. "regex": "(\\{\\{)([^\"]*)(\\}\\})"
  167. }
  168. ],
  169. "clob": [
  170. {
  171. "token": [
  172. "punctuation.definition.clob.begin.ion",
  173. "string.other.clob.ion",
  174. "punctuation.definition.clob.end.ion"
  175. ],
  176. "regex": "(\\{\\{)(\"[^\"]*\")(\\}\\})"
  177. }
  178. ],
  179. "symbol": [
  180. {
  181. "token": "storage.type.symbol.quoted.ion",
  182. "regex": "(['])((?:(?:\\\\')|(?:[^']))*?)(['])"
  183. },
  184. {
  185. "token": "storage.type.symbol.identifier.ion",
  186. "regex": "[\\$_a-zA-Z][\\$_a-zA-Z0-9]*"
  187. }
  188. ],
  189. "number": [
  190. {
  191. "token": "constant.numeric.timestamp.ion",
  192. "regex": "\\d{4}(?:-\\d{2})?(?:-\\d{2})?T(?:\\d{2}:\\d{2})(?::\\d{2})?(?:\\.\\d+)?(?:Z|[-+]\\d{2}:\\d{2})?"
  193. },
  194. {
  195. "token": "constant.numeric.timestamp.ion",
  196. "regex": "\\d{4}-\\d{2}-\\d{2}T?"
  197. },
  198. {
  199. "token": "constant.numeric.integer.binary.ion",
  200. "regex": "-?0[bB][01](?:_?[01])*"
  201. },
  202. {
  203. "token": "constant.numeric.integer.hex.ion",
  204. "regex": "-?0[xX][0-9a-fA-F](?:_?[0-9a-fA-F])*"
  205. },
  206. {
  207. "token": "constant.numeric.float.ion",
  208. "regex": "-?(?:0|[1-9](?:_?\\d)*)(?:\\.(?:\\d(?:_?\\d)*)?)?(?:[eE][+-]?\\d+)"
  209. },
  210. {
  211. "token": "constant.numeric.float.ion",
  212. "regex": "(?:[-+]inf)|(?:nan)"
  213. },
  214. {
  215. "token": "constant.numeric.decimal.ion",
  216. "regex": "-?(?:0|[1-9](?:_?\\d)*)(?:(?:(?:\\.(?:\\d(?:_?\\d)*)?)(?:[dD][+-]?\\d+)|\\.(?:\\d(?:_?\\d)*)?)|(?:[dD][+-]?\\d+))"
  217. },
  218. {
  219. "token": "constant.numeric.integer.ion",
  220. "regex": "-?(?:0|[1-9](?:_?\\d)*)"
  221. }
  222. ],
  223. "string": [
  224. {
  225. "token": [
  226. "punctuation.definition.string.begin.ion",
  227. "string.quoted.double.ion",
  228. "punctuation.definition.string.end.ion"
  229. ],
  230. "regex": "([\"])((?:(?:\\\\\")|(?:[^\"]))*?)([\"])"
  231. },
  232. {
  233. "token": "punctuation.definition.string.begin.ion",
  234. "regex": "'{3}",
  235. "push": [
  236. {
  237. "token": "punctuation.definition.string.end.ion",
  238. "regex": "'{3}",
  239. "next": "pop"
  240. },
  241. {
  242. "token": "string.quoted.triple.ion",
  243. "regex": "(?:\\\\'|[^'])+"
  244. },
  245. {
  246. "token": "string.quoted.triple.ion",
  247. "regex": "'"
  248. }
  249. ]
  250. }
  251. ],
  252. "annotation": [
  253. {
  254. "token": [
  255. "variable.language.annotation.ion",
  256. "punctuation.definition.annotation.ion"
  257. ],
  258. "regex": "('(?:[^']|\\\\\\\\|\\\\')*')\\s*(::)"
  259. },
  260. {
  261. "token": [
  262. "variable.language.annotation.ion",
  263. "punctuation.definition.annotation.ion"
  264. ],
  265. "regex": "([\\$_a-zA-Z][\\$_a-zA-Z0-9]*)\\s*(::)"
  266. }
  267. ],
  268. "whitespace": [
  269. {
  270. "token": "text.ion",
  271. "regex": "\\s+"
  272. }
  273. ]
  274. };
  275. this.$rules["keywords"] = [keywordMapperRule];
  276. this.normalizeRules();
  277. };
  278. oop.inherits(IonHighlightRules, TextHighlightRules);
  279. exports.IonHighlightRules = IonHighlightRules;
  280. });
  281. ace.define("ace/mode/partiql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/ion_highlight_rules"], function(require, exports, module){/*
  282. THIS FILE WAS GENERATED BY 'ligand' USING 'mode_highlight_rules.js'
  283. */
  284. "use strict";
  285. var oop = require("../lib/oop");
  286. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  287. var IonHighlightRules = require("./ion_highlight_rules").IonHighlightRules;
  288. var PartiqlHighlightRules = function () {
  289. var k_partiql_constant = "MISSING";
  290. var k_sql_constant = "FALSE|NULL|TRUE";
  291. var k_constant = k_partiql_constant + "|" + k_sql_constant;
  292. var k_partiql_keyword = "PIVOT|UNPIVOT|LIMIT|TUPLE|REMOVE|INDEX|CONFLICT|DO|NOTHING|RETURNING|"
  293. + "MODIFIED|NEW|OLD|LET";
  294. var k_sql_keyword = "ABSOLUTE|ACTION|ADD|ALL|ALLOCATE|ALTER|AND|ANY|ARE|AS|"
  295. + "ASC|ASSERTION|AT|AUTHORIZATION|BEGIN|BETWEEN|BIT_LENGTH|BY|CASCADE|CASCADED|"
  296. + "CASE|CATALOG|CHAR|CHARACTER_LENGTH|CHAR_LENGTH|CHECK|CLOSE|COLLATE|COLLATION|COLUMN|"
  297. + "COMMIT|CONNECT|CONNECTION|CONSTRAINT|CONSTRAINTS|CONTINUE|CONVERT|CORRESPONDING|CREATE|CROSS|"
  298. + "CURRENT|CURSOR|DEALLOCATE|DEC|DECLARE|DEFAULT|DEFERRABLE|DEFERRED|DELETE|DESC|"
  299. + "DESCRIBE|DESCRIPTOR|DIAGNOSTICS|DISCONNECT|DISTINCT|DOMAIN|DROP|ELSE|END|END-EXEC|"
  300. + "ESCAPE|EXCEPT|EXCEPTION|EXEC|EXECUTE|EXTERNAL|EXTRACT|FETCH|FIRST|FOR|"
  301. + "FOREIGN|FOUND|FROM|FULL|GET|GLOBAL|GO|GOTO|GRANT|GROUP|"
  302. + "HAVING|IDENTITY|IMMEDIATE|IN|INDICATOR|INITIALLY|INNER|INPUT|INSENSITIVE|INSERT|"
  303. + "INTERSECT|INTERVAL|INTO|IS|ISOLATION|JOIN|KEY|LANGUAGE|LAST|LEFT|"
  304. + "LEVEL|LIKE|LOCAL|LOWER|MATCH|MODULE|NAMES|NATIONAL|NATURAL|NCHAR|"
  305. + "NEXT|NO|NOT|OCTET_LENGTH|OF|ON|ONLY|OPEN|OPTION|OR|"
  306. + "ORDER|OUTER|OUTPUT|OVERLAPS|PAD|PARTIAL|POSITION|PRECISION|PREPARE|PRESERVE|"
  307. + "PRIMARY|PRIOR|PRIVILEGES|PROCEDURE|PUBLIC|READ|REAL|REFERENCES|RELATIVE|RESTRICT|"
  308. + "REVOKE|RIGHT|ROLLBACK|ROWS|SCHEMA|SCROLL|SECTION|SELECT|SESSION|SET|"
  309. + "SIZE|SOME|SPACE|SQL|SQLCODE|SQLERROR|SQLSTATE|TABLE|TEMPORARY|THEN|"
  310. + "TIME|TO|TRANSACTION|TRANSLATE|TRANSLATION|UNION|UNIQUE|UNKNOWN|UPDATE|UPPER|"
  311. + "USAGE|USER|USING|VALUE|VALUES|VIEW|WHEN|WHENEVER|WHERE|WITH|"
  312. + "WORK|WRITE|ZONE";
  313. var k_keyword = k_partiql_keyword + "|" + k_sql_keyword;
  314. var k_partiql_type = "BOOL|BOOLEAN|STRING|SYMBOL|CLOB|BLOB|STRUCT|LIST|SEXP|BAG";
  315. var k_sql_type = "CHARACTER|DATE|DECIMAL|DOUBLE|FLOAT|INT|INTEGER|NUMERIC|SMALLINT|TIMESTAMP|"
  316. + "VARCHAR|VARYING";
  317. var k_type = k_partiql_type + "|" + k_sql_type;
  318. var k_sql_aggfn = "AVG|COUNT|MAX|MIN|SUM";
  319. var k_aggfn = k_sql_aggfn;
  320. var k_sql_fn = "CAST|COALESCE|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|EXISTS|DATE_ADD|DATE_DIFF|NULLIF|"
  321. + "SESSION_USER|SUBSTRING|SYSTEM_USER|TRIM";
  322. var k_fn = k_sql_fn;
  323. var keywordMapper = this.createKeywordMapper({
  324. "constant.language.partiql": k_constant,
  325. "keyword.other.partiql": k_keyword,
  326. "storage.type.partiql": k_type,
  327. "support.function.aggregation.partiql": k_aggfn,
  328. "support.function.partiql": k_fn
  329. }, "variable.language.identifier.partiql", true);
  330. var keywordMapperRule = {
  331. token: keywordMapper,
  332. regex: "\\b\\w+\\b"
  333. };
  334. this.$rules = {
  335. "start": [
  336. {
  337. "include": "whitespace"
  338. },
  339. {
  340. "include": "comment"
  341. },
  342. {
  343. "include": "value"
  344. }
  345. ],
  346. "value": [
  347. {
  348. "include": "whitespace"
  349. },
  350. {
  351. "include": "comment"
  352. },
  353. {
  354. "include": "tuple_value"
  355. },
  356. {
  357. "include": "collection_value"
  358. },
  359. {
  360. "include": "scalar_value"
  361. }
  362. ],
  363. "scalar_value": [
  364. {
  365. "include": "string"
  366. },
  367. {
  368. "include": "number"
  369. },
  370. {
  371. "include": "keywords"
  372. },
  373. {
  374. "include": "identifier"
  375. },
  376. {
  377. "include": "embed-ion"
  378. },
  379. {
  380. "include": "operator"
  381. },
  382. {
  383. "include": "punctuation"
  384. }
  385. ],
  386. "punctuation": [
  387. {
  388. "token": "punctuation.partiql",
  389. "regex": "[;:()\\[\\]\\{\\},.]"
  390. }
  391. ],
  392. "operator": [
  393. {
  394. "token": "keyword.operator.partiql",
  395. "regex": "[+*/<>=~!@#%&|?^-]+"
  396. }
  397. ],
  398. "identifier": [
  399. {
  400. "token": "variable.language.identifier.quoted.partiql",
  401. "regex": "([\"])((?:(?:\\\\.)|(?:[^\"\\\\]))*?)([\"])"
  402. },
  403. {
  404. "token": "variable.language.identifier.at.partiql",
  405. "regex": "@\\w+"
  406. },
  407. {
  408. "token": "variable.language.identifier.partiql",
  409. "regex": "\\b\\w+(?:\\.\\w+)?\\b"
  410. }
  411. ],
  412. "number": [
  413. {
  414. "token": "constant.numeric.partiql",
  415. "regex": "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
  416. }
  417. ],
  418. "string": [
  419. {
  420. "token": [
  421. "punctuation.definition.string.begin.partiql",
  422. "string.quoted.single.partiql",
  423. "punctuation.definition.string.end.partiql"
  424. ],
  425. "regex": "(['])((?:(?:\\\\.)|(?:[^'\\\\]))*?)(['])"
  426. }
  427. ],
  428. "collection_value": [
  429. {
  430. "include": "array_value"
  431. },
  432. {
  433. "include": "bag_value"
  434. }
  435. ],
  436. "bag_value": [
  437. {
  438. "token": "punctuation.definition.bag.begin.partiql",
  439. "regex": "<<",
  440. "push": [
  441. {
  442. "token": "punctuation.definition.bag.end.partiql",
  443. "regex": ">>",
  444. "next": "pop"
  445. },
  446. {
  447. "include": "comment"
  448. },
  449. {
  450. "token": "punctuation.definition.bag.separator.partiql",
  451. "regex": ","
  452. },
  453. {
  454. "include": "value"
  455. }
  456. ]
  457. }
  458. ],
  459. "comment": [
  460. {
  461. "token": "comment.line.partiql",
  462. "regex": "--.*"
  463. },
  464. {
  465. "token": "comment.block.partiql",
  466. "regex": "/\\*",
  467. "push": "comment__1"
  468. }
  469. ],
  470. "comment__1": [
  471. {
  472. "token": "comment.block.partiql",
  473. "regex": "[*]/",
  474. "next": "pop"
  475. },
  476. {
  477. "token": "comment.block.partiql",
  478. "regex": "[^*/]+"
  479. },
  480. {
  481. "token": "comment.block.partiql",
  482. "regex": "/\\*",
  483. "push": "comment__1"
  484. },
  485. {
  486. "token": "comment.block.partiql",
  487. "regex": "[*/]+"
  488. }
  489. ],
  490. "array_value": [
  491. {
  492. "token": "punctuation.definition.array.begin.partiql",
  493. "regex": "\\[",
  494. "push": [
  495. {
  496. "token": "punctuation.definition.array.end.partiql",
  497. "regex": "\\]",
  498. "next": "pop"
  499. },
  500. {
  501. "include": "comment"
  502. },
  503. {
  504. "token": "punctuation.definition.array.separator.partiql",
  505. "regex": ","
  506. },
  507. {
  508. "include": "value"
  509. }
  510. ]
  511. }
  512. ],
  513. "tuple_value": [
  514. {
  515. "token": "punctuation.definition.tuple.begin.partiql",
  516. "regex": "\\{",
  517. "push": [
  518. {
  519. "token": "punctuation.definition.tuple.end.partiql",
  520. "regex": "\\}",
  521. "next": "pop"
  522. },
  523. {
  524. "include": "comment"
  525. },
  526. {
  527. "token": "punctuation.definition.tuple.separator.partiql",
  528. "regex": ",|:"
  529. },
  530. {
  531. "include": "value"
  532. }
  533. ]
  534. }
  535. ],
  536. "whitespace": [
  537. {
  538. "token": "text.partiql",
  539. "regex": "\\s+"
  540. }
  541. ]
  542. };
  543. this.$rules["keywords"] = [keywordMapperRule];
  544. this.$rules["embed-ion"] = [{ token: "punctuation.definition.ion.begin.partiql", regex: "`", next: "ion-start" }];
  545. this.embedRules(IonHighlightRules, "ion-", [{ token: "punctuation.definition.ion.end.partiql", regex: "`", next: "start" }]);
  546. this.normalizeRules();
  547. };
  548. oop.inherits(PartiqlHighlightRules, TextHighlightRules);
  549. exports.PartiqlHighlightRules = PartiqlHighlightRules;
  550. });
  551. ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
  552. var Range = require("../range").Range;
  553. var MatchingBraceOutdent = function () { };
  554. (function () {
  555. this.checkOutdent = function (line, input) {
  556. if (!/^\s+$/.test(line))
  557. return false;
  558. return /^\s*\}/.test(input);
  559. };
  560. this.autoOutdent = function (doc, row) {
  561. var line = doc.getLine(row);
  562. var match = line.match(/^(\s*\})/);
  563. if (!match)
  564. return 0;
  565. var column = match[1].length;
  566. var openBracePos = doc.findMatchingBracket({ row: row, column: column });
  567. if (!openBracePos || openBracePos.row == row)
  568. return 0;
  569. var indent = this.$getIndent(doc.getLine(openBracePos.row));
  570. doc.replace(new Range(row, 0, row, column - 1), indent);
  571. };
  572. this.$getIndent = function (line) {
  573. return line.match(/^\s*/)[0];
  574. };
  575. }).call(MatchingBraceOutdent.prototype);
  576. exports.MatchingBraceOutdent = MatchingBraceOutdent;
  577. });
  578. ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
  579. var oop = require("../../lib/oop");
  580. var Range = require("../../range").Range;
  581. var BaseFoldMode = require("./fold_mode").FoldMode;
  582. var FoldMode = exports.FoldMode = function (commentRegex) {
  583. if (commentRegex) {
  584. this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
  585. this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
  586. }
  587. };
  588. oop.inherits(FoldMode, BaseFoldMode);
  589. (function () {
  590. this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
  591. this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
  592. this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
  593. this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
  594. this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
  595. this._getFoldWidgetBase = this.getFoldWidget;
  596. this.getFoldWidget = function (session, foldStyle, row) {
  597. var line = session.getLine(row);
  598. if (this.singleLineBlockCommentRe.test(line)) {
  599. if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
  600. return "";
  601. }
  602. var fw = this._getFoldWidgetBase(session, foldStyle, row);
  603. if (!fw && this.startRegionRe.test(line))
  604. return "start"; // lineCommentRegionStart
  605. return fw;
  606. };
  607. this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
  608. var line = session.getLine(row);
  609. if (this.startRegionRe.test(line))
  610. return this.getCommentRegionBlock(session, line, row);
  611. var match = line.match(this.foldingStartMarker);
  612. if (match) {
  613. var i = match.index;
  614. if (match[1])
  615. return this.openingBracketBlock(session, match[1], row, i);
  616. var range = session.getCommentFoldRange(row, i + match[0].length, 1);
  617. if (range && !range.isMultiLine()) {
  618. if (forceMultiline) {
  619. range = this.getSectionRange(session, row);
  620. }
  621. else if (foldStyle != "all")
  622. range = null;
  623. }
  624. return range;
  625. }
  626. if (foldStyle === "markbegin")
  627. return;
  628. var match = line.match(this.foldingStopMarker);
  629. if (match) {
  630. var i = match.index + match[0].length;
  631. if (match[1])
  632. return this.closingBracketBlock(session, match[1], row, i);
  633. return session.getCommentFoldRange(row, i, -1);
  634. }
  635. };
  636. this.getSectionRange = function (session, row) {
  637. var line = session.getLine(row);
  638. var startIndent = line.search(/\S/);
  639. var startRow = row;
  640. var startColumn = line.length;
  641. row = row + 1;
  642. var endRow = row;
  643. var maxRow = session.getLength();
  644. while (++row < maxRow) {
  645. line = session.getLine(row);
  646. var indent = line.search(/\S/);
  647. if (indent === -1)
  648. continue;
  649. if (startIndent > indent)
  650. break;
  651. var subRange = this.getFoldWidgetRange(session, "all", row);
  652. if (subRange) {
  653. if (subRange.start.row <= startRow) {
  654. break;
  655. }
  656. else if (subRange.isMultiLine()) {
  657. row = subRange.end.row;
  658. }
  659. else if (startIndent == indent) {
  660. break;
  661. }
  662. }
  663. endRow = row;
  664. }
  665. return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
  666. };
  667. this.getCommentRegionBlock = function (session, line, row) {
  668. var startColumn = line.search(/\s*$/);
  669. var maxRow = session.getLength();
  670. var startRow = row;
  671. var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
  672. var depth = 1;
  673. while (++row < maxRow) {
  674. line = session.getLine(row);
  675. var m = re.exec(line);
  676. if (!m)
  677. continue;
  678. if (m[1])
  679. depth--;
  680. else
  681. depth++;
  682. if (!depth)
  683. break;
  684. }
  685. var endRow = row;
  686. if (endRow > startRow) {
  687. return new Range(startRow, startColumn, endRow, line.length);
  688. }
  689. };
  690. }).call(FoldMode.prototype);
  691. });
  692. ace.define("ace/mode/partiql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/partiql_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){/*
  693. THIS FILE WAS GENERATED BY 'ligand' USING 'mode.js'
  694. */
  695. "use strict";
  696. var oop = require("../lib/oop");
  697. var TextMode = require("./text").Mode;
  698. var HighlightRules = require("./partiql_highlight_rules").PartiqlHighlightRules;
  699. var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
  700. var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
  701. var CStyleFoldMode = require("./folding/cstyle").FoldMode;
  702. var Mode = function () {
  703. this.HighlightRules = HighlightRules;
  704. this.$outdent = new MatchingBraceOutdent();
  705. this.$behaviour = new CstyleBehaviour();
  706. this.foldingRules = new CStyleFoldMode();
  707. };
  708. oop.inherits(Mode, TextMode);
  709. (function () {
  710. this.lineCommentStart = "--";
  711. this.blockComment = { start: "/*", end: "*/", nestable: true };
  712. this.getNextLineIndent = function (state, line, tab) {
  713. var indent = this.$getIndent(line);
  714. if (state == "start") {
  715. var match = line.match(/^.*[\{\(\[]\s*$/);
  716. if (match) {
  717. indent += tab;
  718. }
  719. }
  720. return indent;
  721. };
  722. this.checkOutdent = function (state, line, input) {
  723. return this.$outdent.checkOutdent(line, input);
  724. };
  725. this.autoOutdent = function (state, doc, row) {
  726. this.$outdent.autoOutdent(doc, row);
  727. };
  728. this.$id = "ace/mode/partiql";
  729. }).call(Mode.prototype);
  730. exports.Mode = Mode;
  731. }); (function() {
  732. ace.require(["ace/mode/partiql"], function(m) {
  733. if (typeof module == "object" && typeof exports == "object" && module) {
  734. module.exports = m;
  735. }
  736. });
  737. })();