tokens_pgsql.json 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  1. [[
  2. "start"
  3. ],[
  4. "start",
  5. ["keyword.statementBegin","BEGIN"],
  6. ["statementEnd",";"]
  7. ],[
  8. "start"
  9. ],[
  10. "doc-start",
  11. ["comment.doc","/**"]
  12. ],[
  13. "doc-start",
  14. ["comment.doc","* Samples from PostgreSQL src/tutorial/basics.source"]
  15. ],[
  16. "start",
  17. ["comment.doc","*/"]
  18. ],[
  19. "statement",
  20. ["keyword.statementBegin","CREATE"],
  21. ["text"," "],
  22. ["keyword","TABLE"],
  23. ["text"," "],
  24. ["identifier","weather"],
  25. ["text"," "],
  26. ["paren.lparen","("]
  27. ],[
  28. "statement",
  29. ["text","\t"],
  30. ["identifier","city"],
  31. ["text","\t\t"],
  32. ["keyword","varchar"],
  33. ["paren.lparen","("],
  34. ["constant.numeric","80"],
  35. ["paren.rparen",")"],
  36. ["text",","]
  37. ],[
  38. "statement",
  39. ["text","\t"],
  40. ["identifier","temp_lo"],
  41. ["text","\t\t"],
  42. ["keyword","int"],
  43. ["text",",\t\t"],
  44. ["comment","-- low temperature"]
  45. ],[
  46. "statement",
  47. ["text","\t"],
  48. ["identifier","temp_hi"],
  49. ["text","\t\t"],
  50. ["keyword","int"],
  51. ["text",",\t\t"],
  52. ["comment","-- high temperature"]
  53. ],[
  54. "statement",
  55. ["text","\t"],
  56. ["identifier","prcp"],
  57. ["text","\t\t"],
  58. ["keyword","real"],
  59. ["text",",\t\t"],
  60. ["comment","-- precipitation"]
  61. ],[
  62. "statement",
  63. ["text","\t"],
  64. ["variable.language","\"date\""],
  65. ["text","\t\t"],
  66. ["keyword","date"]
  67. ],[
  68. "start",
  69. ["paren.rparen",")"],
  70. ["statementEnd",";"]
  71. ],[
  72. "start"
  73. ],[
  74. "statement",
  75. ["keyword.statementBegin","CREATE"],
  76. ["text"," "],
  77. ["keyword","TABLE"],
  78. ["text"," "],
  79. ["identifier","cities"],
  80. ["text"," "],
  81. ["paren.lparen","("]
  82. ],[
  83. "statement",
  84. ["text","\t"],
  85. ["keyword","name"],
  86. ["text","\t\t"],
  87. ["keyword","varchar"],
  88. ["paren.lparen","("],
  89. ["constant.numeric","80"],
  90. ["paren.rparen",")"],
  91. ["text",","]
  92. ],[
  93. "statement",
  94. ["text","\t"],
  95. ["keyword","location"],
  96. ["text","\t"],
  97. ["keyword","point"]
  98. ],[
  99. "start",
  100. ["paren.rparen",")"],
  101. ["statementEnd",";"]
  102. ],[
  103. "start"
  104. ],[
  105. "start"
  106. ],[
  107. "statement",
  108. ["keyword.statementBegin","INSERT"],
  109. ["text"," "],
  110. ["keyword","INTO"],
  111. ["text"," "],
  112. ["identifier","weather"]
  113. ],[
  114. "start",
  115. ["text"," "],
  116. ["keyword","VALUES"],
  117. ["text"," "],
  118. ["paren.lparen","("],
  119. ["string","'San Francisco'"],
  120. ["text",", "],
  121. ["constant.numeric","46"],
  122. ["text",", "],
  123. ["constant.numeric","50"],
  124. ["text",", "],
  125. ["constant.numeric","0.25"],
  126. ["text",", "],
  127. ["string","'1994-11-27'"],
  128. ["paren.rparen",")"],
  129. ["statementEnd",";"]
  130. ],[
  131. "start"
  132. ],[
  133. "statement",
  134. ["keyword.statementBegin","INSERT"],
  135. ["text"," "],
  136. ["keyword","INTO"],
  137. ["text"," "],
  138. ["identifier","cities"]
  139. ],[
  140. "start",
  141. ["text"," "],
  142. ["keyword","VALUES"],
  143. ["text"," "],
  144. ["paren.lparen","("],
  145. ["string","'San Francisco'"],
  146. ["text",", "],
  147. ["string","'(-194.0, 53.0)'"],
  148. ["paren.rparen",")"],
  149. ["statementEnd",";"]
  150. ],[
  151. "start"
  152. ],[
  153. "statement",
  154. ["keyword.statementBegin","INSERT"],
  155. ["text"," "],
  156. ["keyword","INTO"],
  157. ["text"," "],
  158. ["identifier","weather"],
  159. ["text"," "],
  160. ["paren.lparen","("],
  161. ["identifier","city"],
  162. ["text",", "],
  163. ["identifier","temp_lo"],
  164. ["text",", "],
  165. ["identifier","temp_hi"],
  166. ["text",", "],
  167. ["identifier","prcp"],
  168. ["text",", "],
  169. ["variable.language","\"date\""],
  170. ["paren.rparen",")"]
  171. ],[
  172. "start",
  173. ["text"," "],
  174. ["keyword","VALUES"],
  175. ["text"," "],
  176. ["paren.lparen","("],
  177. ["string","'San Francisco'"],
  178. ["text",", "],
  179. ["constant.numeric","43"],
  180. ["text",", "],
  181. ["constant.numeric","57"],
  182. ["text",", "],
  183. ["constant.numeric","0.0"],
  184. ["text",", "],
  185. ["string","'1994-11-29'"],
  186. ["paren.rparen",")"],
  187. ["statementEnd",";"]
  188. ],[
  189. "start"
  190. ],[
  191. "statement",
  192. ["keyword.statementBegin","INSERT"],
  193. ["text"," "],
  194. ["keyword","INTO"],
  195. ["text"," "],
  196. ["identifier","weather"],
  197. ["text"," "],
  198. ["paren.lparen","("],
  199. ["keyword","date"],
  200. ["text",", "],
  201. ["identifier","city"],
  202. ["text",", "],
  203. ["identifier","temp_hi"],
  204. ["text",", "],
  205. ["identifier","temp_lo"],
  206. ["paren.rparen",")"]
  207. ],[
  208. "start",
  209. ["text"," "],
  210. ["keyword","VALUES"],
  211. ["text"," "],
  212. ["paren.lparen","("],
  213. ["string","'1994-11-29'"],
  214. ["text",", "],
  215. ["string","'Hayward'"],
  216. ["text",", "],
  217. ["constant.numeric","54"],
  218. ["text",", "],
  219. ["constant.numeric","37"],
  220. ["paren.rparen",")"],
  221. ["statementEnd",";"]
  222. ],[
  223. "start"
  224. ],[
  225. "start"
  226. ],[
  227. "start",
  228. ["keyword.statementBegin","SELECT"],
  229. ["text"," "],
  230. ["identifier","city"],
  231. ["text",", "],
  232. ["paren.lparen","("],
  233. ["identifier","temp_hi"],
  234. ["keyword.operator","+"],
  235. ["identifier","temp_lo"],
  236. ["paren.rparen",")"],
  237. ["keyword.operator","/"],
  238. ["constant.numeric","2"],
  239. ["text"," "],
  240. ["keyword","AS"],
  241. ["text"," "],
  242. ["identifier","temp_avg"],
  243. ["text",", "],
  244. ["variable.language","\"date\""],
  245. ["text"," "],
  246. ["keyword","FROM"],
  247. ["text"," "],
  248. ["identifier","weather"],
  249. ["statementEnd",";"]
  250. ],[
  251. "start"
  252. ],[
  253. "statement",
  254. ["keyword.statementBegin","SELECT"],
  255. ["text"," "],
  256. ["identifier","city"],
  257. ["text",", "],
  258. ["identifier","temp_lo"],
  259. ["text",", "],
  260. ["identifier","temp_hi"],
  261. ["text",", "],
  262. ["identifier","prcp"],
  263. ["text",", "],
  264. ["variable.language","\"date\""],
  265. ["text",", "],
  266. ["keyword","location"]
  267. ],[
  268. "statement",
  269. ["text"," "],
  270. ["keyword","FROM"],
  271. ["text"," "],
  272. ["identifier","weather"],
  273. ["text",", "],
  274. ["identifier","cities"]
  275. ],[
  276. "start",
  277. ["text"," "],
  278. ["keyword","WHERE"],
  279. ["text"," "],
  280. ["identifier","city"],
  281. ["text"," "],
  282. ["keyword.operator","="],
  283. ["text"," "],
  284. ["keyword","name"],
  285. ["statementEnd",";"]
  286. ],[
  287. "start"
  288. ],[
  289. "start"
  290. ],[
  291. "start"
  292. ],[
  293. "doc-start",
  294. ["comment.doc","/**"]
  295. ],[
  296. "doc-start",
  297. ["comment.doc","* Dollar quotes starting at the end of the line are colored as SQL unless"]
  298. ],[
  299. "doc-start",
  300. ["comment.doc","* a special language tag is used. Pearl and Python are currently implemented"]
  301. ],[
  302. "doc-start",
  303. ["comment.doc","* but lots of others are possible."]
  304. ],[
  305. "start",
  306. ["comment.doc","*/"]
  307. ],[
  308. "statement",
  309. ["keyword.statementBegin","create"],
  310. ["text"," "],
  311. ["keyword","or"],
  312. ["text"," "],
  313. ["keyword","replace"],
  314. ["text"," "],
  315. ["keyword","function"],
  316. ["text"," "],
  317. ["identifier","blob_content_chunked"],
  318. ["paren.lparen","("]
  319. ],[
  320. "statement",
  321. ["text"," "],
  322. ["keyword","in"],
  323. ["text"," "],
  324. ["identifier","p_data"],
  325. ["text"," "],
  326. ["keyword","bytea"],
  327. ["text",", "]
  328. ],[
  329. "statement",
  330. ["text"," "],
  331. ["keyword","in"],
  332. ["text"," "],
  333. ["identifier","p_chunk"],
  334. ["text"," "],
  335. ["keyword","integer"],
  336. ["paren.rparen",")"]
  337. ],[
  338. "dollarSql",
  339. ["keyword","returns"],
  340. ["text"," "],
  341. ["keyword","setof"],
  342. ["text"," "],
  343. ["keyword","bytea"],
  344. ["text"," "],
  345. ["keyword","as"],
  346. ["text"," "],
  347. ["string","$$"]
  348. ],[
  349. "dollarSql",
  350. ["comment","-- Still SQL comments"]
  351. ],[
  352. "dollarSql",
  353. ["keyword","declare"]
  354. ],[
  355. "dollarSql",
  356. ["text","\t"],
  357. ["identifier","v_size"],
  358. ["text"," "],
  359. ["keyword","integer"],
  360. ["text"," "],
  361. ["keyword.operator","="],
  362. ["text"," "],
  363. ["support.function","octet_length"],
  364. ["paren.lparen","("],
  365. ["identifier","p_data"],
  366. ["paren.rparen",")"],
  367. ["text",";"]
  368. ],[
  369. "dollarSql",
  370. ["keyword","begin"]
  371. ],[
  372. "dollarSql",
  373. ["text","\t"],
  374. ["keyword","for"],
  375. ["text"," "],
  376. ["identifier","i"],
  377. ["text"," "],
  378. ["keyword","in"],
  379. ["text"," "],
  380. ["constant.numeric","1"],
  381. ["text",".."],
  382. ["identifier","v_size"],
  383. ["text"," "],
  384. ["keyword","by"],
  385. ["text"," "],
  386. ["identifier","p_chunk"],
  387. ["text"," "],
  388. ["identifier","loop"]
  389. ],[
  390. "dollarSql",
  391. ["text","\t\t"],
  392. ["identifier","return"],
  393. ["text"," "],
  394. ["keyword","next"],
  395. ["text"," "],
  396. ["keyword","substring"],
  397. ["paren.lparen","("],
  398. ["identifier","p_data"],
  399. ["text"," "],
  400. ["keyword","from"],
  401. ["text"," "],
  402. ["identifier","i"],
  403. ["text"," "],
  404. ["keyword","for"],
  405. ["text"," "],
  406. ["identifier","p_chunk"],
  407. ["paren.rparen",")"],
  408. ["text",";"]
  409. ],[
  410. "dollarSql",
  411. ["text","\t"],
  412. ["keyword","end"],
  413. ["text"," "],
  414. ["identifier","loop"],
  415. ["text",";"]
  416. ],[
  417. "dollarSql",
  418. ["keyword","end"],
  419. ["text",";"]
  420. ],[
  421. "start",
  422. ["string","$$"],
  423. ["text"," "],
  424. ["keyword","language"],
  425. ["text"," "],
  426. ["identifier","plpgsql"],
  427. ["text"," "],
  428. ["keyword","stable"],
  429. ["statementEnd",";"]
  430. ],[
  431. "start"
  432. ],[
  433. "start"
  434. ],[
  435. "start",
  436. ["comment","-- pl/perl"]
  437. ],[
  438. "perl-start",
  439. ["keyword.statementBegin","CREATE"],
  440. ["text"," "],
  441. ["keyword","FUNCTION"],
  442. ["text"," "],
  443. ["identifier","perl_max"],
  444. ["text"," "],
  445. ["paren.lparen","("],
  446. ["keyword","integer"],
  447. ["text",", "],
  448. ["keyword","integer"],
  449. ["paren.rparen",")"],
  450. ["text"," "],
  451. ["keyword","RETURNS"],
  452. ["text"," "],
  453. ["keyword","integer"],
  454. ["text"," "],
  455. ["keyword","AS"],
  456. ["text"," "],
  457. ["string","$perl$"]
  458. ],[
  459. "perl-start",
  460. ["text"," "],
  461. ["comment","# perl comment..."]
  462. ],[
  463. "perl-start",
  464. ["text"," "],
  465. ["keyword","my"],
  466. ["text"," "],
  467. ["lparen","("],
  468. ["identifier","$x"],
  469. ["keyword.operator",","],
  470. ["identifier","$y"],
  471. ["rparen",")"],
  472. ["text"," "],
  473. ["keyword.operator","="],
  474. ["text"," @"],
  475. ["identifier","_"],
  476. ["text",";"]
  477. ],[
  478. "perl-start",
  479. ["text"," "],
  480. ["keyword","if"],
  481. ["text"," "],
  482. ["lparen","("],
  483. ["keyword.operator","!"],
  484. ["text"," "],
  485. ["support.function","defined"],
  486. ["text"," "],
  487. ["identifier","$x"],
  488. ["rparen",")"],
  489. ["text"," "],
  490. ["lparen","{"]
  491. ],[
  492. "perl-start",
  493. ["text"," "],
  494. ["keyword","if"],
  495. ["text"," "],
  496. ["lparen","("],
  497. ["keyword.operator","!"],
  498. ["text"," "],
  499. ["support.function","defined"],
  500. ["text"," "],
  501. ["identifier","$y"],
  502. ["rparen",")"],
  503. ["text"," "],
  504. ["lparen","{"],
  505. ["text"," "],
  506. ["support.function","return"],
  507. ["text"," "],
  508. ["support.function","undef"],
  509. ["text","; "],
  510. ["rparen","}"]
  511. ],[
  512. "perl-start",
  513. ["text"," "],
  514. ["support.function","return"],
  515. ["text"," "],
  516. ["identifier","$y"],
  517. ["text",";"]
  518. ],[
  519. "perl-start",
  520. ["text"," "],
  521. ["rparen","}"]
  522. ],[
  523. "perl-start",
  524. ["text"," "],
  525. ["keyword","if"],
  526. ["text"," "],
  527. ["lparen","("],
  528. ["keyword.operator","!"],
  529. ["text"," "],
  530. ["support.function","defined"],
  531. ["text"," "],
  532. ["identifier","$y"],
  533. ["rparen",")"],
  534. ["text"," "],
  535. ["lparen","{"],
  536. ["text"," "],
  537. ["support.function","return"],
  538. ["text"," "],
  539. ["identifier","$x"],
  540. ["text","; "],
  541. ["rparen","}"]
  542. ],[
  543. "perl-start",
  544. ["text"," "],
  545. ["keyword","if"],
  546. ["text"," "],
  547. ["lparen","("],
  548. ["identifier","$x"],
  549. ["text"," "],
  550. ["keyword.operator",">"],
  551. ["text"," "],
  552. ["identifier","$y"],
  553. ["rparen",")"],
  554. ["text"," "],
  555. ["lparen","{"],
  556. ["text"," "],
  557. ["support.function","return"],
  558. ["text"," "],
  559. ["identifier","$x"],
  560. ["text","; "],
  561. ["rparen","}"]
  562. ],[
  563. "perl-start",
  564. ["text"," "],
  565. ["support.function","return"],
  566. ["text"," "],
  567. ["identifier","$y"],
  568. ["text",";"]
  569. ],[
  570. "start",
  571. ["string","$perl$"],
  572. ["text"," "],
  573. ["keyword","LANGUAGE"],
  574. ["text"," "],
  575. ["identifier","plperl"],
  576. ["statementEnd",";"]
  577. ],[
  578. "start"
  579. ],[
  580. "start",
  581. ["comment","-- pl/python"]
  582. ],[
  583. "python-start",
  584. ["keyword.statementBegin","CREATE"],
  585. ["text"," "],
  586. ["keyword","FUNCTION"],
  587. ["text"," "],
  588. ["identifier","usesavedplan"],
  589. ["paren.lparen","("],
  590. ["paren.rparen",")"],
  591. ["text"," "],
  592. ["keyword","RETURNS"],
  593. ["text"," "],
  594. ["keyword","trigger"],
  595. ["text"," "],
  596. ["keyword","AS"],
  597. ["text"," "],
  598. ["string","$python$"]
  599. ],[
  600. "python-start",
  601. ["text"," "],
  602. ["comment","# python comment..."]
  603. ],[
  604. "python-start",
  605. ["text"," "],
  606. ["keyword","if"],
  607. ["text"," "],
  608. ["identifier","SD"],
  609. ["text","."],
  610. ["identifier","has_key"],
  611. ["paren.lparen","("],
  612. ["string","\"plan\""],
  613. ["paren.rparen",")"],
  614. ["text",":"]
  615. ],[
  616. "python-start",
  617. ["text"," "],
  618. ["identifier","plan"],
  619. ["text"," "],
  620. ["keyword.operator","="],
  621. ["text"," "],
  622. ["identifier","SD"],
  623. ["paren.lparen","["],
  624. ["string","\"plan\""],
  625. ["paren.rparen","]"]
  626. ],[
  627. "python-start",
  628. ["text"," "],
  629. ["keyword","else"],
  630. ["text",":"]
  631. ],[
  632. "python-start",
  633. ["text"," "],
  634. ["identifier","plan"],
  635. ["text"," "],
  636. ["keyword.operator","="],
  637. ["text"," "],
  638. ["identifier","plpy"],
  639. ["text","."],
  640. ["identifier","prepare"],
  641. ["paren.lparen","("],
  642. ["string","\"SELECT 1\""],
  643. ["paren.rparen",")"]
  644. ],[
  645. "python-start",
  646. ["text"," "],
  647. ["identifier","SD"],
  648. ["paren.lparen","["],
  649. ["string","\"plan\""],
  650. ["paren.rparen","]"],
  651. ["text"," "],
  652. ["keyword.operator","="],
  653. ["text"," "],
  654. ["identifier","plan"]
  655. ],[
  656. "start",
  657. ["string","$python$"],
  658. ["text"," "],
  659. ["keyword","LANGUAGE"],
  660. ["text"," "],
  661. ["identifier","plpythonu"],
  662. ["statementEnd",";"]
  663. ],[
  664. "start"
  665. ],[
  666. "start"
  667. ],[
  668. "start",
  669. ["comment","-- psql commands"]
  670. ],[
  671. "start",
  672. ["support.buildin","\\df cash*"]
  673. ],[
  674. "start"
  675. ],[
  676. "start"
  677. ],[
  678. "start",
  679. ["comment","-- Some string samples."]
  680. ],[
  681. "start",
  682. ["keyword.statementBegin","select"],
  683. ["text"," "],
  684. ["string","'don''t do it now;'"],
  685. ["text"," "],
  686. ["keyword.operator","||"],
  687. ["text"," "],
  688. ["string","'maybe later'"],
  689. ["statementEnd",";"]
  690. ],[
  691. "start",
  692. ["keyword.statementBegin","select"],
  693. ["text"," "],
  694. ["identifier","E"],
  695. ["string","'dont\\'t do it'"],
  696. ["statementEnd",";"]
  697. ],[
  698. "start",
  699. ["keyword.statementBegin","select"],
  700. ["text"," "],
  701. ["support.function","length"],
  702. ["paren.lparen","("],
  703. ["string","'some other''s stuff'"],
  704. ["text"," "],
  705. ["keyword.operator","||"],
  706. ["text"," "],
  707. ["string","$$cat in hat's stuff $$"],
  708. ["paren.rparen",")"],
  709. ["statementEnd",";"]
  710. ],[
  711. "start"
  712. ],[
  713. "dollarStatementString",
  714. ["keyword.statementBegin","select"],
  715. ["text"," "],
  716. ["string","$$ strings"]
  717. ],[
  718. "dollarStatementString",
  719. ["string","over multiple "]
  720. ],[
  721. "dollarStatementString",
  722. ["string","lines - use dollar quotes"]
  723. ],[
  724. "start",
  725. ["string","$$"],
  726. ["statementEnd",";"]
  727. ],[
  728. "start"
  729. ],[
  730. "start",
  731. ["keyword.statementBegin","END"],
  732. ["statementEnd",";"]
  733. ],[
  734. "start"
  735. ]]