From 7bebaccf2338f7596afc8959303ae621245cab39 Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Tue, 7 Apr 2020 09:53:45 +0900 Subject: [PATCH 1/3] Add dictoinary indexer to visual sample --- spec/visual/samples/fsharp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/visual/samples/fsharp b/spec/visual/samples/fsharp index bf361461ee..8efd352d55 100644 --- a/spec/visual/samples/fsharp +++ b/spec/visual/samples/fsharp @@ -198,3 +198,8 @@ finally traceEndBuild() if !TargetHelper.ExitCode.exitCode <> 0 then exit !TargetHelper.ExitCode.exitCode if Environment.ExitCode <> 0 then exit Environment.ExitCode + +let test = something.Dictionary.["someKey"] + +// syntax highlighting +let number = 123 From bb545cf3ea540c84f08ba09872eb682443ccc649 Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Tue, 7 Apr 2020 09:54:43 +0900 Subject: [PATCH 2/3] Add rule for '[' in :dotted state --- lib/rouge/lexers/fsharp.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/rouge/lexers/fsharp.rb b/lib/rouge/lexers/fsharp.rb index 3cc91a9fb5..8640b6c485 100644 --- a/lib/rouge/lexers/fsharp.rb +++ b/lib/rouge/lexers/fsharp.rb @@ -113,6 +113,7 @@ def self.primitives rule %r/#{upper_id}(?=\s*[.])/, Name::Namespace rule upper_id, Name::Class, :pop! rule id, Name, :pop! + rule %r/\[/, Punctuation, :pop! end end end From 7be91e96e221f94f2a473788b1442a803ab4a5a9 Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Thu, 9 Apr 2020 17:33:56 +0900 Subject: [PATCH 3/3] Update visual sample to test indexes/keys --- spec/visual/samples/fsharp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/visual/samples/fsharp b/spec/visual/samples/fsharp index 8efd352d55..2307f9e12f 100644 --- a/spec/visual/samples/fsharp +++ b/spec/visual/samples/fsharp @@ -199,7 +199,8 @@ finally if !TargetHelper.ExitCode.exitCode <> 0 then exit !TargetHelper.ExitCode.exitCode if Environment.ExitCode <> 0 then exit Environment.ExitCode -let test = something.Dictionary.["someKey"] +let value = array.[0] +let value = dict.Test.["key"] // syntax highlighting let number = 123