mode-ada.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. ace.define("ace/mode/ada_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 AdaHighlightRules = function() {
  6. var keywords = "abort|else|new|return|abs|elsif|not|reverse|abstract|end|null|accept|entry|select|" +
  7. "access|exception|of|separate|aliased|exit|or|some|all|others|subtype|and|for|out|synchronized|" +
  8. "array|function|overriding|at|tagged|generic|package|task|begin|goto|pragma|terminate|" +
  9. "body|private|then|if|procedure|type|case|in|protected|constant|interface|until|" +
  10. "|is|raise|use|declare|range|delay|limited|record|when|delta|loop|rem|while|digits|renames|with|do|mod|requeue|xor";
  11. var builtinConstants = (
  12. "true|false|null"
  13. );
  14. var builtinFunctions = (
  15. "count|min|max|avg|sum|rank|now|coalesce|main"
  16. );
  17. var keywordMapper = this.createKeywordMapper({
  18. "support.function": builtinFunctions,
  19. "keyword": keywords,
  20. "constant.language": builtinConstants
  21. }, "identifier", true);
  22. this.$rules = {
  23. "start" : [ {
  24. token : "comment",
  25. regex : "--.*$"
  26. }, {
  27. token : "string", // " string
  28. regex : '".*?"'
  29. }, {
  30. token : "string", // ' string
  31. regex : "'.*?'"
  32. }, {
  33. token : "constant.numeric", // float
  34. regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
  35. }, {
  36. token : keywordMapper,
  37. regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  38. }, {
  39. token : "keyword.operator",
  40. regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="
  41. }, {
  42. token : "paren.lparen",
  43. regex : "[\\(]"
  44. }, {
  45. token : "paren.rparen",
  46. regex : "[\\)]"
  47. }, {
  48. token : "text",
  49. regex : "\\s+"
  50. } ]
  51. };
  52. };
  53. oop.inherits(AdaHighlightRules, TextHighlightRules);
  54. exports.AdaHighlightRules = AdaHighlightRules;
  55. });
  56. ace.define("ace/mode/ada",[], function(require, exports, module) {
  57. "use strict";
  58. var oop = require("../lib/oop");
  59. var TextMode = require("./text").Mode;
  60. var AdaHighlightRules = require("./ada_highlight_rules").AdaHighlightRules;
  61. var Mode = function() {
  62. this.HighlightRules = AdaHighlightRules;
  63. this.$behaviour = this.$defaultBehaviour;
  64. };
  65. oop.inherits(Mode, TextMode);
  66. (function() {
  67. this.lineCommentStart = "--";
  68. this.$id = "ace/mode/ada";
  69. }).call(Mode.prototype);
  70. exports.Mode = Mode;
  71. });
  72. (function() {
  73. ace.require(["ace/mode/ada"], function(m) {
  74. if (typeof module == "object" && typeof exports == "object" && module) {
  75. module.exports = m;
  76. }
  77. });
  78. })();