branch: elpa/haskell-tng-mode commit bfe859ad617629024aff6357331c4782c5c353fb Author: Tseen She <ts33n....@gmail.com> Commit: Tseen She <ts33n....@gmail.com>
notes about lexers --- haskell-tng-lexer.el | 7 ++++++- haskell-tng-smie.el | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/haskell-tng-lexer.el b/haskell-tng-lexer.el index c0c252c..e4740dd 100644 --- a/haskell-tng-lexer.el +++ b/haskell-tng-lexer.el @@ -10,10 +10,14 @@ ;; ;;; Code: -;; See also (other than the GHC alex lexer) +;; See also ;; +;; https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/parser/Lexer.x ;; https://github.com/carymrobbins/intellij-haskforce/blob/master/src/com/haskforce/parsing/_HaskellParsingLexer.flex ;; https://github.com/typelead/intellij-eta/blob/eta-ide/plugin/src/main/eta/IntelliJ/Plugin/Eta/Lang/Lexer/EtaParsingLexer.hs +;; https://www.haskell.org/hugs/downloads/2006-09/hugs98-Sep2006.tar.gz (src/parser.y) +;; https://github.com/haskell-lisp/yale-haskell/blob/master/parser/lexer.scm +;; http://bnfc.digitalgrammars.com/ ;; ;; We could potentially use FFI + Flex to do the lexing for us, giving us access ;; to much more powerful regexp rules (Emacs doesn't support zero width @@ -123,6 +127,7 @@ 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-smie.el b/haskell-tng-smie.el index 42fb3ad..5472934 100644 --- a/haskell-tng-smie.el +++ b/haskell-tng-smie.el @@ -26,6 +26,7 @@ ;; https://www.gnu.org/software/emacs/manual/html_mono/elisp.html#SMIE-Grammar ;; https://www.haskell.org/onlinereport/haskell2010/haskellch3.html +;; https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/parser/Parser.y ;; ;; Many of these grammar rules cannot be expressed in SMIE because Haskell uses ;; whitespace separators a lot, whereas the BNF must use non-terminals.