Skip to content

Commit d0da8e2

Browse files
committed
Add bin/hex literals
1 parent 50d7dd6 commit d0da8e2

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

Coi.sublime-syntax

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,16 @@ contexts:
816816
scope: constant.language.boolean.true.coi
817817

818818
numbers:
819+
- match: (0[bB])([01]*)
820+
scope: meta.number.integer.binary.coi
821+
captures:
822+
1: constant.numeric.base.coi
823+
2: constant.numeric.value.coi
824+
- match: (0[xX])(\h*)
825+
scope: meta.number.integer.hexadecimal.coi
826+
captures:
827+
1: constant.numeric.base.coi
828+
2: constant.numeric.value.coi
819829
- match: \d+\.\d*
820830
scope: meta.number.float.decimal.coi constant.numeric.value.coi
821831
- match: \d+

tests/syntax_test_scope.coi

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,26 @@
6262
// ^ keyword.operator.arithmetic.coi
6363
// ^^^ meta.number.float.decimal.coi constant.numeric.value.coi
6464

65+
0b 0b0 0b11
66+
// ^^ meta.number.integer.binary.coi constant.numeric.base.coi
67+
// ^^^ meta.number.integer.binary.coi
68+
// ^^ constant.numeric.base.coi
69+
// ^ constant.numeric.value.coi
70+
// ^^^^ meta.number.integer.binary.coi
71+
// ^^ constant.numeric.base.coi
72+
// ^^ constant.numeric.value.coi
73+
74+
0x7f 0x00 0xffff
75+
// ^^^^ meta.number.integer.hexadecimal.coi
76+
// ^^ constant.numeric.base.coi
77+
// ^^ constant.numeric.value.coi
78+
// ^^^^ meta.number.integer.hexadecimal.coi
79+
// ^^ constant.numeric.base.coi
80+
// ^^ constant.numeric.value.coi
81+
// ^^^^^^ meta.number.integer.hexadecimal.coi
82+
// ^^ constant.numeric.base.coi
83+
// ^^^^ constant.numeric.value.coi
84+
6585
// single-line strings
6686

6787
"string \""

0 commit comments

Comments
 (0)