EditorSyntax icon indicating copy to clipboard operation
EditorSyntax copied to clipboard

non-orthodox numbers highlighting

Open vors opened this issue 7 years ago • 2 comments
trafficstars

Environment

  • Editor and Version (VS Code, Atom, Sublime): Sublime
  • Your primary theme: Default (Monokai??)

Issue Description

This is all valid numbers in ps

1.21e+3l
1.21E-3d
2.12e3lmb
3.1415e3lgb
3.1415e3lkb

Screenshots

image

Expected Behavior

Consistency (this is current ST grammar) image

vors avatar May 26 '18 04:05 vors

Looks like I missed some cases when I looked at numeric constants. I'll take another pass.

omniomi avatar May 26 '18 09:05 omniomi

Some more examples,

1Dkb
1.Dkb
1.E12kb
1.1Dkb
1.1E12kb
.1E+12Dkb
1Lkb
1.5Lpb
1.E12Lkb
1.14E12Lkb
.14Ltb
1E12Lkb

I think there are a couple more scenario's included here, such as decimal numbers without a leading digit before the decimal point.

I have these worked out in PR #156, I merged the regex in to 3 primary patterns, integer, hex, and decimal, but did not scope them by their final storage type. I have eliminated the patterns that are not allowed (they haven't implemented binary or allowing underscore separators). I could separate these changes out to a new PR.

image

msftrncs avatar May 15 '19 04:05 msftrncs