From d266b7d1ba0226ab194996b5b488cca8d76a42ac Mon Sep 17 00:00:00 2001 From: Mike Centola Date: Thu, 10 Nov 2022 17:17:13 -0500 Subject: [PATCH 1/2] Fixed ABC regex [ #53 ] --- syntaxes/gcode.tmLanguage.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/gcode.tmLanguage.json b/syntaxes/gcode.tmLanguage.json index 6e68aac..3d3c797 100644 --- a/syntaxes/gcode.tmLanguage.json +++ b/syntaxes/gcode.tmLanguage.json @@ -171,7 +171,7 @@ "name": "invalid.gcode" }, { - "match": "([aAbBcC])\\s?(\\-*\\d?\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]))", + "match": "([aAbBcC])\\s?(\\-*\\d*\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]))", "name": "constant.character.escape.gcode" } ] From 413b5628bcc9fb7dcdb35facbf1e5d6aa0ac51df Mon Sep 17 00:00:00 2001 From: Mike Centola Date: Thu, 10 Nov 2022 17:17:58 -0500 Subject: [PATCH 2/2] Added case insensitivity to all regexes --- syntaxes/gcode.tmLanguage.json | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/syntaxes/gcode.tmLanguage.json b/syntaxes/gcode.tmLanguage.json index 3d3c797..4ae9b05 100644 --- a/syntaxes/gcode.tmLanguage.json +++ b/syntaxes/gcode.tmLanguage.json @@ -83,19 +83,19 @@ "gcodes": { "patterns": [ { - "match": "[gG](1)?5[4-9](.1)?\\s?(P[0-9]{1,3})?", + "match": "(?i)[G](1)?5[4-9](.1)?\\s?(P[0-9]{1,3})?", "name": "constant.numeric.gcode" }, { - "match": "[gG]1[1-2][0-9]", + "match": "(?i)[G]1[1-2][0-9]", "name": "constant.numeric.gcode" }, { - "match": "[gG]15\\s?(H[0-9]{1,2})?", + "match": "(?i)[G]15\\s?(H[0-9]{1,2})?", "name": "constant.numeric.gcode" }, { - "match": "[gG][0-9]{1,3}(\\.[0-9])?", + "match": "(?i)[G][0-9]{1,3}(\\.[0-9])?", "name": "markup.bold.gcode" } ] @@ -103,7 +103,7 @@ "mcodes": { "patterns": [ { - "match": "[mM][0-9]{1,3}", + "match": "(?i)[M][0-9]{1,3}", "name": "keyword.operator.quantifier.regexp.gcode" } ] @@ -131,11 +131,11 @@ "speedsfeeds": { "patterns": [ { - "match": "([sS])\\s?(\\d+|(?=[#\\[]))", + "match": "(?i)([S])\\s?(\\d+|(?=[#\\[]))", "name": "constant.language.gcode" }, { - "match": "([eEfF])\\s?\\.?(\\d+(\\.\\d*)?|(?=[#\\[]))", + "match": "(?i)([EF])\\s?\\.?(\\d+(\\.\\d*)?|(?=[#\\[]))", "name": "constant.language.gcode" } ] @@ -143,15 +143,15 @@ "prognumbers": { "patterns": [ { - "match": "(^[nN])(\\d+)", + "match": "(?i)(^[N])(\\d+)", "name": "constant.numeric.gcode" }, { - "match": "(^[oO])(\\d+)?", + "match": "(?i)(^[O])(\\d+)?", "name": "string.regexp.gcode" }, { - "match": "([pP])\\s?(\\d?\\.?\\d+\\.?|\\.?(?=[#\\[]))", + "match": "(?i)([P])\\s?(\\d?\\.?\\d+\\.?|\\.?(?=[#\\[]))", "name": "string.regexp.gcode" } ] @@ -159,19 +159,19 @@ "coords": { "patterns": [ { - "match": "([xX])\\s?(\\-?\\d*\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]))", + "match": "(?i)([X])\\s?(\\-?\\d*\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]))", "name": "string.gcode" }, { - "match": "([yY])\\s?(\\-?\\d*\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]))", + "match": "(?i)([Y])\\s?(\\-?\\d*\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]))", "name": "string.gcode" }, { - "match": "([zZ])\\s?(\\-?\\d*\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]))", + "match": "(?i)([Z])\\s?(\\-?\\d*\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]))", "name": "invalid.gcode" }, { - "match": "([aAbBcC])\\s?(\\-*\\d*\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]))", + "match": "(?i)([ABC])\\s?(\\-*\\d*\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]))", "name": "constant.character.escape.gcode" } ] @@ -179,15 +179,15 @@ "tools": { "patterns": [ { - "match": "([dD])\\s?(\\d+(\\.\\d*)?|(?=[#\\[]))", + "match": "(?i)([D])\\s?(\\d+(\\.\\d*)?|(?=[#\\[]))", "name": "constant.character.gcode" }, { - "match": "([hH])\\s?(\\d+(\\.\\d*)?|(?=[#\\[]))", + "match": "(?i)([H])\\s?(\\d+(\\.\\d*)?|(?=[#\\[]))", "name": "constant.character.gcode" }, { - "match": "([tT])\\s?(\\d+(\\.\\d*)?|(?=[#\\[]))", + "match": "(?i)([T])\\s?(\\d+(\\.\\d*)?|(?=[#\\[]))", "name": "constant.character.gcode" } ] @@ -195,15 +195,15 @@ "modifiers": { "patterns": [ { - "match": "([iIjJkK])(\\-?\\d*\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]))", + "match": "(?i)([IJK])(\\-?\\d*\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]))", "name": "constant.character.escape.gcode" }, { - "match": "([qQrR])(\\-?\\d*\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]]))", + "match": "(?i)([QR])(\\-?\\d*\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]]))", "name": "support.constant.math.gcode" }, { - "match": "([uUwW])(\\-?\\d*\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]]))", + "match": "(?i)([UW])(\\-?\\d*\\.?\\d+\\.?|\\-?\\.?(?=[#\\[]]))", "name": "support.constant.math.gcode" } ]