ashmind / language-syntax-explanations

📚 Language syntax explanations used by SharpLab

Home Page:https://sharplab.io/#v2:C4LgpgHgDgNghgSwHYBoAmIDUAfAAgBgAJcBGAbgFgAoXAZmICZCBhQgb0M8Oq+PtwAshALIAKZIWTBCcFIXFJgc0vgCUhAEbq2PXl0GEAMqO269hAL5m913lMIRCAXkJowAMzgBXGMEpVzTgR3eQ1JAGdCADc4ACdo1VsuAEhSAE5RKNUyQNzuAK4rAs5rOklFQgAFZwA+Qlp/CyA==

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Numeric literals

svick opened this issue · comments

It would be nice if the syntax of numeric literals could be explained.

I'm talking primarily about features that were added in C# 7.0: binary literals, and digit separators (e.g. 0b0001_0000 uses both).

But older features could be explained too, like hex literals (0xFF), float literals (-1.2e-3), literal suffixes (3M) or even Unicode escapes (\u0066).

I realize that this might not fit well into the current syntax-based system (since those are all lexical features), but I thought it's worth considering anyway.

Thanks, I'll try and see, longer-term SourcePath should be able to match everything anyways.

  • Hex literals
  • Literal suffixes
  • Float literals
  • Binary literals
  • Digit separators
  • Create a ticket for Unicode escapes