[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/julia-mode 46d2469 272/352: Merge pull request #39 from rf
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/julia-mode 46d2469 272/352: Merge pull request #39 from rfourquet/rf/where |
Date: |
Sun, 29 Aug 2021 11:23:00 -0400 (EDT) |
branch: elpa/julia-mode
commit 46d2469c408888cfeeec27904116cfc22ceb1461
Merge: 04b97c4 c4a75b4
Author: Yichao Yu <yyc1992@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #39 from rfourquet/rf/where
add support for `where` keyword
---
julia-mode-tests.el | 26 +++++++++++++++++++++++---
julia-mode.el | 5 ++---
2 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/julia-mode-tests.el b/julia-mode-tests.el
index 3a0c8dd..f2320a3 100644
--- a/julia-mode-tests.el
+++ b/julia-mode-tests.el
@@ -246,12 +246,12 @@ qux"))
(julia--should-indent
"
if foo
-
+
bar
end"
"
if foo
-
+
bar
end"))
@@ -390,7 +390,7 @@ end"))
"indentation for ( following keywords"
"if( a>0 )
end
-
+
function( i=1:2 )
for( j=1:2 )
for( k=1:2 )
@@ -417,6 +417,26 @@ end")
(let ((string "function \\(a, b)"))
(julia--should-font-lock string (1- (length string)) nil)))
+(ert-deftest julia--test-function-assignment-font-locking ()
+ (julia--should-font-lock
+ "f(x) = 1" 1 'font-lock-function-name-face)
+ (julia--should-font-lock
+ "Base.f(x) = 1" 6 'font-lock-function-name-face)
+ (julia--should-font-lock
+ "f(x) where T = 1" 1 'font-lock-function-name-face)
+ (julia--should-font-lock
+ "f(x) where{T} = 1" 1 'font-lock-function-name-face))
+
+(ert-deftest julia--test-where-keyword-font-locking ()
+ (julia--should-font-lock
+ "f(x) where T = 1" 6 'font-lock-keyword-face)
+ (dolist (pos '(22 30))
+ (julia--should-font-lock
+ "function f(::T, ::Z) where T where Z
+ 1
+ end"
+ pos 'font-lock-keyword-face)))
+
(defun julia--run-tests ()
(interactive)
(if (featurep 'ert)
diff --git a/julia-mode.el b/julia-mode.el
index cd10242..737e44a 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -229,14 +229,13 @@ This function provides equivalent functionality, but
makes no efforts to optimis
(rx line-start (* (or space "@inline" "@noinline")) symbol-start
(* (seq (1+ (or word (syntax symbol))) ".")) ; module name
(group (1+ (or word (syntax symbol))))
- (* space)
(? "{" (* (not (any "}"))) "}")
- (* space)
"(" (* (or
(seq "(" (* (not (any "(" ")"))) ")")
(not (any "(" ")"))))
")"
(* space)
+ (* (seq "where" (or "{" (+ space)) (+ (not (any "=")))))
"="
(not (any "="))))
@@ -261,7 +260,7 @@ This function provides equivalent functionality, but makes
no efforts to optimis
(julia--regexp-opt
'("if" "else" "elseif" "while" "for" "begin" "end" "quote"
"try" "catch" "return" "local" "function" "macro" "ccall"
- "finally" "break" "continue" "global"
+ "finally" "break" "continue" "global" "where"
"module" "using" "import" "export" "const" "let" "do" "in"
"baremodule" "importall"
"immutable" "type" "bitstype" "abstract" "typealias" ;; remove after 0.6
- [nongnu] elpa/julia-mode addd3d4 305/352: Merge pull request #81 from JuliaEditorSupport/tp/add-substitution-tests, (continued)
- [nongnu] elpa/julia-mode addd3d4 305/352: Merge pull request #81 from JuliaEditorSupport/tp/add-substitution-tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 9df3a7e 307/352: fix variable renaming, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 1b8682b 308/352: fix travis setup, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 43cfc91 109/352: Update mailmap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 7304a4a 166/352: rename None to Union(), and Nothing to Void. fixes #8423, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode e22219f 266/352: Added another test., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 2486d1e 247/352: Replace {UTF8, ASCII, Byte}String with String, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode d3366f4 250/352: Added using, fixed bugs, added tests., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 0e3217f 243/352: Enable travis on emacs23, emacs24, emacs-snapshot., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c9d8ca6 265/352: Fix backslash character class., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 46d2469 272/352: Merge pull request #39 from rfourquet/rf/where,
ELPA Syncer <=
- [nongnu] elpa/julia-mode cb41ae0 303/352: Add unit tests for LaTeX substitution., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode df2ab77 319/352: test on Emacs25, simplify setup code (#95), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 5238f9a 323/352: Increase lookback. (#98), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 7de3b0c 330/352: Remove highlighting for :: and <:. (#112), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 1c122f1 328/352: Fix multiple type face highlighting. Add tests. (#110), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 6e9e60b 327/352: Fix forloop matching on == instead of = (#105), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode ac22747 178/352: remove trailing ws from repo, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c3d3e3a 182/352: Don't call parse-partial-sexp to find the last opening paren., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c45c786 335/352: Add more tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 549a7b4 341/352: Remove C_NULL from constants and add Cvoid, ELPA Syncer, 2021/08/29