[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 08f924c 088/385: simplify the grammar rul
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 08f924c 088/385: simplify the grammar rules, better s-exps |
Date: |
Tue, 5 Oct 2021 23:59:07 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 08f924c7372d927c6c62edfdfe11da8c15e7d75b
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
simplify the grammar rules, better s-exps
---
haskell-tng-smie.el | 41 ++++++++++++++++++-----------------------
test/src/grammar.hs.sexps | 6 +++---
test/src/layout.hs.sexps | 2 +-
3 files changed, 22 insertions(+), 27 deletions(-)
diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index b549e27..816767e 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -46,40 +46,35 @@
'((id)
;; commas only allowed in brackets
- (context
- ("(" context ")")
- (context "," context))
+ (list
+ ("(" list ")")
+ ("[" list "]")
+ (list "," list))
- ;; operators, we don't care about precedences
+ ;; operators all have the same precedence
(infixexp
- (id "SYMID" infixexp)
- (id))
+ (id "SYMID" infixexp))
;; WLDOs
(wldo
- ("where" decls)
- ("let" decls)
- ("do" stmts)
- ("of" alts))
- (decls
- ("{" decls "}")
- (decls ";" decls)
+ ("where" block)
+ ("let" block "in")
+ ("do" block)
+ ("case" id "of" block))
+ (block
+ ("{" block "}")
+ (block ";" block)
+ (id "<-" id)
+ (id "->" id)
(id "=" id))
- (stmts
- ("{" stmts "}")
- (stmts ";" stmts)
- (id "<-" id))
- (alts
- ("{" alts "}")
- (alts ";" alts)
- (id "->" id))
+ (logic
+ ("if" id "then" id "else" id))
)
;; operator precedences
'((assoc ";")
- (assoc ",")
- )
+ (assoc ","))
)))
diff --git a/test/src/grammar.hs.sexps b/test/src/grammar.hs.sexps
index e5cfece..155fe72 100644
--- a/test/src/grammar.hs.sexps
+++ b/test/src/grammar.hs.sexps
@@ -2,7 +2,7 @@
(module) (Foo.(Bar)) (where
((calc) (::) (Int) -> (Int)
-((calc) (a) = (if) (a) < (10)
- (then) (a) + (a) * (a) + (a)
- (else) ((a) + (a)) * ((a) + (a)))
+((calc) (a) = (if (a) < ((10)
+ (then) (a) + (a) * (a) + ((a)
+ (else) ((a) + (a)) * ((a) + (a))))))
))
\ No newline at end of file
diff --git a/test/src/layout.hs.sexps b/test/src/layout.hs.sexps
index fa4bddc..95d7726 100644
--- a/test/src/layout.hs.sexps
+++ b/test/src/layout.hs.sexps
@@ -13,7 +13,7 @@
))))(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
+ = ((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
- [nongnu] elpa/haskell-tng-mode a5f779d 047/385: initial SMIE tests, (continued)
- [nongnu] elpa/haskell-tng-mode a5f779d 047/385: initial SMIE tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode dae43ac 049/385: improvements to the default lexer, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode d76c6ad 053/385: some thoughts on WLDO detection, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3e53f56 055/385: cleaner lexer test output, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 73e2b11 063/385: the new lexer works!, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8e1a225 068/385: sexp tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 269be91 072/385: revert broken grammar rules, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3194e62 074/385: stefan to the rescue, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b690037 081/385: comment-* support, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 502cc26 085/385: document a failure mode, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 08f924c 088/385: simplify the grammar rules, better s-exps,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 71cf945 048/385: lexer test based on Haskell2010, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4d6bbfc 050/385: feedback from Stefan, improving lexing, ELPA Syncer, 2021/10/06
- [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