forked from dotnet/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParseHelpers.fsi
More file actions
306 lines (223 loc) · 9.77 KB
/
ParseHelpers.fsi
File metadata and controls
306 lines (223 loc) · 9.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
module internal FSharp.Compiler.ParseHelpers
open FSharp.Compiler.AbstractIL.IL
open FSharp.Compiler.Syntax
open FSharp.Compiler.SyntaxTrivia
open FSharp.Compiler.Features
open FSharp.Compiler.Text
open FSharp.Compiler.Xml
open Internal.Utilities.Text.Lexing
open Internal.Utilities.Text.Parsing
/// The error raised by the parse_error_rich function, which is called by the parser engine
/// when a syntax error occurs. The first object is the ParseErrorContext which contains a dump of
/// information about the grammar at the point where the error occurred, e.g. what tokens
/// are valid to shift next at that point in the grammar. This information is processed in CompileOps.fs.
[<NoEquality; NoComparison>]
exception SyntaxError of obj * range: range
exception IndentationProblem of string * range
val warningStringOfCoords: line: int -> column: int -> string
val warningStringOfPos: p: pos -> string
val posOfLexPosition: p: Position -> pos
val mkSynRange: p1: Position -> p2: Position -> range
type LexBuffer<'Char> with
member LexemeRange: range
val lhs: parseState: IParseState -> range
val rhs2: parseState: IParseState -> i: int -> j: int -> range
val rhs: parseState: IParseState -> i: int -> range
type IParseState with
member SynArgNameGenerator: SyntaxTreeOps.SynArgNameGenerator
member ResetSynArgNameGenerator: unit -> unit
module LexbufLocalXmlDocStore =
val ClearXmlDoc: lexbuf: UnicodeLexing.Lexbuf -> unit
val SaveXmlDocLine: lexbuf: UnicodeLexing.Lexbuf * lineText: string * range: range -> unit
val GrabXmlDocBeforeMarker: lexbuf: UnicodeLexing.Lexbuf * markerRange: range -> PreXmlDoc
val AddGrabPoint: lexbuf: UnicodeLexing.Lexbuf -> unit
val AddGrabPointDelayed: lexbuf: UnicodeLexing.Lexbuf -> unit
val ReportInvalidXmlDocPositions: lexbuf: UnicodeLexing.Lexbuf -> range list
type LexerIfdefStackEntry =
| IfDefIf
| IfDefElse
type LexerIfdefStackEntries = (LexerIfdefStackEntry * range) list
type LexerIfdefStack = LexerIfdefStackEntries
type LexerEndlineContinuation =
| Token
| IfdefSkip of int * range: range
type LexerIfdefExpression =
| IfdefAnd of LexerIfdefExpression * LexerIfdefExpression
| IfdefOr of LexerIfdefExpression * LexerIfdefExpression
| IfdefNot of LexerIfdefExpression
| IfdefId of string
val LexerIfdefEval: lookup: (string -> bool) -> _arg1: LexerIfdefExpression -> bool
module LexbufIfdefStore =
val SaveIfHash: lexbuf: UnicodeLexing.Lexbuf * lexed: string * expr: LexerIfdefExpression * range: range -> unit
val SaveElseHash: lexbuf: UnicodeLexing.Lexbuf * lexed: string * range: range -> unit
val SaveEndIfHash: lexbuf: UnicodeLexing.Lexbuf * lexed: string * range: range -> unit
val GetTrivia: lexbuf: UnicodeLexing.Lexbuf -> ConditionalDirectiveTrivia list
module LexbufCommentStore =
val SaveSingleLineComment: lexbuf: UnicodeLexing.Lexbuf * startRange: range * endRange: range -> unit
val SaveBlockComment: lexbuf: UnicodeLexing.Lexbuf * startRange: range * endRange: range -> unit
val GetComments: lexbuf: UnicodeLexing.Lexbuf -> CommentTrivia list
val ClearComments: lexbuf: UnicodeLexing.Lexbuf -> unit
[<RequireQualifiedAccess>]
type LexerStringStyle =
| Verbatim
| TripleQuote
| SingleQuote
| ExtendedInterpolated
[<RequireQualifiedAccess; Struct>]
type LexerStringKind =
{ IsByteString: bool
IsInterpolated: bool
IsInterpolatedFirst: bool }
static member ByteString: LexerStringKind
static member InterpolatedStringFirst: LexerStringKind
static member InterpolatedStringPart: LexerStringKind
static member String: LexerStringKind
type LexerInterpolatedStringNesting = (int * LexerStringStyle * int * range option * range) list
[<RequireQualifiedAccess; NoComparison; NoEquality>]
type LexerContinuation =
| Token of ifdef: LexerIfdefStackEntries * nesting: LexerInterpolatedStringNesting
| IfDefSkip of ifdef: LexerIfdefStackEntries * nesting: LexerInterpolatedStringNesting * int * range: range
| String of
ifdef: LexerIfdefStackEntries *
nesting: LexerInterpolatedStringNesting *
style: LexerStringStyle *
kind: LexerStringKind *
delimLen: int *
range: range
| Comment of ifdef: LexerIfdefStackEntries * nesting: LexerInterpolatedStringNesting * int * range: range
| SingleLineComment of ifdef: LexerIfdefStackEntries * nesting: LexerInterpolatedStringNesting * int * range: range
| StringInComment of
ifdef: LexerIfdefStackEntries *
nesting: LexerInterpolatedStringNesting *
style: LexerStringStyle *
int *
range: range
| MLOnly of ifdef: LexerIfdefStackEntries * nesting: LexerInterpolatedStringNesting * range: range
| EndLine of ifdef: LexerIfdefStackEntries * nesting: LexerInterpolatedStringNesting * LexerEndlineContinuation
member LexerIfdefStack: LexerIfdefStackEntries
member LexerInterpStringNesting: LexerInterpolatedStringNesting
static member Default: LexerContinuation
and LexCont = LexerContinuation
val ParseAssemblyCodeInstructions:
s: string ->
reportLibraryOnlyFeatures: bool ->
langVersion: LanguageVersion ->
strictIndentation: bool option ->
m: range ->
ILInstr[]
val grabXmlDocAtRangeStart: parseState: IParseState * optAttributes: SynAttributeList list * range: range -> PreXmlDoc
val grabXmlDoc: parseState: IParseState * optAttributes: SynAttributeList list * elemIdx: int -> PreXmlDoc
val ParseAssemblyCodeType:
s: string ->
reportLibraryOnlyFeatures: bool ->
langVersion: LanguageVersion ->
strictIndentation: bool option ->
m: range ->
ILType
val reportParseErrorAt: range -> (int * string) -> unit
val raiseParseErrorAt: range -> (int * string) -> 'a
val mkSynMemberDefnGetSet:
parseState: IParseState ->
opt_inline: range option ->
mWith: range ->
classDefnMemberGetSetElements:
(range option *
SynAttributeList list *
(SynPat * range) *
(range option * SynReturnInfo) option *
range option *
SynExpr *
range) list ->
mAnd: range option ->
mWhole: range ->
propertyNameBindingPat: SynPat ->
optPropertyType: (range option * SynReturnInfo) option ->
visNoLongerUsed: SynAccess option ->
flagsBuilderAndLeadingKeyword: (SynMemberKind -> SynMemberFlags) * SynLeadingKeyword ->
attrs: SynAttributeList list ->
rangeStart: range ->
SynMemberDefn list
/// Incorporate a '^' for an qualified access to a generic type parameter
val adjustHatPrefixToTyparLookup: mFull: range -> rightExpr: SynExpr -> SynExpr
val mkSynTypeTuple: elementTypes: SynTupleTypeSegment list -> SynType
#if DEBUG
val debugPrint: s: string -> unit
#else
val debugPrint: s: 'a -> unit
#endif
val exprFromParseError: e: SynExpr -> SynExpr
val patFromParseError: e: SynPat -> SynPat
val rebindRanges:
first: (RecordFieldName * range option * SynExpr option) ->
fields: ((RecordFieldName * range option * SynExpr option) * BlockSeparator option) list ->
lastSep: BlockSeparator option ->
SynExprRecordField list
val mkUnderscoreRecdField: m: range -> SynLongIdent * bool
val mkRecdField: lidwd: SynLongIdent -> SynLongIdent * bool
val mkSynDoBinding: vis: SynAccess option * mDo: range * expr: SynExpr * m: range -> SynBinding
val mkSynExprDecl: e: SynExpr -> SynModuleDecl
val addAttribs: attrs: SynAttributes -> p: SynPat -> SynPat
val unionRangeWithPos: r: range -> p: pos -> range
val checkEndOfFileError: t: LexerContinuation -> unit
type BindingSet =
| BindingSetPreAttrs of
range *
bool *
bool *
(SynAttributes -> SynAccess option -> SynAttributes * SynBinding list) *
range
val mkClassMemberLocalBindings:
isStatic: bool * initialRangeOpt: range option * attrs: SynAttributes * vis: SynAccess option * BindingSet ->
SynMemberDefn
val mkLocalBindings: mWhole: range * BindingSet * mIn: range option * body: SynExpr -> SynExpr
val mkDefnBindings:
mWhole: range * BindingSet * attrs: SynAttributes * vis: SynAccess option * attrsm: range -> SynModuleDecl list
val idOfPat: parseState: IParseState -> m: range -> p: SynPat -> Ident
val checkForMultipleAugmentations: m: range -> a1: 'a list -> a2: 'a list -> 'a list
val rangeOfLongIdent: lid: LongIdent -> range
val appendValToLeadingKeyword: mVal: range -> leadingKeyword: SynLeadingKeyword -> SynLeadingKeyword
val mkSynUnionCase:
attributes: SynAttributes ->
access: SynAccess option ->
id: SynIdent ->
kind: SynUnionCaseKind ->
mDecl: range ->
(PreXmlDoc * range) ->
SynUnionCase
val mkAutoPropDefn:
mVal: range ->
access: SynAccess option ->
ident: Ident ->
typ: SynType option ->
mEquals: range option ->
expr: SynExpr ->
accessors: range option * (SynMemberKind * GetSetKeywords option * SynAccess option * SynAccess option) ->
xmlDoc: PreXmlDoc ->
attribs: SynAttributes ->
flags: (SynMemberKind -> SynMemberFlags) * SynLeadingKeyword ->
rangeStart: range ->
SynMemberDefn
val mkValField:
parseState: IParseState ->
mVal: range ->
isMutable: range option ->
access: SynAccess option ->
idOpt: Ident option ->
typ: SynType option ->
rangeStart: range ->
SynAttributes ->
range option ->
SynMemberDefn
val mkSynField:
parseState: IParseState ->
idOpt: Ident option ->
t: SynType option ->
isMutable: range option ->
vis: SynAccess option ->
attributes: SynAttributeList list ->
mStatic: range option ->
rangeStart: range ->
leadingKeyword: SynLeadingKeyword option ->
SynField
val leadingKeywordIsAbstract: SynLeadingKeyword -> bool