elm-syntax icon indicating copy to clipboard operation
elm-syntax copied to clipboard

v8: don't split `Integer` and `Hex`

Open lue-bird opened this issue 6 months ago • 2 comments

just like string literals which can be constructed using " or """, whole number literals can be constructed using hexadecimal or decimal. v8 introduces an extra variant parameter on the string variant to differentiate the two instead of introducing a new variant. This makes sense since the way these are constructed is usually irrelevant when matching for strings. Not having separate variants makes this easy and prevents the mistake to forget e.g. the """ case.

The same argument applies to hexadecimal vs decimal whole numbers, so I suggest merging the two as

| Integer IntegerBase Int

type IntegerBase
    = Hexadecimal -- alternatives: Base16, Hex
    | Decimal -- alternatives: Base10, Dec

lue-bird avatar Aug 08 '24 15:08 lue-bird