35b23ae9af47c42f9442c3071d489fb0.js 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. ace.define("ace/mode/gcode_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 GcodeHighlightRules = function () {
  5. var keywords = ("IF|DO|WHILE|ENDWHILE|CALL|ENDIF|SUB|ENDSUB|GOTO|REPEAT|ENDREPEAT|CALL");
  6. var builtinConstants = ("PI");
  7. var builtinFunctions = ("ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN");
  8. var keywordMapper = this.createKeywordMapper({
  9. "support.function": builtinFunctions,
  10. "keyword": keywords,
  11. "constant.language": builtinConstants
  12. }, "identifier", true);
  13. this.$rules = {
  14. "start": [{
  15. token: "comment",
  16. regex: "\\(.*\\)"
  17. }, {
  18. token: "comment",
  19. regex: "([N])([0-9]+)"
  20. }, {
  21. token: "string",
  22. regex: "([G])([0-9]+\\.?[0-9]?)"
  23. }, {
  24. token: "string",
  25. regex: "([M])([0-9]+\\.?[0-9]?)"
  26. }, {
  27. token: "constant.numeric",
  28. regex: "([-+]?([0-9]*\\.?[0-9]+\\.?))|(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)"
  29. }, {
  30. token: keywordMapper,
  31. regex: "[A-Z]"
  32. }, {
  33. token: "keyword.operator",
  34. regex: "EQ|LT|GT|NE|GE|LE|OR|XOR"
  35. }, {
  36. token: "paren.lparen",
  37. regex: "[\\[]"
  38. }, {
  39. token: "paren.rparen",
  40. regex: "[\\]]"
  41. }, {
  42. token: "text",
  43. regex: "\\s+"
  44. }]
  45. };
  46. };
  47. oop.inherits(GcodeHighlightRules, TextHighlightRules);
  48. exports.GcodeHighlightRules = GcodeHighlightRules;
  49. });
  50. ace.define("ace/mode/gcode",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gcode_highlight_rules","ace/range"], function(require, exports, module){"use strict";
  51. var oop = require("../lib/oop");
  52. var TextMode = require("./text").Mode;
  53. var GcodeHighlightRules = require("./gcode_highlight_rules").GcodeHighlightRules;
  54. var Range = require("../range").Range;
  55. var Mode = function () {
  56. this.HighlightRules = GcodeHighlightRules;
  57. this.$behaviour = this.$defaultBehaviour;
  58. };
  59. oop.inherits(Mode, TextMode);
  60. (function () {
  61. this.$id = "ace/mode/gcode";
  62. }).call(Mode.prototype);
  63. exports.Mode = Mode;
  64. }); (function() {
  65. ace.require(["ace/mode/gcode"], function(m) {
  66. if (typeof module == "object" && typeof exports == "object" && module) {
  67. module.exports = m;
  68. }
  69. });
  70. })();