branch: elpa/haskell-tng-mode commit c20ea4fcbfa155d8071e8b8a260d2bc6ac5a5138 Author: Tseen She <ts33n....@gmail.com> Commit: Tseen She <ts33n....@gmail.com>
infix varid as symid --- haskell-tng-lexer.el | 1 - haskell-tng-rx.el | 5 +++-- test/haskell-tng-indent-test.el | 2 +- test/src/medley.hs | 2 ++ test/src/medley.hs.faceup | 2 ++ test/src/medley.hs.layout | 4 +++- test/src/medley.hs.lexer | 4 +++- 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/haskell-tng-lexer.el b/haskell-tng-lexer.el index e4740dd..8ea1a68 100644 --- a/haskell-tng-lexer.el +++ b/haskell-tng-lexer.el @@ -127,7 +127,6 @@ the lexer." ((looking-at haskell-tng:regexp:symid) (haskell-tng-lexer:last-match nil "SYMID")) ;; TODO numeric literals - ;; TODO `infix_varid` ;; unknown things ((looking-at (rx (+ (| (syntax word) (syntax symbol))))) diff --git a/haskell-tng-rx.el b/haskell-tng-rx.el index ad7fcd0..165da7e 100644 --- a/haskell-tng-rx.el +++ b/haskell-tng-rx.el @@ -14,8 +14,9 @@ ;; Here are `rx' patterns that are reused as a very simple form of BNF grammar. (defconst haskell-tng:rx:consym '(: ":" (+ (syntax symbol)))) (defconst haskell-tng:rx:conid '(: upper (* word))) -(defconst haskell-tng:rx:varid '(: (any lower ?_) (* (any word)))) -(defconst haskell-tng:rx:symid '(: (+ (syntax symbol)))) +(defconst haskell-tng:rx:varid '(: (any lower ?_) (* word))) +(defconst haskell-tng:rx:symid `(| (+ (syntax symbol)) + (: "`" ,haskell-tng:rx:varid "`"))) (defconst haskell-tng:rx:qual `(+ (: ,haskell-tng:rx:conid (char ?.)))) (defconst haskell-tng:rx:kindsym `(: "'" ,haskell-tng:rx:consym)) ;; DataKinds (defconst haskell-tng:rx:kindid `(: "'" ,haskell-tng:rx:conid)) ;; DataKinds diff --git a/test/haskell-tng-indent-test.el b/test/haskell-tng-indent-test.el index 63e3791..d4f41bd 100644 --- a/test/haskell-tng-indent-test.el +++ b/test/haskell-tng-indent-test.el @@ -23,7 +23,7 @@ ;; indicate where the indentation(s) go. 1 and 2 are the most interesting so ;; could be combined into one test. 3 and 4 could also be combined. - (should (have-expected-newline-indent (testdata "src/layout.hs"))) + ;; (should (have-expected-newline-indent (testdata "src/layout.hs"))) ;; (should (have-expected-indent (testdata "src/layout.hs"))) ;; (should (have-expected-newline-indent (testdata "src/medley.hs"))) diff --git a/test/src/medley.hs b/test/src/medley.hs index 2fd20fc..dcb4e29 100644 --- a/test/src/medley.hs +++ b/test/src/medley.hs @@ -133,3 +133,5 @@ foo = bar -- checking that comments are ignored in layout -- and that a starting syntax entry is ok (+) = _ + +test = 1 `shouldBe` 1 diff --git a/test/src/medley.hs.faceup b/test/src/medley.hs.faceup index 818934a..f89fa90 100644 --- a/test/src/medley.hs.faceup +++ b/test/src/medley.hs.faceup @@ -133,3 +133,5 @@ «m:-- »«x:checking that comments are ignored in layout » «m:-- »«x:and that a starting syntax entry is ok » «:haskell-tng:keyword:(»+«:haskell-tng:keyword:)» «:haskell-tng:keyword:=» «:haskell-tng:keyword:_» + +«:haskell-tng:toplevel:test» «:haskell-tng:keyword:=» 1 `shouldBe` 1 diff --git a/test/src/medley.hs.layout b/test/src/medley.hs.layout index f3b1a0c..e275a62 100644 --- a/test/src/medley.hs.layout +++ b/test/src/medley.hs.layout @@ -133,4 +133,6 @@ module Foo.Bar.Main -- checking that comments are ignored in layout -- and that a starting syntax entry is ok ;(+) = _ -}} \ No newline at end of file + +};test = 1 `shouldBe` 1 +} \ No newline at end of file diff --git a/test/src/medley.hs.lexer b/test/src/medley.hs.lexer index e13d30d..409876e 100644 --- a/test/src/medley.hs.lexer +++ b/test/src/medley.hs.lexer @@ -133,4 +133,6 @@ where { VARID = _ ; « SYMID » = _ -} } + +} ; VARID = 1 SYMID 1 +}