|
52 | 52 | ;; Please keep these lists sorted
|
53 | 53 | (setq encore-keywords
|
54 | 54 | '(
|
| 55 | + "active" |
55 | 56 | "as"
|
56 | 57 | "and"
|
57 | 58 | "async"
|
58 | 59 | "await"
|
| 60 | + "borrowed" |
59 | 61 | "break"
|
60 | 62 | "by"
|
61 | 63 | "case"
|
62 | 64 | "chain"
|
63 | 65 | "class"
|
| 66 | + "consume" |
64 | 67 | "def"
|
65 | 68 | "do"
|
66 | 69 | "else"
|
67 | 70 | "end"
|
68 | 71 | "eos"
|
69 | 72 | "for"
|
70 |
| - "foreach" |
71 | 73 | "fun"
|
72 | 74 | "get"
|
73 | 75 | "getNext"
|
|
79 | 81 | "let"
|
80 | 82 | "liftf"
|
81 | 83 | "liftv"
|
| 84 | + "linear" |
| 85 | + "local" |
82 | 86 | "match"
|
83 | 87 | "module"
|
84 | 88 | "new"
|
85 | 89 | "not"
|
86 | 90 | "or"
|
87 |
| - "passive" |
88 | 91 | "print"
|
89 | 92 | "println"
|
90 | 93 | "qualified"
|
| 94 | + "read" |
91 | 95 | "repeat"
|
92 | 96 | "require"
|
| 97 | + "shared" |
93 | 98 | "stream"
|
| 99 | + "subord" |
94 | 100 | "suspend"
|
95 | 101 | "then"
|
96 | 102 | "this"
|
|
111 | 117 | "BODY"
|
112 | 118 | "EMBED"
|
113 | 119 | "END"
|
| 120 | + "unsafe" |
114 | 121 | ))
|
115 | 122 | (setq encore-constants
|
116 | 123 | '(
|
|
203 | 210 | (if (equal first "def")
|
204 | 211 | (if (string-match "\\<def\\>" line)
|
205 | 212 | (match-beginning 0)
|
206 |
| - (if (string-match "\\<passive\\>" line) |
| 213 | + (if (string-match "\\(\\<.+\\>\\)? *\\<class\\>" line) |
207 | 214 | (+ (match-beginning 0) encore-tab-width)
|
208 |
| - (if (string-match "\\<class\\>" line) |
209 |
| - (+ (match-beginning 0) encore-tab-width) |
210 |
| - (if (string-match "\\<trait\\>" line) |
211 |
| - (+ (match-beginning 0) encore-tab-width))))) |
| 215 | + (if (string-match "\\(\\<.+\\>\\)? *\\<trait\\>" line) |
| 216 | + (+ (match-beginning 0) encore-tab-width)))) |
212 | 217 |
|
213 | 218 | (if (equal first "fun")
|
214 | 219 | (if (string-match "\\<where\\>" line)
|
|
230 | 235 | (match-beginning 1)
|
231 | 236 | (if (string-match "\\<class\\>" line)
|
232 | 237 | (match-beginning 0)
|
233 |
| - (if (string-match "\\<trait\\>" line) |
| 238 | + (if (string-match "\\<.+\\>? *\\<trait\\>" line) |
234 | 239 | (match-beginning 0)))))
|
235 | 240 |
|
236 | 241 | (if (equal first "else")
|
|
305 | 310 |
|
306 | 311 | (setq encore-block-open-regex
|
307 | 312 | (concat "\\<def\\>" "\\|"
|
308 |
| - "\\<class\\>" "\\|" |
309 |
| - "\\<passive" "\\|" |
310 |
| - "\\<trait\\>" "\\|" |
| 313 | + "\\<fun\\>" "\\|" |
| 314 | + "\\(\\<.+\\>\\)? *\\<class\\>" "\\|" |
| 315 | + "\\(\\<.+\\>\\)? *\\<trait\\>" "\\|" |
311 | 316 | "\\<while\\>" "\\|"
|
312 | 317 | "\\<for\\>" "\\|"
|
313 | 318 | "\\<repeat\\>" "\\|"
|
314 | 319 | "\\<do\\>" "\\|"
|
315 |
| - "\\<fun\\>[^=>\n]*\\($\\|--\\)" "\\|" |
| 320 | + "\\<fun\\>" "\\|" |
316 | 321 | "\\<let\\>" "\\|"
|
317 | 322 | "\\<if\\>" "\\|"
|
318 | 323 | "\\<unless\\>" "\\|"
|
|
420 | 425 | (defvar encore-imenu-generic-expression
|
421 | 426 | '(("passive class" "^\s*passive\s+class\s*\\(\\<\\w+\\>\\) *\\(\\[.*\\]\\)? *:?.*" 1)
|
422 | 427 | ("active class" "^\s*class\s*\\(\\<\\w+\\>\\)" 1)
|
423 |
| - ("trait" "^\s*trait\s*\\(\\<\\w+\\>\\)" 1) |
| 428 | + ("trait" "^\\<.+\\>?\s*trait\s*\\(\\<\\w+\\>\\)" 1) |
424 | 429 | ("method definition" "^\s*def\s*\\(.*\s+\\)*\\(\\<\\w+\\>\\) *\\(\\[.*\\]\\)?(" 2)
|
425 | 430 | ("function definition" "^\s*fun\s*\\(\\w+\\) *\\(\\[.*\\]\\)?(" 1))
|
426 | 431 | "Contains regexes to parse Encore with imenu")
|
|
466 | 471 | (error " *** Error during typechecking *** \n"
|
467 | 472 | "\"" (file-name) "\"" " (line " line ", column " column ")\n"
|
468 | 473 | (message))
|
| 474 | + (error " *** Error during capturechecking *** \n" |
| 475 | + "\"" (file-name) "\"" " (line " line ", column " column ")\n" |
| 476 | + (message)) |
469 | 477 | (info line-start "Importing module" (message) line-end)
|
470 | 478 | )
|
471 | 479 | :modes encore-mode)
|
|
0 commit comments