Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2b6afdf

Browse files
dsymeKevinRansom
authored andcommitted
[RFC FS-1054] less strict indentation on common DSL pattern (#4929)
* less strict indentation on common DSL pattern* missed one case* missing file* fix test
1 parent4459532 commit2b6afdf

File tree

3 files changed

+81
-2
lines changed

3 files changed

+81
-2
lines changed

‎src/fsharp/LexFilter.fs‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,11 @@ type LexFilterImpl (lightSyntaxStatus:LightSyntaxStatus, compilingFsLib, lexer,
669669
-> unindentationLimitfalse rest
670670

671671
// 'f ...{' places no limit until we hit a CtxtLetDecl etc...
672-
|_,(CtxtParen(LBRACE,_):: CtxtVanilla_:: CtxtSeqBlock_:: rest)
673-
|_,(CtxtSeqBlock_:: CtxtParen(LBRACE,_):: CtxtVanilla_:: CtxtSeqBlock_:: rest)
672+
// 'f ...[' places no limit until we hit a CtxtLetDecl etc...
673+
// 'f ...[|' places no limit until we hit a CtxtLetDecl etc...
674+
|_,(CtxtParen((LBRACE| LBRACK| LBRACK_BAR),_):: CtxtSeqBlock_:: rest)
675+
|_,(CtxtParen((LBRACE| LBRACK| LBRACK_BAR),_):: CtxtVanilla_:: CtxtSeqBlock_:: rest)
676+
|_,(CtxtSeqBlock_:: CtxtParen((LBRACE| LBRACK| LBRACK_BAR),_):: CtxtVanilla_:: CtxtSeqBlock_:: rest)
674677
-> unindentationLimitfalse rest
675678

676679

‎tests/fsharp/tests.fs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,6 +1824,12 @@ module TypecheckTests =
18241824
fsc cfg"%s --target:exe -o:pos29.exe" cfg.fsc_flags["pos29.fsi";"pos29.fs";"pos29.app.fs"]
18251825
peverify cfg"pos29.exe"
18261826

1827+
[<Test>]
1828+
let``sigs pos30``()=
1829+
letcfg= testConfig"typecheck/sigs"
1830+
fsc cfg"%s --target:exe -o:pos30.exe --warnaserror+" cfg.fsc_flags["pos30.fs"]
1831+
peverify cfg"pos30.exe"
1832+
18271833
[<Test>]
18281834
let``sigs pos24``()=
18291835
letcfg= testConfig"typecheck/sigs"
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
modulePos30
2+
3+
moduleTest0=
4+
System.Console.WriteLine(format="{0}", arg=(Array.ofSeq<|seq{
5+
yield box"hello"
6+
}))
7+
8+
moduleTest0b=
9+
System.Console.WriteLine(seq{
10+
yield1
11+
})
12+
13+
moduleTest1=
14+
System.Console.WriteLine(format="{0}", arg=[|
15+
"hello"
16+
|])
17+
System.Console.WriteLine([|
18+
"hello"
19+
|])
20+
21+
moduleTest2=
22+
System.Console.WriteLine(format="{0}", arg= Array.ofList[
23+
"hello"
24+
])
25+
System.Console.WriteLine([
26+
"hello"
27+
])
28+
29+
moduleTest3=
30+
System.Console.WriteLine(format="{0}", arg=[|
31+
|])
32+
System.Console.WriteLine([|
33+
|])
34+
35+
36+
moduleTest4=
37+
System.Console.WriteLine(format="{0}", arg= Array.ofList[
38+
])
39+
System.Console.WriteLine([
40+
])
41+
42+
moduleTest5=
43+
System.Console.WriteLine(format="{0}", arg=[|
44+
yield box"hello"
45+
yield box"hello"
46+
yield box"hello"
47+
yield box"hello"
48+
|])
49+
50+
moduleTest6=
51+
System.Console.WriteLine(format="{0}", arg= Array.ofList[
52+
yield box"hello"
53+
yield box"hello"
54+
yield box"hello"
55+
yield box"hello"
56+
yield box"hello"
57+
])
58+
59+
60+
moduleTest7=
61+
System.Console.WriteLine[|
62+
yield"hello"
63+
yield"hello"
64+
yield"hello"
65+
yield"hello"
66+
yield"hello"
67+
|]
68+
69+
70+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp