mode-properties.js 2.0 KB

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