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

Commitbc2e8c9

Browse files
authored
Remove ocaml and F# Comment if defs (dotnet#2530)
* Remove comment ifdefs* 'fix* Last test case update'
1 parentfe2002b commitbc2e8c9

File tree

11 files changed

+3
-86
lines changed

11 files changed

+3
-86
lines changed

‎src/fsharp/FSComp.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,6 @@ csSeeAvailableOverloads,"The available overloads are shown below (or in the Erro
365365
516,parsEofInComment,"End of file in comment begun at or before here"
366366
517,parsEofInStringInComment,"End of file in string embedded in comment begun at or before here"
367367
518,parsEofInVerbatimStringInComment,"End of file in verbatim string embedded in comment begun at or before here"
368-
519,parsEofInIfOcaml,"End of file in IF-OCAML section begun at or before here"
369368
520,parsEofInDirective,"End of file in directive begun at or before here"
370369
521,parsNoHashEndIfFound,"No #endif found for #if or #else"
371370
522,parsAttributesIgnored,"Attributes have been ignored in this construct"

‎src/fsharp/ast.fs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2119,7 +2119,6 @@ type LexerWhitespaceContinuation =
21192119
| StringInCommentofifdef:LexerIfdefStackEntries*int*range:range
21202120
| VerbatimStringInCommentofifdef:LexerIfdefStackEntries*int*range:range
21212121
| TripleQuoteStringInCommentofifdef:LexerIfdefStackEntries*int*range:range
2122-
| MLOnlyofifdef:LexerIfdefStackEntries*range:range
21232122
| EndLineofLexerEndlineContinuation
21242123

21252124
memberx.LexerIfdefStack=
@@ -2133,8 +2132,7 @@ type LexerWhitespaceContinuation =
21332132
| LexCont.TripleQuoteString(ifdef=ifd)
21342133
| LexCont.StringInComment(ifdef=ifd)
21352134
| LexCont.VerbatimStringInComment(ifdef=ifd)
2136-
| LexCont.TripleQuoteStringInComment(ifdef=ifd)
2137-
| LexCont.MLOnly(ifdef=ifd)-> ifd
2135+
| LexCont.TripleQuoteStringInComment(ifdef=ifd)-> ifd
21382136
| LexCont.EndLine endl-> endl.LexerIfdefStack
21392137

21402138
andLexCont= LexerWhitespaceContinuation

‎src/fsharp/lex.fsl‎

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -416,14 +416,6 @@ rule token args skip = parse
416416
{ match unicodeGraphLong (lexemeTrimBoth lexbuf 3 1) with
417417
| SingleChar(c) -> CHAR (char c)
418418
| _ -> fail args lexbuf (FSComp.SR.lexThisUnicodeOnlyInStringLiterals()) (CHAR (char 0)) }
419-
| "(*IF-FSHARP"
420-
{ if not skip then (COMMENT (LexCont.Token !args.ifdefStack)) else token args skip lexbuf }
421-
| "(*F#"
422-
{ if not skip then (COMMENT (LexCont.Token !args.ifdefStack)) else token args skip lexbuf }
423-
| "ENDIF-FSHARP*)"
424-
{ if not skip then (COMMENT (LexCont.Token !args.ifdefStack)) else token args skip lexbuf }
425-
| "F#*)"
426-
{ if not skip then (COMMENT (LexCont.Token !args.ifdefStack)) else token args skip lexbuf }
427419

428420
| "(*)"
429421
{ LPAREN_STAR_RPAREN }
@@ -432,10 +424,6 @@ rule token args skip = parse
432424
{ let m = lexbuf.LexemeRange
433425
if not skip then (COMMENT (LexCont.Comment(!args.ifdefStack,1,m))) else comment (1,m,args) skip lexbuf }
434426

435-
| "(*IF-CAML*)" | "(*IF-OCAML*)"
436-
{ let m = lexbuf.LexemeRange
437-
if not skip then (COMMENT (LexCont.MLOnly(!args.ifdefStack,m))) else mlOnly m args skip lexbuf }
438-
439427
| '"'
440428
{ let buf,fin,m = startString args lexbuf
441429
if not skip then (STRING_TEXT (LexCont.String(!args.ifdefStack,m))) else string (buf,fin,m,args) skip lexbuf }
@@ -1050,24 +1038,3 @@ and tripleQuoteStringInComment n m args skip = parse
10501038
| surrogateChar surrogateChar
10511039
| _
10521040
{ if not skip then (COMMENT (LexCont.TripleQuoteStringInComment(!args.ifdefStack,n,m))) else tripleQuoteStringInComment n m args skip lexbuf }
1053-
1054-
1055-
and mlOnly m args skip = parse
1056-
| "\""
1057-
{ let buf = ByteBuffer.Create 100
1058-
let m2 = lexbuf.LexemeRange
1059-
let _ = string (buf,defaultStringFinisher,m2,args) skip lexbuf
1060-
if not skip then (COMMENT (LexCont.MLOnly(!args.ifdefStack,m))) else mlOnly m args skip lexbuf }
1061-
| newline
1062-
{ newline lexbuf; if not skip then (COMMENT (LexCont.MLOnly(!args.ifdefStack,m))) else mlOnly m args skip lexbuf }
1063-
| "(*ENDIF-CAML*)"
1064-
{ if not skip then (COMMENT (LexCont.Token !args.ifdefStack)) else token args skip lexbuf }
1065-
| "(*ENDIF-OCAML*)"
1066-
{ if not skip then (COMMENT (LexCont.Token !args.ifdefStack)) else token args skip lexbuf }
1067-
| [^ '(' '"' '\n' '\r' ]+
1068-
{ if not skip then (COMMENT (LexCont.MLOnly(!args.ifdefStack,m))) else mlOnly m args skip lexbuf }
1069-
| eof
1070-
{ EOF (LexCont.MLOnly(!args.ifdefStack,m)) }
1071-
| surrogateChar surrogateChar
1072-
| _
1073-
{ if not skip then (COMMENT (LexCont.MLOnly(!args.ifdefStack,m))) else mlOnly m args skip lexbuf }

‎src/fsharp/pars.fsy‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ let checkEndOfFileError t =
9494
| LexCont.StringInComment (_,_,m) -> reportParseErrorAt m (FSComp.SR.parsEofInStringInComment())
9595
| LexCont.VerbatimStringInComment (_,_,m) -> reportParseErrorAt m (FSComp.SR.parsEofInVerbatimStringInComment())
9696
| LexCont.TripleQuoteStringInComment (_,_,m) -> reportParseErrorAt m (FSComp.SR.parsEofInTripleQuoteStringInComment())
97-
| LexCont.MLOnly (_,m) -> reportParseErrorAt m (FSComp.SR.parsEofInIfOcaml())
9897
| LexCont.EndLine(LexerEndlineContinuation.Skip(_,_,m)) -> reportParseErrorAt m (FSComp.SR.parsEofInDirective())
9998
| LexCont.EndLine(LexerEndlineContinuation.Token(stack))
10099
| LexCont.Token(stack) ->

‎src/fsharp/vs/ServiceLexing.fs‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ type FSharpTokenizerColorState =
304304
| Comment=5
305305
| StringInComment=6
306306
| VerbatimStringInComment=7
307-
| CamlOnly=8
308307
| VerbatimString=9
309308
| SingleLineComment=10
310309
| EndLineThenSkip=11
@@ -415,7 +414,6 @@ module internal LexerStateEncoding =
415414
| LexCont.StringInComment(ifd,n,m)-> FSharpTokenizerColorState.StringInComment, resize32 n, m.Start, ifd
416415
| LexCont.VerbatimStringInComment(ifd,n,m)-> FSharpTokenizerColorState.VerbatimStringInComment, resize32 n, m.Start, ifd
417416
| LexCont.TripleQuoteStringInComment(ifd,n,m)-> FSharpTokenizerColorState.TripleQuoteStringInComment,resize32 n, m.Start, ifd
418-
| LexCont.MLOnly(ifd,m)-> FSharpTokenizerColorState.CamlOnly,0L, m.Start, ifd
419417
| LexCont.VerbatimString(ifd,m)-> FSharpTokenizerColorState.VerbatimString,0L, m.Start, ifd
420418
| LexCont.TripleQuoteString(ifd,m)-> FSharpTokenizerColorState.TripleQuoteString,0L, m.Start, ifd
421419
encodeLexCont tag n1 p1 ifd lightSyntaxStatus
@@ -433,7 +431,6 @@ module internal LexerStateEncoding =
433431
| FSharpTokenizerColorState.StringInComment-> LexCont.StringInComment(ifd,n1,mkRange"file" p1 p1)
434432
| FSharpTokenizerColorState.VerbatimStringInComment-> LexCont.VerbatimStringInComment(ifd,n1,mkRange"file" p1 p1)
435433
| FSharpTokenizerColorState.TripleQuoteStringInComment-> LexCont.TripleQuoteStringInComment(ifd,n1,mkRange"file" p1 p1)
436-
| FSharpTokenizerColorState.CamlOnly-> LexCont.MLOnly(ifd,mkRange"file" p1 p1)
437434
| FSharpTokenizerColorState.VerbatimString-> LexCont.VerbatimString(ifd,mkRange"file" p1 p1)
438435
| FSharpTokenizerColorState.TripleQuoteString-> LexCont.TripleQuoteString(ifd,mkRange"file" p1 p1)
439436
| FSharpTokenizerColorState.EndLineThenSkip-> LexCont.EndLine(LexerEndlineContinuation.Skip(ifd,n1,mkRange"file" p1 p1))
@@ -459,7 +456,6 @@ module internal LexerStateEncoding =
459456
| LexCont.StringInComment(ifd,n,m)-> Lexer.stringInComment n m(argsWithIfDefs ifd) skip lexbuf
460457
| LexCont.VerbatimStringInComment(ifd,n,m)-> Lexer.verbatimStringInComment n m(argsWithIfDefs ifd) skip lexbuf
461458
| LexCont.TripleQuoteStringInComment(ifd,n,m)-> Lexer.tripleQuoteStringInComment n m(argsWithIfDefs ifd) skip lexbuf
462-
| LexCont.MLOnly(ifd,m)-> Lexer.mlOnly m(argsWithIfDefs ifd) skip lexbuf
463459
| LexCont.VerbatimString(ifd,m)-> Lexer.verbatimString(ByteBuffer.Create100,defaultStringFinisher,m,(argsWithIfDefs ifd)) skip lexbuf
464460
| LexCont.TripleQuoteString(ifd,m)-> Lexer.tripleQuoteString(ByteBuffer.Create100,defaultStringFinisher,m,(argsWithIfDefs ifd)) skip lexbuf
465461

‎src/fsharp/vs/ServiceLexing.fsi‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ type internal FSharpTokenizerColorState =
2929
| Comment=5
3030
| StringInComment=6
3131
| VerbatimStringInComment=7
32-
| CamlOnly=8
3332
| VerbatimString=9
3433
| SingleLineComment=10
3534
| EndLineThenSkip=11

‎tests/fsharp/perf/graph/test.ml‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
// #Stress
22
#indent"off"
33

4-
(*IF-OCAML*)
5-
typenode=int
6-
moduleNodeSet=Set.Make(structtypet=intletcompare=compareend )
7-
moduleNodeMap=Map.Make(structtypet=intletcompare=compareend)
8-
typenode_set=NodeSet.t
9-
type'a node_map='aNodeMap.t
10-
(*ENDIF-OCAML*)
11-
12-
(*F# module NodeSet = Set
4+
moduleNodeSet=Set
135
moduleNodeMap=Map
146
typenode=int
157
typenode_set=nodeSet
16-
type 'a node_map = (node,'a) Map F#*)
8+
type'a node_map= (node,'a)Map
179

1810
typeinfo= {
1911
succ :node_set;

‎tests/fsharpqa/Source/Conformance/LexicalAnalysis/ConditionalCompilation/FSharp01.fs‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎tests/fsharpqa/Source/Conformance/LexicalAnalysis/ConditionalCompilation/FSharp02.fs‎

Lines changed: 0 additions & 12 deletions
This file was deleted.

‎tests/fsharpqa/Source/Conformance/LexicalAnalysis/ConditionalCompilation/OCaml01.fs‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp