mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-11 00:30:17 -08:00
Don't signal an error when encountering invalid rust syntax. Without this patch, invalid rust code would prevent a chunk of the buffer from being highlighted (bug#79272). * lisp/progmodes/rust-ts-mode.el (rust-ts-mode--fontify-scope): (rust-ts-mode--fontify-pattern): Avoid calling `string-match-p' on nil when a node is missing a parent. * test/lisp/progmodes/rust-ts-mode-resources/font-lock-no-parent.rs: Rust file that reproduces the issue. * test/lisp/progmodes/rust-ts-mode-tests.el: Test case to reproduce the issue.
7 lines
159 B
Rust
7 lines
159 B
Rust
+// intentionally invalid syntax
|
|
+const THING: [u8; 48] = [];
|
|
|
|
// should recover here and highlight the text below
|
|
trait Foo() {
|
|
// ^ font-lock-keyword-face
|
|
}
|