Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 4872b98

Browse files
committed
Sort tokens alphabetically
Easier to sync with highlighters cc @ryyppy
1 parent f04fe7a commit 4872b98

File tree

1 file changed

+26
-28
lines changed

1 file changed

+26
-28
lines changed

src/res_token.ml

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -164,48 +164,46 @@ let toString = function
164164
| Export -> "export"
165165

166166
let keywordTable = function
167-
| "true" -> True
168-
| "false" -> False
169-
| "open" -> Open
170-
| "let" -> Let
171-
| "rec" -> Rec
172167
| "and" -> And
173168
| "as" -> As
174-
| "exception" -> Exception
175169
| "assert" -> Assert
176-
| "lazy" -> Lazy
177-
| "if" -> If
170+
| "constraint" -> Constraint
171+
| "downto" -> Downto
178172
| "else" -> Else
173+
| "exception" -> Exception
174+
| "export" -> Export
175+
| "external" -> External
176+
| "false" -> False
179177
| "for" -> For
178+
| "if" -> If
179+
| "import" -> Import
180180
| "in" -> In
181-
| "to" -> To
182-
| "downto" -> Downto
183-
| "while" -> While
184-
| "switch" -> Switch
185-
| "when" -> When
186-
| "external" -> External
187-
| "type" -> Typ
188-
| "private" -> Private
189-
| "mutable" -> Mutable
190-
| "constraint" -> Constraint
191181
| "include" -> Include
182+
| "lazy" -> Lazy
183+
| "let" -> Let
184+
| "list{" -> List
192185
| "module" -> Module
186+
| "mutable" -> Mutable
193187
| "of" -> Of
194-
| "list{" -> List
195-
| "with" -> With
188+
| "open" -> Open
189+
| "private" -> Private
190+
| "rec" -> Rec
191+
| "switch" -> Switch
192+
| "to" -> To
193+
| "true" -> True
196194
| "try" -> Try
197-
| "import" -> Import
198-
| "export" -> Export
195+
| "type" -> Typ
196+
| "when" -> When
197+
| "while" -> While
198+
| "with" -> With
199199
| _ -> raise Not_found
200200
[@@raises Not_found]
201201

202202
let isKeyword = function
203-
| True | False | Open | Let | Rec | And | As
204-
| Exception | Assert | Lazy | If | Else | For | In | To
205-
| Downto | While | Switch | When | External | Typ | Private
206-
| Mutable | Constraint | Include | Module | Of
207-
| Land | Lor | List | With
208-
| Try | Import | Export -> true
203+
| And | As | Assert | Constraint | Downto | Else | Exception | Export
204+
| External | False | For | If | Import | In | Include | Land | Lazy
205+
| Let | List | Lor | Module | Mutable | Of | Open | Private | Rec
206+
| Switch | To | True | Try | Typ | When | While | With -> true
209207
| _ -> false
210208

211209
let lookupKeyword str =

0 commit comments

Comments
 (0)