43e0f7960243cbe628b69f7b857a4f08.js 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. ace.define("ace/mode/vhdl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  2. var oop = require("../lib/oop");
  3. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  4. var VHDLHighlightRules = function () {
  5. var keywords = "access|after|alias|all|architecture|assert|attribute|" +
  6. "begin|block|body|buffer|bus|case|component|configuration|" +
  7. "context|disconnect|downto|else|elsif|end|entity|exit|" +
  8. "file|for|force|function|generate|generic|group|guarded|" +
  9. "if|impure|in|inertial|inout|is|label|library|linkage|" +
  10. "literal|loop|map|new|next|of|on|or|open|others|out|" +
  11. "package|parameter|port|postponed|procedure|process|" +
  12. "protected|pure|range|record|register|reject|release|" +
  13. "report|return|select|severity|shared|signal|subtype|then|" +
  14. "to|transport|type|unaffected|units|until|use|variable|" +
  15. "wait|when|while|with";
  16. var storageType = "bit|bit_vector|boolean|character|integer|line|natural|" +
  17. "positive|real|register|signed|std_logic|" +
  18. "std_logic_vector|string||text|time|unsigned";
  19. var storageModifiers = "array|constant";
  20. var keywordOperators = "abs|and|mod|nand|nor|not|rem|rol|ror|sla|sll|sra" +
  21. "srl|xnor|xor";
  22. var builtinConstants = ("true|false|null");
  23. var keywordMapper = this.createKeywordMapper({
  24. "keyword.operator": keywordOperators,
  25. "keyword": keywords,
  26. "constant.language": builtinConstants,
  27. "storage.modifier": storageModifiers,
  28. "storage.type": storageType
  29. }, "identifier", true);
  30. this.$rules = {
  31. "start": [{
  32. token: "comment",
  33. regex: "--.*$"
  34. }, {
  35. token: "string",
  36. regex: '".*?"'
  37. }, {
  38. token: "string",
  39. regex: "'.*?'"
  40. }, {
  41. token: "constant.numeric",
  42. regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
  43. }, {
  44. token: "keyword",
  45. regex: "\\s*(?:library|package|use)\\b"
  46. }, {
  47. token: keywordMapper,
  48. regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  49. }, {
  50. token: "keyword.operator",
  51. regex: "&|\\*|\\+|\\-|\\/|<|=|>|\\||=>|\\*\\*|:=|\\/=|>=|<=|<>"
  52. }, {
  53. token: "punctuation.operator",
  54. regex: "\\'|\\:|\\,|\\;|\\."
  55. }, {
  56. token: "paren.lparen",
  57. regex: "[[(]"
  58. }, {
  59. token: "paren.rparen",
  60. regex: "[\\])]"
  61. }, {
  62. token: "text",
  63. regex: "\\s+"
  64. }]
  65. };
  66. };
  67. oop.inherits(VHDLHighlightRules, TextHighlightRules);
  68. exports.VHDLHighlightRules = VHDLHighlightRules;
  69. });
  70. ace.define("ace/mode/vhdl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/vhdl_highlight_rules"], function(require, exports, module){"use strict";
  71. var oop = require("../lib/oop");
  72. var TextMode = require("./text").Mode;
  73. var VHDLHighlightRules = require("./vhdl_highlight_rules").VHDLHighlightRules;
  74. var Mode = function () {
  75. this.HighlightRules = VHDLHighlightRules;
  76. this.$behaviour = this.$defaultBehaviour;
  77. };
  78. oop.inherits(Mode, TextMode);
  79. (function () {
  80. this.lineCommentStart = "--";
  81. this.$id = "ace/mode/vhdl";
  82. }).call(Mode.prototype);
  83. exports.Mode = Mode;
  84. }); (function() {
  85. ace.require(["ace/mode/vhdl"], function(m) {
  86. if (typeof module == "object" && typeof exports == "object" && module) {
  87. module.exports = m;
  88. }
  89. });
  90. })();