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