[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/zig-mode 6a3522f 084/104: Merge pull request #45 from joac
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/zig-mode 6a3522f 084/104: Merge pull request #45 from joachimschmidt557/revert-rx |
Date: |
Sun, 29 Aug 2021 11:37:07 -0400 (EDT) |
branch: elpa/zig-mode
commit 6a3522fce8800d84560db756d1d185781416a8ad
Merge: 88b429d 085bd30
Author: Andrea Orru <andrea@orru.io>
Commit: GitHub <noreply@github.com>
Merge pull request #45 from joachimschmidt557/revert-rx
Revert "Use rx macro and add more possibilities for type annotations"
---
zig-mode.el | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/zig-mode.el b/zig-mode.el
index 4ec5299..2b7a3a8 100644
--- a/zig-mode.el
+++ b/zig-mode.el
@@ -130,24 +130,23 @@ If given a SOURCE, execute the CMD on it."
(compilation-mode))
(revert-buffer :ignore-auto :noconfirm)))))))
-(defconst zig-re-identifier
- (rx (any "_" word)
- (* (any "_" word digit))))
+(defun zig-re-word (inner)
+ "Construct a regular expression for the word INNER."
+ (concat "\\<" inner "\\>"))
-(defconst zig-re-type
- (rx (* (| "?" "[_]" "*" "[]"))
- (regexp zig-re-identifier)))
+(defun zig-re-grab (inner)
+ "Construct a group regular expression for INNER."
+ (concat "\\(" inner "\\)"))
+(defconst zig-re-identifier "[[:word:]_][[:word:]_[:digit:]]*")
(defconst zig-re-type-annotation
- (rx (group (regexp zig-re-identifier))
- (* (any space)) ":" (* (any space))
- (group (regexp zig-re-type))))
+ (concat (zig-re-grab zig-re-identifier)
+ "[[:space:]]*:[[:space:]]*"
+ (zig-re-grab zig-re-identifier)))
(defun zig-re-definition (dtype)
"Construct a regular expression for definitions of type DTYPE."
- (rx bow (literal dtype) eow
- (+ (any space))
- (group (regexp zig-re-identifier))))
+ (concat (zig-re-word dtype) "[[:space:]]+" (zig-re-grab zig-re-identifier)))
(defconst zig-mode-syntax-table
(let ((table (make-syntax-table)))
@@ -386,10 +385,10 @@ If given a SOURCE, execute the CMD on it."
;;; Imenu support
(defun zig-re-structure-def-imenu (stype)
"Construct a regular expression for strucutres definitions of type STYPE."
- (rx bow "const" eow (+ (any space))
- (group (regexp zig-re-identifier))
- (* not-newline)
- bow (literal stype) eow))
+ (concat (zig-re-word "const") "[[:space:]]+"
+ (zig-re-grab zig-re-identifier)
+ ".*"
+ (zig-re-word stype)))
(defvar zig-imenu-generic-expression
(append (mapcar (lambda (x)
- [nongnu] branch elpa/zig-mode created (now acf3ee8), ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 9bdc960 025/104: Support multiline string literals (#8), ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode b410d5a 031/104: Add AppVeyor config, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode f26f5d0 033/104: Add "Testing" and "License" sections to README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode b0eb489 051/104: [+] Guarantee Unix line endings to avoid compiler complaining with DOS carriage return, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 32aec72 064/104: Add previous-line doc comments, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 8df4efd 078/104: Merge pull request #33 from joachimschmidt557/use-rx, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 6a3522f 084/104: Merge pull request #45 from joachimschmidt557/revert-rx,
ELPA Syncer <=
- [nongnu] elpa/zig-mode 88b429d 083/104: Merge pull request #46 from travv0/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 8f59f86 089/104: Implement beginning/end-of-defun, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 9ad0ccf 008/104: Indentation is 4 spaces by default., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode ff0bc79 006/104: Full symbols., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 814657c 018/104: Update syntax, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode a4f1e11 022/104: Just disable syntactic indentation (it's broken), ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 51a99d1 023/104: Add alternate install instructions to the README (#9), ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode cb485ff 034/104: Added anyerror keyword, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 1f4ebf1 035/104: section -> linksection, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 3cac32b 040/104: Drop #' since it's redundant, ELPA Syncer, 2021/08/29