From 9b8515bb95a314e536693d42dabe1888e0fee131 Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Wed, 25 Dec 2019 14:56:08 -0500 Subject: Fix regex for identifiers. --- myrddin-mode.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/myrddin-mode.el b/myrddin-mode.el index 977d99e..5c45610 100644 --- a/myrddin-mode.el +++ b/myrddin-mode.el @@ -93,7 +93,20 @@ (defconst myrddin-mode-constants '("true" "false" "void")) -(defvar myrddin-mode-variable-declaration-regexp +(defvar myrddin-mode-block-keywords + '("elif" "else" "for" "if" "match" "struct" "trait" "while")) + +(defconst myrddin-mode-identifier-rx + '(and (or alpha ?_) + (zero-or-more (or alnum ?_)))) + +(defconst myrddin-mode-type-name-rx + '(and + (eval myrddin-mode-identifier-rx) + (optional (or (and ?[ (zero-or-more any) ?]) + ?#)))) + +(defconst myrddin-mode-variable-declaration-regexp (rx (and (or "const" "var" "generic") (zero-or-more (or "extern" "pkglocal" "#noret")) -- cgit v1.3