diff options
| author | Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org> | 2019-12-25 14:56:08 -0500 |
|---|---|---|
| committer | Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org> | 2019-12-25 15:43:38 -0500 |
| commit | 9b8515bb95a314e536693d42dabe1888e0fee131 (patch) | |
| tree | 0b7ed6afd91269da97500a4bc0342152364be3c3 | |
| parent | b996da5e3bae842eacba4b3e429899bb841b077e (diff) | |
Fix regex for identifiers.
| -rw-r--r-- | myrddin-mode.el | 15 |
1 files changed, 14 insertions, 1 deletions
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")) |