From 5d3e0d18c273c512c5681b3b178b541bb8b4adec Mon Sep 17 00:00:00 2001 From: Ranjit Jhala Date: Thu, 13 Dec 2018 21:28:58 -0800 Subject: [PATCH 1/4] add support for liquidhaskell annotations --- syntaxes/haskell.tmLanguage | 17 +++++++++++++++++ test/syntax-examples/test.hs | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/syntaxes/haskell.tmLanguage b/syntaxes/haskell.tmLanguage index 68e3249..2435c55 100644 --- a/syntaxes/haskell.tmLanguage +++ b/syntaxes/haskell.tmLanguage @@ -12,6 +12,23 @@ Haskell patterns + + name + block.liquidhaskell.haskell + contentName + block.liquidhaskell.haskell + begin + \{-@ + end + @-\} + patterns + + + include + #type_signature + + + captures diff --git a/test/syntax-examples/test.hs b/test/syntax-examples/test.hs index 5576509..8401d17 100644 --- a/test/syntax-examples/test.hs +++ b/test/syntax-examples/test.hs @@ -1,6 +1,7 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE RecursiveDo #-} + module Main (module M , M @@ -137,4 +138,4 @@ class (AClass a, AnotherClass b) => Manager manager where managerModifySession :: (Manages manager -> Manages manager) -> Handler v manager (Manages manager) managerModifySession f = managerGetSession >>= \sess -> managerSetSession (f sess) >> return sess - {-# MINIMAL managerGetSession, managerSetSession | managerModifySession #-} + {-# MINIMAL managerGetSession, managerSetSession | managerModifySession #-} \ No newline at end of file From b15f8aaa885fdc68b8b2973f72a5d72e6bf8f5ac Mon Sep 17 00:00:00 2001 From: Ranjit Jhala Date: Thu, 13 Dec 2018 21:33:00 -0800 Subject: [PATCH 2/4] test for LiquidHaskell highlighting --- test/syntax-examples/LiquidHaskell.hs | 6 ++++++ test/syntax-examples/test.hs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 test/syntax-examples/LiquidHaskell.hs diff --git a/test/syntax-examples/LiquidHaskell.hs b/test/syntax-examples/LiquidHaskell.hs new file mode 100644 index 0000000..e629fe9 --- /dev/null +++ b/test/syntax-examples/LiquidHaskell.hs @@ -0,0 +1,6 @@ +module LiquidHaskell where + +{-@ incr :: x:Nat -> {v:Nat | v > x} @-} +incr :: Int -> Int +inct x = x + 1 + diff --git a/test/syntax-examples/test.hs b/test/syntax-examples/test.hs index 8401d17..2da3129 100644 --- a/test/syntax-examples/test.hs +++ b/test/syntax-examples/test.hs @@ -138,4 +138,4 @@ class (AClass a, AnotherClass b) => Manager manager where managerModifySession :: (Manages manager -> Manages manager) -> Handler v manager (Manages manager) managerModifySession f = managerGetSession >>= \sess -> managerSetSession (f sess) >> return sess - {-# MINIMAL managerGetSession, managerSetSession | managerModifySession #-} \ No newline at end of file + {-# MINIMAL managerGetSession, managerSetSession | managerModifySession #-} From 7df286bcc2cf8fa9f821b3ed03a5523340c9ad5c Mon Sep 17 00:00:00 2001 From: Ranjit Jhala Date: Thu, 13 Dec 2018 21:35:25 -0800 Subject: [PATCH 3/4] test for LiquidHaskell highlighting --- test/syntax-examples/LiquidHaskell.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/syntax-examples/LiquidHaskell.hs b/test/syntax-examples/LiquidHaskell.hs index e629fe9..a23dd02 100644 --- a/test/syntax-examples/LiquidHaskell.hs +++ b/test/syntax-examples/LiquidHaskell.hs @@ -2,5 +2,5 @@ module LiquidHaskell where {-@ incr :: x:Nat -> {v:Nat | v > x} @-} incr :: Int -> Int -inct x = x + 1 +incr x = x + 1 From 6e5e1925d99c979adc3b0879cf146f47dd85fcd2 Mon Sep 17 00:00:00 2001 From: Ranjit Jhala Date: Thu, 13 Dec 2018 21:45:28 -0800 Subject: [PATCH 4/4] use self --- syntaxes/haskell.tmLanguage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/haskell.tmLanguage b/syntaxes/haskell.tmLanguage index 2435c55..41b0dd3 100644 --- a/syntaxes/haskell.tmLanguage +++ b/syntaxes/haskell.tmLanguage @@ -25,7 +25,7 @@ include - #type_signature + $self