Skip to content

Commit

Permalink
Further rename Stroupstrup to Stroustrup. (#2262)
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed May 16, 2022
1 parent 9703198 commit 24741a3
Show file tree
Hide file tree
Showing 27 changed files with 54 additions and 54 deletions.
44 changes: 22 additions & 22 deletions src/Fantomas.Core.Tests/Fantomas.Core.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,28 +90,28 @@
<Compile Include="SingleExprTests.fs" />
<Compile Include="KeepMaxEmptyLinesTests.fs" />
<Compile Include="IgnoreFileTests.fs" />
<Compile Include="Stroupstrup\SynBindingValueExpressionTests.fs" />
<Compile Include="Stroupstrup\SynBindingFunctionExpressionTests.fs" />
<Compile Include="Stroupstrup\SynBindingFunctionLongPatternExpressionTests.fs" />
<Compile Include="Stroupstrup\SynBindingFunctionWithReturnTypeExpressionTests.fs" />
<Compile Include="Stroupstrup\LetOrUseBangExpressionTests.fs" />
<Compile Include="Stroupstrup\YieldOrReturnExpressionTests.fs" />
<Compile Include="Stroupstrup\YieldOrReturnBangExpressionTests.fs" />
<Compile Include="Stroupstrup\SynExprAndBangExpressionTests.fs" />
<Compile Include="Stroupstrup\LongIdentSetExpressionTests.fs" />
<Compile Include="Stroupstrup\DotIndexedSetExpressionTests.fs" />
<Compile Include="Stroupstrup\SetExpressionTests.fs" />
<Compile Include="Stroupstrup\DotSetExpressionTests.fs" />
<Compile Include="Stroupstrup\LambdaExpressionTests.fs" />
<Compile Include="Stroupstrup\MultiLineLambdaClosingNewlineExpressionTests.fs" />
<Compile Include="Stroupstrup\SynMatchClauseExpressionTests.fs" />
<Compile Include="Stroupstrup\KeepIndentInBranchExpressionTests.fs" />
<Compile Include="Stroupstrup\SynTypeDefnSimpleReprRecordTests.fs" />
<Compile Include="Stroupstrup\SynTypeDefnSigReprSimpleTests.fs" />
<Compile Include="Stroupstrup\NamedArgumentExpressionTests.fs" />
<Compile Include="Stroupstrup\ElmishTests.fs" />
<Compile Include="Stroupstrup\FunctionApplicationSingleListTests.fs" />
<Compile Include="Stroupstrup\FunctionApplicationDualListTests.fs" />
<Compile Include="Stroustrup\SynBindingValueExpressionTests.fs" />
<Compile Include="Stroustrup\SynBindingFunctionExpressionTests.fs" />
<Compile Include="Stroustrup\SynBindingFunctionLongPatternExpressionTests.fs" />
<Compile Include="Stroustrup\SynBindingFunctionWithReturnTypeExpressionTests.fs" />
<Compile Include="Stroustrup\LetOrUseBangExpressionTests.fs" />
<Compile Include="Stroustrup\YieldOrReturnExpressionTests.fs" />
<Compile Include="Stroustrup\YieldOrReturnBangExpressionTests.fs" />
<Compile Include="Stroustrup\SynExprAndBangExpressionTests.fs" />
<Compile Include="Stroustrup\LongIdentSetExpressionTests.fs" />
<Compile Include="Stroustrup\DotIndexedSetExpressionTests.fs" />
<Compile Include="Stroustrup\SetExpressionTests.fs" />
<Compile Include="Stroustrup\DotSetExpressionTests.fs" />
<Compile Include="Stroustrup\LambdaExpressionTests.fs" />
<Compile Include="Stroustrup\MultiLineLambdaClosingNewlineExpressionTests.fs" />
<Compile Include="Stroustrup\SynMatchClauseExpressionTests.fs" />
<Compile Include="Stroustrup\KeepIndentInBranchExpressionTests.fs" />
<Compile Include="Stroustrup\SynTypeDefnSimpleReprRecordTests.fs" />
<Compile Include="Stroustrup\SynTypeDefnSigReprSimpleTests.fs" />
<Compile Include="Stroustrup\NamedArgumentExpressionTests.fs" />
<Compile Include="Stroustrup\ElmishTests.fs" />
<Compile Include="Stroustrup\FunctionApplicationSingleListTests.fs" />
<Compile Include="Stroustrup\FunctionApplicationDualListTests.fs" />
<Compile Include="IdentTests.fs" />
<Compile Include="RecordDeclarationsWithXMLDocTests.fs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ insert_final_newline = false
Assert.IsFalse config.InsertFinalNewline

[<Test>]
let ``Stroupstrup style`` () =
let ``Stroustrup style`` () =
let rootDir = tempName ()

let editorConfig =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.DotIndexedSetExpressionTests
module Fantomas.Core.Tests.Stroustrup.DotIndexedSetExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.DotSetExpressionTests
module Fantomas.Core.Tests.Stroustrup.DotSetExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.FunctionApplicationDualListTests
module Fantomas.Core.Tests.Stroustrup.FunctionApplicationDualListTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.FunctionApplicationSingleListTests
module Fantomas.Core.Tests.Stroustrup.FunctionApplicationSingleListTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.KeepIndentInBranchExpressionTests
module Fantomas.Core.Tests.Stroustrup.KeepIndentInBranchExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.LambdaExpressionTests
module Fantomas.Core.Tests.Stroustrup.LambdaExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.LetOrUseBangExpressionTests
module Fantomas.Core.Tests.Stroustrup.LetOrUseBangExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.LongIdentSetExpressionTests
module Fantomas.Core.Tests.Stroustrup.LongIdentSetExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.MultiLineLambdaClosingNewlineExpressionTests
module Fantomas.Core.Tests.Stroustrup.MultiLineLambdaClosingNewlineExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.NamedArgumentExpressionTests
module Fantomas.Core.Tests.Stroustrup.NamedArgumentExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.SetExpressionTests
module Fantomas.Core.Tests.Stroustrup.SetExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.SynBindingFunctionExpressionTests
module Fantomas.Core.Tests.Stroustrup.SynBindingFunctionExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.SynBindingFunctionLongPatternExpressionTests
module Fantomas.Core.Tests.Stroustrup.SynBindingFunctionLongPatternExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.SynBindingFunctionWithReturnTypeExpressionTests
module Fantomas.Core.Tests.Stroustrup.SynBindingFunctionWithReturnTypeExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.SynBindingValueExpressionTests
module Fantomas.Core.Tests.Stroustrup.SynBindingValueExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.SynExprAndBangExpressionTests
module Fantomas.Core.Tests.Stroustrup.SynExprAndBangExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.SynMatchClauseExpressionTests
module Fantomas.Core.Tests.Stroustrup.SynMatchClauseExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.SynTypeDefnSigReprSimpleTests
module Fantomas.Core.Tests.Stroustrup.SynTypeDefnSigReprSimpleTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.SynTypeDefnSimpleReprRecordTests
module Fantomas.Core.Tests.Stroustrup.SynTypeDefnSimpleReprRecordTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.YieldOrReturnBangExpressionTests
module Fantomas.Core.Tests.Stroustrup.YieldOrReturnBangExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Fantomas.Core.Tests.Stroupstrup.YieldOrReturnExpressionTests
module Fantomas.Core.Tests.Stroustrup.YieldOrReturnExpressionTests

open NUnit.Framework
open FsUnit
Expand Down
6 changes: 3 additions & 3 deletions src/Fantomas.Core/CodePrinter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2032,7 +2032,7 @@ and genExpr astContext synExpr ctx =
+> sepNln
+> (fun ctx ->
let hasMultipleClausesWhereOneHasRagnarok =
hasMultipleClausesWhereOneHasStroupstrup ctx.Config.ExperimentalStroustrupStyle cs
hasMultipleClausesWhereOneHasStroustrup ctx.Config.ExperimentalStroustrupStyle cs

col sepNln cs (genClause astContext true hasMultipleClausesWhereOneHasRagnarok) ctx)
)
Expand Down Expand Up @@ -4612,7 +4612,7 @@ and genClauses astContext cs (ctx: Context) =
col
sepNln
cs
(genClause astContext true (hasMultipleClausesWhereOneHasStroupstrup ctx.Config.ExperimentalStroustrupStyle cs))
(genClause astContext true (hasMultipleClausesWhereOneHasStroustrup ctx.Config.ExperimentalStroustrupStyle cs))
ctx

/// Each multiline member definition has a pre and post new line.
Expand Down Expand Up @@ -5500,7 +5500,7 @@ and genKeepIndentMatch
+> sepNln
+> (fun ctx ->
let hasMultipleClausesWhereOneHasRagnarok =
hasMultipleClausesWhereOneHasStroupstrup ctx.Config.ExperimentalStroustrupStyle clauses
hasMultipleClausesWhereOneHasStroustrup ctx.Config.ExperimentalStroustrupStyle clauses

coli
sepNln
Expand Down
4 changes: 2 additions & 2 deletions src/Fantomas.Core/Context.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ let internal addExtraNewlineIfLeadingWasMultiline leading sepNlnConsideringTrivi

let internal autoIndentAndNlnExpressUnlessRagnarok (f: SynExpr -> Context -> Context) (e: SynExpr) (ctx: Context) =
match e with
| SourceParser.StroupstrupStyleExpr ctx.Config.ExperimentalStroustrupStyle e -> f e ctx
| SourceParser.StroustrupStyleExpr ctx.Config.ExperimentalStroustrupStyle e -> f e ctx
| _ -> (indent +> sepNln +> f e +> unindent) ctx

let internal autoIndentAndNlnIfExpressionExceedsPageWidthUnlessRagnarok
Expand All @@ -1289,7 +1289,7 @@ let internal autoIndentAndNlnIfExpressionExceedsPageWidthUnlessRagnarok
(ctx: Context)
=
match e with
| SourceParser.StroupstrupStyleExpr ctx.Config.ExperimentalStroustrupStyle e -> f e ctx
| SourceParser.StroustrupStyleExpr ctx.Config.ExperimentalStroustrupStyle e -> f e ctx
| _ -> autoIndentAndNlnIfExpressionExceedsPageWidth (f e) ctx

type internal ColMultilineItem =
Expand Down
10 changes: 5 additions & 5 deletions src/Fantomas.Core/SourceParser.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1801,8 +1801,8 @@ let (|KeepIndentIfThenElse|_|) (e: SynExpr) =
None
| _ -> None

let (|StroupstrupStyleExpr|_|) (isStroupstrupStyleEnabled: bool) (e: SynExpr) =
if not isStroupstrupStyleEnabled then
let (|StroustrupStyleExpr|_|) (isStroustrupStyleEnabled: bool) (e: SynExpr) =
if not isStroustrupStyleEnabled then
None
else
match e with
Expand All @@ -1815,12 +1815,12 @@ let (|StroupstrupStyleExpr|_|) (isStroupstrupStyleEnabled: bool) (e: SynExpr) =
| ArrayOrList _ -> Some e
| _ -> None

let hasMultipleClausesWhereOneHasStroupstrup isStroupstrupStyleEnabled (cs: SynMatchClause list) : bool =
isStroupstrupStyleEnabled
let hasMultipleClausesWhereOneHasStroustrup isStroustrupStyleEnabled (cs: SynMatchClause list) : bool =
isStroustrupStyleEnabled
&& List.moreThanOne cs
&& List.exists
(fun (SynMatchClause (resultExpr = e)) ->
match e with
| StroupstrupStyleExpr isStroupstrupStyleEnabled _ -> true
| StroustrupStyleExpr isStroustrupStyleEnabled _ -> true
| _ -> false)
cs

0 comments on commit 24741a3

Please sign in to comment.