|
12 | 12 |
|
13 | 13 | (defvar elixir-mode-syntax-table
|
14 | 14 | (let ((elixir-mode-syntax-table (make-syntax-table)))
|
| 15 | + |
| 16 | + ;; Note that ?_ might be better as class "_", but either seems to |
| 17 | + ;; work: |
15 | 18 | (modify-syntax-entry ?_ "w" elixir-mode-syntax-table)
|
| 19 | + (modify-syntax-entry ?? "w" elixir-mode-syntax-table) |
| 20 | + |
16 | 21 | (modify-syntax-entry ?' "\"" elixir-mode-syntax-table)
|
17 | 22 | (modify-syntax-entry ?# "<" elixir-mode-syntax-table)
|
18 | 23 | (modify-syntax-entry ?\n ">" elixir-mode-syntax-table)
|
|
27 | 32 | elixir-mode-syntax-table)
|
28 | 33 | "Elixir mode syntax table.")
|
29 | 34 |
|
| 35 | +(defun elixir-syntax-propertize (start end) |
| 36 | + (save-excursion |
| 37 | + (goto-char start) |
| 38 | + ;; The ? character on its own is supposed to escape whatever comes |
| 39 | + ;; after it (including any escaped chars. Examples: ?\# and ?#. |
| 40 | + (while (search-forward "?" end t) |
| 41 | + (unless (or (= (char-syntax (char-before (- (point) 1))) ?w) |
| 42 | + (= (char-syntax (char-before (- (point) 1))) ?_)) |
| 43 | + (put-text-property (1- (point)) |
| 44 | + (point) |
| 45 | + 'syntax-table |
| 46 | + '(?|)) |
| 47 | + (when (= (char-after) ?\\) |
| 48 | + (forward-char) |
| 49 | + (put-text-property (1- (point)) |
| 50 | + (point) |
| 51 | + 'syntax-table |
| 52 | + '(?\s))) |
| 53 | + (forward-char) |
| 54 | + (put-text-property (1- (point)) |
| 55 | + (point) |
| 56 | + 'syntax-table |
| 57 | + '(?|)))))) |
| 58 | + |
30 | 59 | (defmacro elixir-smie-debug (message &rest format-args)
|
31 | 60 | `(progn
|
32 | 61 | (when elixir-smie-verbose-p
|
@@ -79,7 +108,7 @@ Return non-nil if any line breaks were skipped."
|
79 | 108 |
|
80 | 109 | Return non-nil if any line breaks were skipped."
|
81 | 110 | (let ((start-line-no (line-number-at-pos (point))))
|
82 |
| - (forward-comment (point)) |
| 111 | + (forward-comment (buffer-size)) |
83 | 112 | (/= start-line-no (line-number-at-pos (point)))))
|
84 | 113 |
|
85 | 114 | (defun elixir-smie-next-token-no-lookaround (forwardp nested)
|
|
0 commit comments