Skip to content

Commit 30fb09e

Browse files
committed
Updated regex to include octal, hex and binary for syntax highligting
1 parent 83db2f3 commit 30fb09e

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

resources/syntax/cxx.syntax.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ keywords:
2222
color: "#FFDE00" # Yellow
2323

2424
number:
25-
- regex: "\\b\\d+\\b"
25+
- regex: "\\b(0b[01]+|0o[0-7]+|0x[0-9a-fA-F]+|\\d+(\\.\\d+)?)\\b"
2626
color: "#0000FF" # Blue
2727

2828
parenthesis:

resources/syntax/go.syntax.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ keywords:
1010
color: "#E37100" # Orange
1111

1212
number:
13-
- regex: "\\b\\d+\\b"
13+
- regex: "\\b(0b[01]+|0o[0-7]+|0x[0-9a-fA-F]+|\\d+(\\.\\d+)?)\\b"
1414
color: "#0000FF" # Blue

resources/syntax/python.syntax.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ keywords:
2020
color: "#E37100" # Orange
2121

2222
number:
23-
- regex: "\\b\\d+\\b"
23+
- regex: "\\b(0b[01]+|0o[0-7]+|0x[0-9a-fA-F]+|\\d+(\\.\\d+)?)\\b"
2424
color: "#0000FF" # Blue

resources/syntax/tsx.syntax.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ keywords:
1616
color: "#DCDCAA" # Yellow for template literals
1717

1818
number:
19-
- regex: "\\b\\d+(\\.\\d+)?\\b"
19+
- regex: "\\b(0b[01]+|0o[0-7]+|0x[0-9a-fA-F]+|\\d+(\\.\\d+)?)\\b"
2020
color: "#B5CEA8" # Light green
2121

2222
keyword:

0 commit comments

Comments
 (0)