From 739ca0fd428fc8b2d246e04c9e5e20733a5fd8cc Mon Sep 17 00:00:00 2001 From: Ronan Arraes Jardim Chagas Date: Tue, 18 Aug 2020 21:00:33 -0300 Subject: [PATCH 1/2] Improve highlighting of Julia operators --- modules/lang/julia/config.el | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/lang/julia/config.el b/modules/lang/julia/config.el index b9190ec1c..8722e6a16 100644 --- a/modules/lang/julia/config.el +++ b/modules/lang/julia/config.el @@ -12,20 +12,30 @@ mode `((,(let ((OR "\\|")) (concat "\\(" ; stolen `matlab.el' operators first - "[<>!]=?" OR + "[<>]=?" OR "\\.[/*^']" OR + "===" OR "==" OR "=>" OR "\\" OR "[-+*\\/^&|$]=?" OR ; this has to come before next (updating operators) - "[-!^&|*+\\/~:]" OR + "[-^&|*+\\/~]" OR + ;; `:` defines a symbol in Julia and must not be highlighted + ;; as an operator. The only operators that start with `:` are + ;; `:<` and `::`. + "[:<]:" OR + ;; Julia variables and names can have `!`. Thus, `!` must be + ;; highlighted as a single operator only in some + ;; circumstances. However, full support can only be + ;; implemented by a full parser. Thus, here, we will handle + ;; only the simple cases. + "[[:space:]]!=?=?" OR "^!=?=?" OR + ;; The other math operators that starts with `!`. ;; more extra julia operators follow "[%$]" OR ;; bitwise operators ">>>" OR ">>" OR "<<" OR ">>>=" OR ">>" OR "<<" OR - ;; comparison - "[<>!]=?" OR "\\)")) 1 font-lock-type-face))))) From e9d70c861ab231418c7d0ce7bbb5066c263a96a0 Mon Sep 17 00:00:00 2001 From: Ronan Arraes Jardim Chagas Date: Tue, 18 Aug 2020 21:26:41 -0300 Subject: [PATCH 2/2] Fix highlighting of operator <: --- modules/lang/julia/config.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/lang/julia/config.el b/modules/lang/julia/config.el index 8722e6a16..dd2a0ed56 100644 --- a/modules/lang/julia/config.el +++ b/modules/lang/julia/config.el @@ -12,6 +12,10 @@ mode `((,(let ((OR "\\|")) (concat "\\(" ; stolen `matlab.el' operators first + ;; `:` defines a symbol in Julia and must not be highlighted + ;; as an operator. The only operators that start with `:` are + ;; `:<` and `::`. This must be defined before `<`. + "[:<]:" OR "[<>]=?" OR "\\.[/*^']" OR "===" OR @@ -20,10 +24,6 @@ "\\" OR "[-+*\\/^&|$]=?" OR ; this has to come before next (updating operators) "[-^&|*+\\/~]" OR - ;; `:` defines a symbol in Julia and must not be highlighted - ;; as an operator. The only operators that start with `:` are - ;; `:<` and `::`. - "[:<]:" OR ;; Julia variables and names can have `!`. Thus, `!` must be ;; highlighted as a single operator only in some ;; circumstances. However, full support can only be