Skip to content

Commit 28b6d43

Browse files
committed
Remove support for UNSAFE and UNSAFE_EXPR
UNSAFE comments were removed in 2019 (see D15791046).
1 parent f9315be commit 28b6d43

2 files changed

Lines changed: 3 additions & 55 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ Removed highlighting for obsolete keywords `and`, `or`, `xor` and
1111
`__halt_compiler`. Ensure that `as` and `is` are consistently
1212
keywords, but `instanceof` is not.
1313

14+
Remove support for highlighting `UNSAFE` and `UNSAFE_EXPR` which were
15+
removed from Hack in 2019.
16+
1417
# 1.1
1518

1619
Fixed an error when loading hack-mode from a byte-compiled file

hack-mode.el

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -311,57 +311,6 @@ E.g. Foo<int> has a paired delimiter, 1 > 2 does not."
311311
(set-match-data match-data)
312312
(goto-char found-pos))))
313313

314-
(defun hack-font-lock-unsafe (limit)
315-
"Search for UNSAFE comments."
316-
(let ((case-fold-search nil)
317-
(found-pos nil)
318-
(match-data nil))
319-
;; UNSAFE must start with //, and can have any text afterwards. See
320-
;; full_fidelity_lexer.ml.
321-
(save-excursion
322-
;; TODO: this 'not found-pos' is a common pattern, factor it out.
323-
(while (and (not found-pos)
324-
(search-forward "UNSAFE" limit t))
325-
(let* ((ppss (syntax-ppss))
326-
(in-comment (nth 4 ppss))
327-
(comment-start (nth 8 ppss)))
328-
(when in-comment
329-
(save-excursion
330-
(goto-char comment-start)
331-
(when (re-search-forward
332-
(rx point "//" (0+ whitespace) (group "UNSAFE"))
333-
limit t)
334-
(setq found-pos (point))
335-
(setq match-data (match-data))))))))
336-
(when found-pos
337-
(set-match-data match-data)
338-
(goto-char found-pos))))
339-
340-
(defun hack-font-lock-unsafe-expr (limit)
341-
"Search for UNSAFE_EXPR comments."
342-
(let ((case-fold-search nil)
343-
(found-pos nil)
344-
(match-data nil))
345-
;; UNSAFE_EXPR must start with /*, and can have any text afterwards. See
346-
;; full_fidelity_lexer.ml.
347-
(save-excursion
348-
(while (and (not found-pos)
349-
(search-forward "UNSAFE_EXPR" limit t))
350-
(let* ((ppss (syntax-ppss))
351-
(in-comment (nth 4 ppss))
352-
(comment-start (nth 8 ppss)))
353-
(when in-comment
354-
(save-excursion
355-
(goto-char comment-start)
356-
(when (re-search-forward
357-
(rx point "/*" (0+ whitespace) (group "UNSAFE_EXPR"))
358-
limit t)
359-
(setq found-pos (point))
360-
(setq match-data (match-data))))))))
361-
(when found-pos
362-
(set-match-data match-data)
363-
(goto-char found-pos))))
364-
365314
(defun hack-font-lock-fixme (limit)
366315
"Search for HH_FIXME comments."
367316
(let ((case-fold-search nil)
@@ -1280,10 +1229,6 @@ interpolating inside the XHP expression."
12801229

12811230
(hack-font-lock-fallthrough
12821231
(1 'font-lock-keyword-face t))
1283-
(hack-font-lock-unsafe
1284-
(1 'error t))
1285-
(hack-font-lock-unsafe-expr
1286-
(1 'error t))
12871232
(hack-font-lock-fixme
12881233
(1 'error t))
12891234
(hack-font-lock-ignore-error

0 commit comments

Comments
 (0)