Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Commit

Permalink
csharp: add support for binary literals and _ as separator
Browse files Browse the repository at this point in the history
Note that proper `_` usage is not enforced; this matches vscode behavior.
  • Loading branch information
sandyarmstrong committed Apr 28, 2017
1 parent eb82671 commit b371a81
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/csharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ export var language = <ILanguage> {
[/\$"/, { token: 'string.quote', next: '@interpolatedstring' } ],

// numbers
[/\d*\.\d+([eE][\-+]?\d+)?[fFdD]?/, 'number.float'],
[/0[xX][0-9a-fA-F]+/, 'number.hex'],
[/\d+/, 'number'],
[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/, 'number.float'],
[/0[xX][0-9a-fA-F_]+/, 'number.hex'],
[/0[bB][01_]+/, 'number.hex'], // binary: use same theme style as hex
[/[0-9_]+/, 'number'],

// delimiter: after number because of .\d floats
[/[;,.]/, 'delimiter'],
Expand Down

0 comments on commit b371a81

Please sign in to comment.