mode-ada.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. ace.define("ace/mode/ada_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_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",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ada_highlight_rules"], 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. });