[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode b8f3e3f 079/385: back out incomplete gram
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode b8f3e3f 079/385: back out incomplete grammar rules |
Date: |
Tue, 5 Oct 2021 23:59:05 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit b8f3e3fe6f9c516a9fad5b61e4bdf5224f8feb2c
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
back out incomplete grammar rules
---
haskell-tng-smie.el | 33 +++++++++++++++++++++++----------
test/src/layout.hs.sexps | 12 ++++++------
2 files changed, 29 insertions(+), 16 deletions(-)
diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index 619773f..a584b2c 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -61,19 +61,28 @@
(smie-prec2->grammar
(smie-bnf->prec2
'((id)
- (exp
- (infixexp "::" context "=>" type)
- (infixexp "::" type)
- (infixexp))
+ ;; We do not include rules that do not have an impact on indentation.
+ ;; Navigation with the more complete grammar is less than satisfactory,
+ ;; therefore there is no reason to maintain it.
+ ;; (exp
+ ;; (infixexp "::" context "=>" type)
+ ;; (infixexp "::" type)
+ ;; (infixexp))
+ (exp (id))
+
+ ;; TODO => and -> may require custom indentation rules
+
+ ;; FIXME don't give up hope yet, first see if exp is useful when type is
+ ;; defined properly.
(context
("(" context ")")
(context "," context))
- ;; TODO the lexer should provide virtual infix operators
- (infixexp
- (lexp "$" infixexp)
- (lexp))
+ ;; ;; TODO the lexer should provide virtual infix operators
+ ;; (infixexp
+ ;; (lexp "$" infixexp)
+ ;; (lexp))
(lexp
("if" exp "then" exp "else" exp)
@@ -97,8 +106,12 @@
)
;; operator precedences
- '((left ";" "," "::" "else" "in" "of" "->" "do" "<-" "where" "=")
- (left "$"))
+ '(;;(left ";" "," "::" "else" "in" "of" "->" "do" "<-" "where" "=")
+ ;;(left ";" ",")
+ (assoc ",") ;; TODO , and ; conflict but what's the correct ordering?
+ (assoc ";")
+;; (left "$")
+ )
)))
diff --git a/test/src/layout.hs.sexps b/test/src/layout.hs.sexps
index b260243..4106a8f 100644
--- a/test/src/layout.hs.sexps
+++ b/test/src/layout.hs.sexps
@@ -1,20 +1,20 @@
((--) (Figure) (2.1) (from) (the) (Haskell2010) (report)
(module)) (AStack)(( (Stack), (push), (pop), (top), (size) )) (where
-(((data) (Stack) (a) = (Empty)
+((data) (Stack) (a) = (Empty)
(|) (MkStack) (a) (((Stack) (a)))
-(push) (::) (((a) (->) ((Stack) (a) (->) (Stack) (a)))
+((((push) (::) (a) (->) (Stack) (a)) (->) (Stack) (a)))
((push) (x) (s) = (MkStack) (x) (s))
-(size) (::) ((((Stack) (a) (->) (Int))
+(((size) (::) (Stack) (a) (->) (Int)))
((size) (s) = (length) (((stkToLst) (s))) (where
((stkToLst) (Empty) = ([])
((stkToLst) (((MkStack) (x) (s))) = (x:xs) (where ((xs) =
(stkToLst) (s)
-)))))))(pop) (::) (((Stack) (a) (->) (((a), (Stack) (a))))
+))))((pop) (::) (Stack) (a) (->) (((a), (Stack) (a))))
((pop) (((MkStack) (x) (s)))
= (((x), ((case (s) (of) ((r (->) (i) (r) (where (i (x) = x))))))))) ((--)
(((pop) (Empty))) (is) (an) (error)
-(top)) (::) ((Stack) (a) (->) (a))
-((top) (((MkStack) (x) (s))) = (x)))))) (--) (((top)
(Empty))) (is) (an) (error)
+(((top) (::) (Stack) (a) (->) (a))))
+((top) (((MkStack) (x) (s))) = (x)))) (--) (((top)
(Empty))) (is) (an) (error)
))
\ No newline at end of file
- [nongnu] elpa/haskell-tng-mode 96609e4 052/385: thoughts on layout inference, (continued)
- [nongnu] elpa/haskell-tng-mode 96609e4 052/385: thoughts on layout inference, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 06b357c 054/385: hacky closing braces, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 64ad4a8 057/385: refactored to centralise state, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 0ac5a2f 059/385: copyright years and move the test assertions, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a6bb27e 061/385: [ci skip] layout algorithm implemented and tested, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 7d2863e 065/385: tests for SMIE state invalidation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 41a29dd 066/385: backward lexer, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c48e7a5 069/385: starting to transcribe the expression table, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 1f1110a 073/385: transcribe the grammar rules, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 01789b1 075/385: y u no haskell-mode?, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b8f3e3f 079/385: back out incomplete grammar rules,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 9e19b2b 080/385: double down on simpler grammar, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6e7a24f 083/385: lexer identifies conid / varid, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b12e49a 086/385: consym, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 7d6fa3d 091/385: thoughts on lexers, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6a05d12 090/385: planning for indentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 2060f7a 092/385: thoughts on indentation testing, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6d2d764 094/385: skeleton for indentation tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 0d04664 115/385: implement batch compilation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode adb3c50 143/385: better insert indentation suggestions, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e79577e 132/385: match ghc source paths when compiling, ELPA Syncer, 2021/10/06