From fffa295d3c3ec2b03fca7a1c7d12384203ed62a9 Mon Sep 17 00:00:00 2001 From: Laborratte5 Date: Mon, 15 Jul 2024 22:22:56 +0200 Subject: [PATCH] Add tokens to Lexer --- app/Lexer.hs | 10 ++++++++++ simple-arithmetic-compiler.cabal | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 app/Lexer.hs diff --git a/app/Lexer.hs b/app/Lexer.hs new file mode 100644 index 0000000..cdf1d19 --- /dev/null +++ b/app/Lexer.hs @@ -0,0 +1,10 @@ +module Lexer where + +data Token = Plus + | Minus + | Multiply + | Divide + | Integer Int + | LBrace + | RBrace + deriving Show diff --git a/simple-arithmetic-compiler.cabal b/simple-arithmetic-compiler.cabal index f2f4b2a..7ba5860 100644 --- a/simple-arithmetic-compiler.cabal +++ b/simple-arithmetic-compiler.cabal @@ -52,7 +52,7 @@ executable simple-arithmetic-compiler main-is: Main.hs -- Modules included in this executable, other than Main. - -- other-modules: + other-modules: Lexer -- LANGUAGE extensions used by modules in this package. -- other-extensions: