ionide / ionide-fsgrammar

Shared Textmate Regex Style F# Language Grammar
MIT License
35 stars 36 forks source link

Don't parse `1.` in `1..10` as float #211

Closed brianrourkeboll closed 4 months ago

brianrourkeboll commented 4 months ago
let numbers = [1 .. 10]
let numbers = [1..10]                   // Now parsed correctly.
let numbers = [1 .. 10 .. 100]
let numbers = [1..10..100]              // Now parsed correctly.
let numbers = [1.0 .. 10.0]
let numbers = [1.0..10.0]
let numbers = [1.0 .. 10.0 .. 100.0]
let numbers = [1.0..10.0..100.0]
let numbers = numbers[1 ..]
let numbers = numbers[1..]              // Now parsed correctly.
let numbers = numbers[1 .. 10]
let numbers = numbers[1..10]            // Now parsed correctly.
let numbers = numbers[.. 10]
let numbers = numbers[..10]

Before

GitHub[^1]

image

Visual Studio Code with Ionide

(Font with ligatures)

image

(Font without ligatures)

image

After

Visual Studio Code with Ionide

(Font with ligatures)

image

(Font without ligatures)

image

[^1]: Which uses this grammar.

baronfel commented 4 months ago

I love it - thank you for this change. Do you have an 'after' screenshot that you could drop here for posterity?

brianrourkeboll commented 4 months ago

@baronfel Updated the description.

baronfel commented 4 months ago

Wonderful, thank you! Happy to merge this, and looking forward to shipping it in the next version of Ionide.