mode-properties.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. ace.define("ace/mode/properties_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 PropertiesHighlightRules = function() {
  6. var escapeRe = /\\u[0-9a-fA-F]{4}|\\/;
  7. this.$rules = {
  8. "start" : [
  9. {
  10. token : "comment",
  11. regex : /[!#].*$/
  12. }, {
  13. token : "keyword",
  14. regex : /[=:]$/
  15. }, {
  16. token : "keyword",
  17. regex : /[=:]/,
  18. next : "value"
  19. }, {
  20. token : "constant.language.escape",
  21. regex : escapeRe
  22. }, {
  23. defaultToken: "variable"
  24. }
  25. ],
  26. "value" : [
  27. {
  28. regex : /\\$/,
  29. token : "string",
  30. next : "value"
  31. }, {
  32. regex : /$/,
  33. token : "string",
  34. next : "start"
  35. }, {
  36. token : "constant.language.escape",
  37. regex : escapeRe
  38. }, {
  39. defaultToken: "string"
  40. }
  41. ]
  42. };
  43. };
  44. oop.inherits(PropertiesHighlightRules, TextHighlightRules);
  45. exports.PropertiesHighlightRules = PropertiesHighlightRules;
  46. });
  47. ace.define("ace/mode/properties",[], function(require, exports, module) {
  48. "use strict";
  49. var oop = require("../lib/oop");
  50. var TextMode = require("./text").Mode;
  51. var PropertiesHighlightRules = require("./properties_highlight_rules").PropertiesHighlightRules;
  52. var Mode = function() {
  53. this.HighlightRules = PropertiesHighlightRules;
  54. this.$behaviour = this.$defaultBehaviour;
  55. };
  56. oop.inherits(Mode, TextMode);
  57. (function() {
  58. this.$id = "ace/mode/properties";
  59. }).call(Mode.prototype);
  60. exports.Mode = Mode;
  61. });
  62. (function() {
  63. ace.require(["ace/mode/properties"], function(m) {
  64. if (typeof module == "object" && typeof exports == "object" && module) {
  65. module.exports = m;
  66. }
  67. });
  68. })();