@@ -61,97 +61,97 @@ with initial value INITVALUE and optional DOCSTRING."
61
61
(defvar , sym , init , docstring )))
62
62
63
63
(def-fsharp-compiled-var fsharp-shebang-regexp
64
- " \\ (^#!.*?\\ )\\ ([A-Za-z0-9_-]+\\ )$"
65
- " Capture the #! and path of a shebag in one group and the
64
+ " \\ (^#!.*?\\ )\\ ([A-Za-z0-9_-]+\\ )$"
65
+ " Capture the #! and path of a shebag in one group and the
66
66
executable in another." )
67
67
68
68
(def-fsharp-compiled-var fsharp-access-control-regexp
69
- " private\\ s-+\\ |internal\\ s-+\\ |public\\ s-+"
70
- " Match `private' , `internal' , or `public' , followed by a space,
69
+ " private\\ s-+\\ |internal\\ s-+\\ |public\\ s-+"
70
+ " Match `private' , `internal' , or `public' , followed by a space,
71
71
with no capture." )
72
72
73
73
(def-fsharp-compiled-var fsharp-access-control-regexp-noncapturing
74
- (format " \\ (?:%s \\ )" fsharp-access-control-regexp)
75
- " Same as `fsharp-access-control-regexp' , but captures" )
74
+ (format " \\ (?:%s \\ )" fsharp-access-control-regexp)
75
+ " Same as `fsharp-access-control-regexp' , but captures" )
76
76
77
77
(def-fsharp-compiled-var fsharp-inline-rec-regexp
78
- " inline\\ s-+\\ |rec\\ s-+"
79
- " Match `inline' or `rec' , followed by a space." )
78
+ " inline\\ s-+\\ |rec\\ s-+"
79
+ " Match `inline' or `rec' , followed by a space." )
80
80
81
81
(def-fsharp-compiled-var fsharp-inline-rec-regexp-noncapturing
82
- (format " \\ (?:%s \\ )" fsharp-inline-rec-regexp)
83
- " Match `inline' or `rec' , followed by a space, with no capture." )
82
+ (format " \\ (?:%s \\ )" fsharp-inline-rec-regexp)
83
+ " Match `inline' or `rec' , followed by a space, with no capture." )
84
84
85
85
(def-fsharp-compiled-var fsharp-valid-identifier-regexp
86
- " [A-Za-z0-9_']+"
87
- " Match a normal, valid F# identifier -- alphanumeric characters
86
+ " [A-Za-z0-9_']+"
87
+ " Match a normal, valid F# identifier -- alphanumeric characters
88
88
plus ' and underbar. Does not capture" )
89
89
90
90
(def-fsharp-compiled-var fsharp-function-def-regexp
91
- (concat " \\ <\\ (?:let\\ |and\\ |with\\ )\\ s-+"
92
- fsharp-inline-rec-regexp-noncapturing " ?"
93
- fsharp-access-control-regexp-noncapturing " *"
94
- (format " \\ (%s \\ )" fsharp-valid-identifier-regexp)
95
- " \\ (?:\\ s-+[A-Za-z_]\\ |\\ s-*(\\ )" ; ; matches function arguments or open-paren; unclear why 0-9 not in class
96
- ))
91
+ (concat " \\ <\\ (?:let\\ |and\\ |with\\ )\\ s-+"
92
+ fsharp-inline-rec-regexp-noncapturing " ?"
93
+ fsharp-access-control-regexp-noncapturing " *"
94
+ (format " \\ (%s \\ )" fsharp-valid-identifier-regexp)
95
+ " \\ (?:\\ s-+[A-Za-z_]\\ |\\ s-*(\\ )" ; ; matches function arguments or open-paren; unclear why 0-9 not in class
96
+ ))
97
97
98
98
(def-fsharp-compiled-var fsharp-pattern-function-regexp
99
- (concat " \\ <\\ (?:let\\ |and\\ )\\ s-+"
100
- fsharp-inline-rec-regexp-noncapturing " ?"
101
- fsharp-access-control-regexp-noncapturing " *"
102
- (format " \\ (%s \\ )" fsharp-valid-identifier-regexp)
103
- " \\ s-*=\\ s-*function" )
104
- " Matches an implicit matcher, eg let foo m = function | \" cat\" -> etc." )
99
+ (concat " \\ <\\ (?:let\\ |and\\ )\\ s-+"
100
+ fsharp-inline-rec-regexp-noncapturing " ?"
101
+ fsharp-access-control-regexp-noncapturing " *"
102
+ (format " \\ (%s \\ )" fsharp-valid-identifier-regexp)
103
+ " \\ s-*=\\ s-*function" )
104
+ " Matches an implicit matcher, eg let foo m = function | \" cat\" -> etc." )
105
105
106
106
; ; Note that this regexp is used for iMenu. To font-lock active patterns, we
107
107
; ; need to use an anchored match in fsharp-font-lock-keywords.
108
108
(def-fsharp-compiled-var fsharp-active-pattern-regexp
109
- (concat " \\ <\\ (?:let\\ |and\\ )\\ s-+"
110
- fsharp-inline-rec-regexp-noncapturing " ?"
111
- fsharp-access-control-regexp-noncapturing " *"
112
- " (\\ (|[A-Za-z0-9_'|]+|\\ ))\\ (?:\\ s-+[A-Za-z_]\\ |\\ s-*(\\ )" ))
109
+ (concat " \\ <\\ (?:let\\ |and\\ )\\ s-+"
110
+ fsharp-inline-rec-regexp-noncapturing " ?"
111
+ fsharp-access-control-regexp-noncapturing " *"
112
+ " (\\ (|[A-Za-z0-9_'|]+|\\ ))\\ (?:\\ s-+[A-Za-z_]\\ |\\ s-*(\\ )" ))
113
113
114
114
(def-fsharp-compiled-var fsharp-member-access-regexp
115
- " \\ <\\ (?:override\\ |member\\ |abstract\\ )\\ s-+"
116
- " Matches members declarations and modifiers on classes." )
115
+ " \\ <\\ (?:override\\ |member\\ |abstract\\ )\\ s-+"
116
+ " Matches members declarations and modifiers on classes." )
117
117
118
118
(def-fsharp-compiled-var fsharp-member-function-regexp
119
- (concat fsharp-member-access-regexp
120
- fsharp-inline-rec-regexp-noncapturing " ?"
121
- fsharp-access-control-regexp-noncapturing " *"
122
- " \\ (?:" fsharp-valid-identifier-regexp " \\ .\\ )?"
123
- " \\ (" fsharp-valid-identifier-regexp " \\ )" )
124
- " Captures the final identifier in a member function declaration." )
119
+ (concat fsharp-member-access-regexp
120
+ fsharp-inline-rec-regexp-noncapturing " ?"
121
+ fsharp-access-control-regexp-noncapturing " *"
122
+ " \\ (?:" fsharp-valid-identifier-regexp " \\ .\\ )?"
123
+ " \\ (" fsharp-valid-identifier-regexp " \\ )" )
124
+ " Captures the final identifier in a member function declaration." )
125
125
126
126
(def-fsharp-compiled-var fsharp-overload-operator-regexp
127
- (concat fsharp-member-access-regexp
128
- fsharp-inline-rec-regexp-noncapturing " ?"
129
- fsharp-access-control-regexp-noncapturing " *"
130
- " \\ (([!%&*+-./<=>?@^|~]+)\\ )" )
131
- " Match operators when overloaded by a type/class." )
127
+ (concat fsharp-member-access-regexp
128
+ fsharp-inline-rec-regexp-noncapturing " ?"
129
+ fsharp-access-control-regexp-noncapturing " *"
130
+ " \\ (([!%&*+-./<=>?@^|~]+)\\ )" )
131
+ " Match operators when overloaded by a type/class." )
132
132
133
133
(def-fsharp-compiled-var fsharp-constructor-regexp
134
- (concat " ^\\ s-*"
135
- fsharp-access-control-regexp-noncapturing " *"
136
- " \\ <\\ (new\\ ) *(.*)[^=]*=" )
137
- " Matches the `new' keyword in a constructor" )
134
+ (concat " ^\\ s-*"
135
+ fsharp-access-control-regexp-noncapturing " *"
136
+ " \\ <\\ (new\\ ) *(.*)[^=]*=" )
137
+ " Matches the `new' keyword in a constructor" )
138
138
139
139
(def-fsharp-compiled-var fsharp-type-def-regexp
140
- (concat " ^\\ s-*\\ <\\ (?:type\\ |inherit\\ )\\ s-+"
141
- fsharp-access-control-regexp-noncapturing " *" ; ; match access control 0 or more times
142
- " \\ ([A-Za-z0-9_'.]+\\ )" ))
140
+ (concat " ^\\ s-*\\ <\\ (?:type\\ |inherit\\ )\\ s-+"
141
+ fsharp-access-control-regexp-noncapturing " *" ; ; match access control 0 or more times
142
+ " \\ ([A-Za-z0-9_'.]+\\ )" ))
143
143
144
144
(def-fsharp-compiled-var fsharp-var-or-arg-regexp
145
- " \\ _<\\ ([A-Za-z_][A-Za-z0-9_']*\\ )\\ _>" )
145
+ " \\ _<\\ ([A-Za-z_][A-Za-z0-9_']*\\ )\\ _>" )
146
146
147
147
(def-fsharp-compiled-var fsharp-explicit-field-regexp
148
- (concat " ^\\ s-*\\ (?:val\\ |abstract\\ )\\ s-*\\ (?:mutable\\ s-+\\ )?"
149
- fsharp-access-control-regexp-noncapturing " *" ; ; match access control 0 or more times
150
- " \\ ([A-Za-z_][A-Za-z0-9_']*\\ )\\ s-*:\\ s-*\\ ([A-Za-z_][A-Za-z0-9_'<> \t ]*\\ )" ))
148
+ (concat " ^\\ s-*\\ (?:val\\ |abstract\\ )\\ s-*\\ (?:mutable\\ s-+\\ )?"
149
+ fsharp-access-control-regexp-noncapturing " *" ; ; match access control 0 or more times
150
+ " \\ ([A-Za-z_][A-Za-z0-9_']*\\ )\\ s-*:\\ s-*\\ ([A-Za-z_][A-Za-z0-9_'<> \t ]*\\ )" ))
151
151
152
152
(def-fsharp-compiled-var fsharp-attributes-regexp
153
- " \\ (\\ [<[A-Za-z0-9_]+[( ]?\\ )\\ (\" .*\" \\ )?\\ ()?>\\ ]\\ )"
154
- " Match attributes like [<EntryPoint>]; separately groups contained strings in attributes like [<Attribute(\" property\" )>]" )
153
+ " \\ (\\ [<[A-Za-z0-9_]+[( ]?\\ )\\ (\" .*\" \\ )?\\ ()?>\\ ]\\ )"
154
+ " Match attributes like [<EntryPoint>]; separately groups contained strings in attributes like [<Attribute(\" property\" )>]" )
155
155
156
156
; ; F# makes extensive use of operators, many of which have some kind of
157
157
; ; structural significance.
@@ -164,27 +164,27 @@ with initial value INITVALUE and optional DOCSTRING."
164
164
; ; | -- match / type expressions
165
165
166
166
(def-fsharp-compiled-var fsharp-operator-quote-regexp
167
- " \\ (<@\\ {1,2\\ }\\ )\\ (?:.*\\ )\\ (@\\ {1,2\\ }>\\ )"
168
- " Font lock <@/<@@ and @>/@@> operators." )
167
+ " \\ (<@\\ {1,2\\ }\\ )\\ (?:.*\\ )\\ (@\\ {1,2\\ }>\\ )"
168
+ " Font lock <@/<@@ and @>/@@> operators." )
169
169
170
170
(def-fsharp-compiled-var fsharp-operator-pipe-regexp
171
- " <|\\ {1,3\\ }\\ ||\\ {1,3\\ }>"
172
- " Match the full range of pipe operators -- |>, ||>, |||>, etc." )
171
+ " <|\\ {1,3\\ }\\ ||\\ {1,3\\ }>"
172
+ " Match the full range of pipe operators -- |>, ||>, |||>, etc." )
173
173
174
174
(def-fsharp-compiled-var fsharp-custom-operator-with-pipe-regexp
175
- (let ((op-chars " !%&\\ *\\ +\\ -\\ ./<=>@\\ ^~" ) ; ; all F# custom operator chars except for `|`
176
- (backward-pipe " <|\\ {1,3\\ }" )
177
- (forward-pipe " |\\ {1,3\\ }>" )
178
- (alt " \\ |" ))
179
- (concat " [" op-chars " |]*" backward-pipe " [" op-chars " ]+"
180
- alt " [" op-chars " |]+" backward-pipe " [" op-chars " ]*"
181
- alt " [" op-chars " ]*" forward-pipe " [" op-chars " |]+"
182
- alt " [" op-chars " ]+" forward-pipe " [" op-chars " |]*" ))
183
- " Match operators that contains pipe sequence -- <|>, |>>, <<|, etc." )
175
+ (let ((op-chars " !%&\\ *\\ +\\ -\\ ./<=>@\\ ^~" ) ; ; all F# custom operator chars except for `|`
176
+ (backward-pipe " <|\\ {1,3\\ }" )
177
+ (forward-pipe " |\\ {1,3\\ }>" )
178
+ (alt " \\ |" ))
179
+ (concat " [" op-chars " |]*" backward-pipe " [" op-chars " ]+"
180
+ alt " [" op-chars " |]+" backward-pipe " [" op-chars " ]*"
181
+ alt " [" op-chars " ]*" forward-pipe " [" op-chars " |]+"
182
+ alt " [" op-chars " ]+" forward-pipe " [" op-chars " |]*" ))
183
+ " Match operators that contains pipe sequence -- <|>, |>>, <<|, etc." )
184
184
185
185
(def-fsharp-compiled-var fsharp-operator-case-regexp
186
- " \\ s-+\\ (|\\ )[A-Za-z0-9_' ]"
187
- " Match literal | in contexts like match and type declarations." )
186
+ " \\ s-+\\ (|\\ )[A-Za-z0-9_' ]"
187
+ " Match literal | in contexts like match and type declarations." )
188
188
189
189
(defvar fsharp-imenu-generic-expression
190
190
`((nil ,(concat " ^\\ s-*" fsharp-function-def-regexp) 1 )
@@ -215,52 +215,52 @@ with initial value INITVALUE and optional DOCSTRING."
215
215
216
216
; ; Preprocessor directives (3.3)
217
217
(def-fsharp-compiled-var fsharp-ui-preproessor-directives
218
- '(" #if" " #else" " #endif" " #light" ))
218
+ '(" #if" " #else" " #endif" " #light" ))
219
219
220
220
; ; Compiler directives (12.4)
221
221
(def-fsharp-compiled-var fsharp-ui-compiler-directives
222
- '(" #nowarn" " #load" " #r" " #reference" " #I"
223
- " #Include" " #q" " #quit" " #time" " #help" ))
222
+ '(" #nowarn" " #load" " #r" " #reference" " #I"
223
+ " #Include" " #q" " #quit" " #time" " #help" ))
224
224
225
225
; ; Lexical matters (18.4)
226
226
(def-fsharp-compiled-var fsharp-ui-lexical-matters
227
- '(" #indent" ))
227
+ '(" #indent" ))
228
228
229
229
; ; Line Directives (3.9)
230
230
(def-fsharp-compiled-var fsharp-ui-line-directives
231
- '(" #line" ))
231
+ '(" #line" ))
232
232
233
233
; ; Identifier replacements (3.11)
234
234
(def-fsharp-compiled-var fsharp-ui-identifier-replacements
235
- '(" __SOURCE_DIRECTORY__" " __SOURCE_FILE__" " __LINE__" ))
235
+ '(" __SOURCE_DIRECTORY__" " __SOURCE_FILE__" " __LINE__" ))
236
236
237
237
; ; F# keywords (5.0)
238
238
(def-fsharp-compiled-var fsharp-ui-fsharp-threefour-keywords
239
- '(" abstract" " and" " and!" " as" " assert" " base" " begin"
240
- " class" " default" " delegate" " do" " do!" " done"
241
- " downcast" " downto" " elif" " else" " end"
242
- " exception" " extern" " false" " finally" " for" " fun"
243
- " function" " global" " if" " in" " inherit" " inline"
244
- " interface" " internal" " lazy" " let" " let!"
245
- " match" " match!" " member" " module" " mutable" " namespace"
246
- " new" " not" " null" " of" " open" " or" " override"
247
- " private" " public" " rec" " return" " return!"
248
- " select" " static" " struct" " then" " to" " true"
249
- " try" " type" " upcast" " use" " use!" " val" " void"
250
- " when" " while" " with" " yield" " yield!" ))
239
+ '(" abstract" " and" " and!" " as" " assert" " base" " begin"
240
+ " class" " default" " delegate" " do" " do!" " done"
241
+ " downcast" " downto" " elif" " else" " end"
242
+ " exception" " extern" " false" " finally" " for" " fun"
243
+ " function" " global" " if" " in" " inherit" " inline"
244
+ " interface" " internal" " lazy" " let" " let!"
245
+ " match" " match!" " member" " module" " mutable" " namespace"
246
+ " new" " not" " null" " of" " open" " or" " override"
247
+ " private" " public" " rec" " return" " return!"
248
+ " select" " static" " struct" " then" " to" " true"
249
+ " try" " type" " upcast" " use" " use!" " val" " void"
250
+ " when" " while" " with" " yield" " yield!" ))
251
251
252
252
; ; "Reserved because they are reserved in OCaml"
253
253
(def-fsharp-compiled-var fsharp-ui-ocaml-reserved-words
254
- '(" asr" " land" " lor" " lsl" " lsr" " lxor" " mod" " sig" ))
254
+ '(" asr" " land" " lor" " lsl" " lsr" " lxor" " mod" " sig" ))
255
255
256
256
; ; F# reserved words for future use
257
257
(def-fsharp-compiled-var fsharp-ui-reserved-words
258
- '(" atomic" " break" " checked" " component" " const"
259
- " constraint" " constructor" " continue" " eager"
260
- " event" " external" " fixed" " functor" " include"
261
- " method" " mixin" " object" " parallel" " process"
262
- " protected" " pure" " sealed" " tailcall" " trait"
263
- " virtual" " volatile" ))
258
+ '(" atomic" " break" " checked" " component" " const"
259
+ " constraint" " constructor" " continue" " eager"
260
+ " event" " external" " fixed" " functor" " include"
261
+ " method" " mixin" " object" " parallel" " process"
262
+ " protected" " pure" " sealed" " tailcall" " trait"
263
+ " virtual" " volatile" ))
264
264
265
265
; ; RMD 2016-09-30 -- This was pulled out separately with the following comment
266
266
; ; when I got here. Not clear to me why it's on it's own, or even precisely what
@@ -270,21 +270,21 @@ with initial value INITVALUE and optional DOCSTRING."
270
270
; ; Workflows not yet handled by fsautocomplete but async
271
271
; ; always present
272
272
(def-fsharp-compiled-var fsharp-ui-async-words
273
- '(" async" )
274
- " Just the word async, in a list." )
273
+ '(" async" )
274
+ " Just the word async, in a list." )
275
275
276
276
(def-fsharp-compiled-var fsharp-ui-word-list-regexp
277
- (regexp-opt
278
- `(,@fsharp-ui-async-words
279
- ,@fsharp-ui-compiler-directives
280
- ,@fsharp-ui-fsharp-threefour-keywords
281
- ,@fsharp-ui-identifier-replacements
282
- ,@fsharp-ui-lexical-matters
283
- ,@fsharp-ui-ocaml-reserved-words
284
- ,@fsharp-ui-preproessor-directives
285
- ,@fsharp-ui-reserved-words
286
- ,@fsharp-ui-line-directives )
287
- 'symbols ))
277
+ (regexp-opt
278
+ `(,@fsharp-ui-async-words
279
+ ,@fsharp-ui-compiler-directives
280
+ ,@fsharp-ui-fsharp-threefour-keywords
281
+ ,@fsharp-ui-identifier-replacements
282
+ ,@fsharp-ui-lexical-matters
283
+ ,@fsharp-ui-ocaml-reserved-words
284
+ ,@fsharp-ui-preproessor-directives
285
+ ,@fsharp-ui-reserved-words
286
+ ,@fsharp-ui-line-directives )
287
+ 'symbols ))
288
288
289
289
(defconst fsharp-font-lock-keywords
290
290
(eval-when-compile
0 commit comments