@@ -15,70 +15,54 @@ type TextIOWrapper =
1515 inherit IDisposable
1616 inherit TextIOBase
1717
18- [<StringEnum>]
19- type OpenTextModeUpdating =
20- | [<CompiledName( " r+" ) >] ReadUpdate
21- | [<CompiledName( " +r" ) >] UpdateRead
22- | [<CompiledName( " rt+" ) >] ReadTextUpdate
23- | [<CompiledName( " r+t" ) >] ReadUpdateText
24- | [<CompiledName( " +rt" ) >] UpdateReadText
25- | [<CompiledName( " tr+" ) >] TextReadUpdate
26- | [<CompiledName( " t+r" ) >] TextUpdateRead
27- | [<CompiledName( " +tr" ) >] UpdateTextRead
28- | [<CompiledName( " w+" ) >] WriteUpdate
29- | [<CompiledName( " +w" ) >] UpdateWrite
30- | [<CompiledName( " wt+" ) >] WriteTextUpdate
31- | [<CompiledName( " w+t" ) >] WriteUpdateText
32- | [<CompiledName( " +wt" ) >] UpdateWriteText
33- | [<CompiledName( " tw+" ) >] TextWriteUpdate
34- | [<CompiledName( " t+w" ) >] TextUpdateWrite
35- | [<CompiledName( " +tw" ) >] UpdateTextWrite
36- | [<CompiledName( " a+" ) >] AppendUpdate
37- | [<CompiledName( " +a" ) >] UpdateAppend
38- | [<CompiledName( " at+" ) >] AppendTextUpdate
39- | [<CompiledName( " a+t" ) >] AppendUpdateText
40- | [<CompiledName( " +at" ) >] UpdateAppendText
41- | [<CompiledName( " ta+" ) >] TextAppendUpdate
42- | [<CompiledName( " t+a" ) >] TextUpdateAppend
43- | [<CompiledName( " +ta" ) >] UpdateTextAppend
44- | [<CompiledName( " x+" ) >] CreateUpdate
45- | [<CompiledName( " +x" ) >] UpdateCreate
46- | [<CompiledName( " xt+" ) >] CreateTextUpdate
47- | [<CompiledName( " x+t" ) >] CreateUpdateText
48- | [<CompiledName( " +xt" ) >] UpdateCreateText
49- | [<CompiledName( " tx+" ) >] TextCreateUpdate
50- | [<CompiledName( " t+x" ) >] TextUpdateCreate
51- | [<CompiledName( " +tx" ) >] UpdateTextCreate
18+ module OpenTextMode =
19+ let [<Literal>] ReadUpdate = " r+"
20+ let [<Literal>] UpdateRead = " +r"
21+ let [<Literal>] ReadTextUpdate = " rt+"
22+ let [<Literal>] ReadUpdateText = " r+t"
23+ let [<Literal>] UpdateReadText = " +rt"
24+ let [<Literal>] TextReadUpdate = " tr+"
25+ let [<Literal>] TextUpdateRead = " t+r"
26+ let [<Literal>] UpdateTextRead = " +tr"
27+ let [<Literal>] WriteUpdate = " w+"
28+ let [<Literal>] UpdateWrite = " +w"
29+ let [<Literal>] WriteTextUpdate = " wt+"
30+ let [<Literal>] WriteUpdateText = " w+t"
31+ let [<Literal>] UpdateWriteText = " +wt"
32+ let [<Literal>] TextWriteUpdate = " tw+"
33+ let [<Literal>] TextUpdateWrite = " t+w"
34+ let [<Literal>] UpdateTextWrite = " +tw"
35+ let [<Literal>] AppendUpdate = " a+"
36+ let [<Literal>] UpdateAppend = " +a"
37+ let [<Literal>] AppendTextUpdate = " at+"
38+ let [<Literal>] AppendUpdateText = " a+t"
39+ let [<Literal>] UpdateAppendText = " +at"
40+ let [<Literal>] TextAppendUpdate = " ta+"
41+ let [<Literal>] TextUpdateAppend = " t+a"
42+ let [<Literal>] UpdateTextAppend = " +ta"
43+ let [<Literal>] CreateUpdate = " x+"
44+ let [<Literal>] UpdateCreate = " +x"
45+ let [<Literal>] CreateTextUpdate = " xt+"
46+ let [<Literal>] CreateUpdateText = " x+t"
47+ let [<Literal>] UpdateCreateText = " +xt"
48+ let [<Literal>] TextCreateUpdate = " tx+"
49+ let [<Literal>] TextUpdateCreate = " t+x"
50+ let [<Literal>] UpdateTextCreate = " +tx"
51+
52+ let [<Literal>] Read = " rt"
53+ let [<Literal>] ReadText = " rt"
54+ let [<Literal>] TextRead = " tr"
55+
56+ let [<Literal>] Write = " w"
57+ let [<Literal>] WriteText = " wt"
58+ let [<Literal>] TextWrite = " tw"
59+ let [<Literal>] Append = " a"
60+ let [<Literal>] AppendText = " at"
61+ let [<Literal>] TextAppend = " ta"
62+ let [<Literal>] Create = " x"
63+ let [<Literal>] CreateText = " xt"
64+ let [<Literal>] TextCreate = " tx"
5265
53- [<StringEnum>]
54- type OpenTextModeReading =
55- | [<CompiledName( " rt" ) >] Read
56- | [<CompiledName( " rt" ) >] ReadText
57- | [<CompiledName( " tr" ) >] TextRead
58-
59- [<StringEnum>]
60- type OpenTextModeWriting =
61- | [<CompiledName( " w" ) >] Write
62- | [<CompiledName( " wt" ) >] WriteText
63- | [<CompiledName( " tw" ) >] TextWrite
64- | [<CompiledName( " a" ) >] Append
65- | [<CompiledName( " at" ) >] AppendText
66- | [<CompiledName( " ta" ) >] TextAppend
67- | [<CompiledName( " x" ) >] Create
68- | [<CompiledName( " xt" ) >] CreateText
69- | [<CompiledName( " tx" ) >] TextCreate
70-
71- [<Erase>]
72- type OpenTextMode =
73- | OpenTextModeUpdating
74- | OpenTextModeWriting
75- | OpenTextModeReading
76-
77-
78- [<Erase>]
79- type _OpenFile =
80- | StringPath of string
81- | FileDescriptor of int
8266
8367type _Opener = Tuple< string, int> -> int
8468
@@ -120,7 +104,8 @@ type IExports =
120104 abstract float : obj -> float
121105 abstract print : obj : obj -> unit
122106
123- [<NamedParams( fromIndex= 1 ) >] abstract ``open`` : file : _OpenFile * ? mode : OpenTextMode * ? buffering : int * ? encoding : string * ? errors : string * ? newline : string * ? closefd : bool * ? opener : _Opener -> TextIOWrapper
107+ [<NamedParams( fromIndex= 1 ) >] abstract ``open`` : file : int * ? mode : string * ? buffering : int * ? encoding : string * ? errors : string * ? newline : string * ? closefd : bool * ? opener : _Opener -> TextIOWrapper
108+ [<NamedParams( fromIndex= 1 ) >] abstract ``open`` : file : string * ? mode : string * ? buffering : int * ? encoding : string * ? errors : string * ? newline : string * ? closefd : bool * ? opener : _Opener -> TextIOWrapper
124109
125110[<ImportAll( " builtins" ) >]
126111let builtins : IExports = nativeOnly
0 commit comments