From c69aa3f3fc5a3bf1f517f27535176336b10111b1 Mon Sep 17 00:00:00 2001 From: Ross Donaldson Date: Sat, 3 Jun 2017 12:06:24 -0700 Subject: [PATCH 1/2] Fix a few small bugs The first pipe in a [|list|] was turning blue. Highlight <|s. --- fsharp-mode-font.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fsharp-mode-font.el b/fsharp-mode-font.el index c86fd6b..7d23892 100644 --- a/fsharp-mode-font.el +++ b/fsharp-mode-font.el @@ -168,7 +168,7 @@ with initial value INITVALUE and optional DOCSTRING." "Match the full range of pipe operators -- |>, ||>, |||>, etc.") (def-fsharp-compiled-var fsharp-operator-case-regexp - "\\s-*\\(|\\)[A-Za-z0-9_' ]" + "\\s-+\\(|\\)[A-Za-z0-9_' ]" "Match literal | in contexts like match and type declarations.") (defvar fsharp-imenu-generic-expression @@ -283,17 +283,16 @@ with initial value INITVALUE and optional DOCSTRING." (,fsharp-type-def-regexp 1 font-lock-type-face) (,fsharp-function-def-regexp 1 font-lock-function-name-face) (,fsharp-pattern-function-regexp 1 font-lock-function-name-face) - ;; (,fsharp-active-pattern-regexp 1 font-lock-function-name-face) + ;; Active records ("(|" (0 'fsharp-ui-operator-face) - ("\\([A-Za-z'_]+\\)\\(|)?\\)" nil nil + ("\\([A-Za-z'_]+\\)\\(|)\\)" nil nil (1 font-lock-function-name-face) (2 'fsharp-ui-operator-face))) + (,fsharp-operator-pipe-regexp . 'fsharp-ui-operator-face) (,fsharp-member-function-regexp 1 font-lock-function-name-face) (,fsharp-overload-operator-regexp 1 font-lock-function-name-face) (,fsharp-constructor-regexp 1 font-lock-function-name-face) (,fsharp-operator-case-regexp 1 'fsharp-ui-operator-face) - (,fsharp-operator-pipe-regexp . 'fsharp-ui-operator-face) - (,fsharp-operator-quote-regexp (1 'fsharp-ui-operator-face) (2 'fsharp-ui-operator-face)) ("[^:]:\\s-*\\(\\<[A-Za-z0-9_' ]*[^ ;\n,)}=<-]\\)\\(<[^>]*>\\)?" From b3a864e2228d978e79860fe85292f4ca83b32156 Mon Sep 17 00:00:00 2001 From: Ross Donaldson Date: Sat, 3 Jun 2017 12:14:05 -0700 Subject: [PATCH 2/2] Update faceup to capture font-locking <| --- test/apps/FQuake3/NativeMappings.fs.faceup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/apps/FQuake3/NativeMappings.fs.faceup b/test/apps/FQuake3/NativeMappings.fs.faceup index 63bc27b..0a720c4 100644 --- a/test/apps/FQuake3/NativeMappings.fs.faceup +++ b/test/apps/FQuake3/NativeMappings.fs.faceup @@ -162,8 +162,8 @@ Copyright (C) 1999-2005 Id Software, Inc. «k:module» «t:Bounds» = «k:let» «k:inline» «f:ofNativePtr» («v:ptr»: «t:nativeptr»«:fsharp-ui-generic-face:») = Bounds ( - Vec3.ofNativePtr <«:fsharp-ui-operator-face:|» NativePtr.add ptr 0, - Vec3.ofNativePtr <«:fsharp-ui-operator-face:|» NativePtr.add ptr 1) + Vec3.ofNativePtr «:fsharp-ui-operator-face:<|» NativePtr.add ptr 0, + Vec3.ofNativePtr «:fsharp-ui-operator-face:<|» NativePtr.add ptr 1) «k:let» «k:inline» «f:toNativeByPtr» («v:ptr»: «t:nativeptr»«:fsharp-ui-generic-face:») («v:bounds»: «t:Bounds») = «k:let» «k:mutable» «v:nativeX» = NativePtr.get ptr 0