Merge branch 'syntaxhighlighting' into rc

This commit is contained in:
thelastWallE 2021-04-15 23:27:03 +02:00
commit 0cc395d3cd
1 changed files with 36 additions and 3 deletions

View File

@ -13,6 +13,8 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
include: "#config_block" include: "#config_block"
}, { }, {
include: "#config_line" include: "#config_line"
}, {
include: "#config_line_display"
}, { }, {
include: "#number" include: "#number"
}, { }, {
@ -126,7 +128,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
}], }],
"#pin": [{ "#pin": [{
token: "support.type", token: "support.type",
regex: /[\^~!]*(?:EXP|ar|analog)\d{1,2}/, regex: /[\^~!]*(?:EXP|ar|analog)\d{1,2}|(?:probe:z_virtual_endstop)/,
caseInsensitive: true caseInsensitive: true
}, { }, {
token: "support.type", token: "support.type",
@ -152,7 +154,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
}], }],
"#config_line": [{ "#config_line": [{
token: ["variable.name", "text"], token: ["variable.name", "text"],
regex: /(?!(gcode))(\w+)(\s*[:=]\s*)/, regex: /(?!(gcode))(\w+)(\s*[:]\s*)/,
push: [{ push: [{
token: "text", token: "text",
regex: /$/, regex: /$/,
@ -181,6 +183,37 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
include: "#single_line_comment" include: "#single_line_comment"
}] }]
}], }],
"#config_line_display": [{
token: ["variable.name", "text"],
regex: /(?!(gcode))(\w+)(\s*[=]\s*)/,
push: [{
token: "text",
regex: /,|$/,
next: "pop"
}, {
include: "#known_thermistor_type"
}, {
include: "#known_extruder_sensor_type"
}, {
include: "#known_control_type"
}, {
include: "#known_display_type"
}, {
include: "#known_kinematics_type"
}, {
include: "#known_algo_type"
}, {
include: "#pin"
}, {
include: "#serial"
}, {
include: "#number"
}, {
include: "#boolean"
}, {
include: "#single_line_comment"
}]
}],
"#gcode_line": [{ "#gcode_line": [{
include: "#gcode_command" include: "#gcode_command"
}, { }, {